Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook logs are missing in terminal when there are nested Describe/Context blocks #268

Closed
ntermartirosyan opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ntermartirosyan
Copy link

Given there's a test with nested Describe/Context blocks
When test fails in the hook there are no logs from cypress commands in the terminal
Code example:

describe("Describe 1", () => {
  before(() => {
    cy.log("Log 1")
      .then(() => {
        expect(false, "Expect 1").to.be.true;
      });
  });

  describe("Nested Describe", () => {
    it("it 1", () => {
      cy.log("Log 2");
    });
  });
});

Result in Terminal :
image

When there is no nested Describe/Context block then the logs can be seen in the terminal

describe("Describe 1", () => {
  before(() => {
    cy.log("Log 1")
      .then(() => {
        expect(false, "Expect 1").to.be.true;
      });
  });

  // describe("Nested Describe", () => {
    it("it 1", () => {
      cy.log("Log 2");
    });
  // });
});

image

@ntermartirosyan
Copy link
Author

Tested on version: 7.0.4
Cypress version: 13.12.0
these are my configs

require("cypress-terminal-report/src/installLogsCollector")({
  enableExtendedCollector: true,
  xhr: {
    printHeaderData: true,
    printRequestData: true,
  }
});

require("cypress-terminal-report/src/installLogsPrinter")(on, {
  printLogsToConsole: "always",
  includeSuccessfulHookLogs: true,
});

let me know if additional info is needed.

@archfz archfz self-assigned this Nov 20, 2024
@archfz archfz added the bug Something isn't working label Nov 20, 2024
@archfz
Copy link
Owner

archfz commented Nov 28, 2024

Released in 7.1.0

@archfz archfz closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants