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

Commands from skipped tests are not logged to terminal #111

Closed
mmayors opened this issue Aug 3, 2021 · 1 comment
Closed

Commands from skipped tests are not logged to terminal #111

mmayors opened this issue Aug 3, 2021 · 1 comment

Comments

@mmayors
Copy link

mmayors commented Aug 3, 2021

First of all amazing work! I've spent more time than I should trying to re-route everything to stdout. This package has been a godsend.

Issue description

If a test is programmatically skipped with Mocha's this.skip() any commands made before skip() are not logged to the terminal, including commands in a beforeEach(). Is this intentional?

Steps to reproduce the issue

  • cypress: 7.7.0
  • cypress-terminal-report: 3.2.2
  • cypress.json - experimentalInteractiveRunEvents: true
  • installLogsCollector - enableExtendedCollector: true
  1. Write a global beforeEach in support/index.js
  2. Write a test that invokes a command (or series of commands), chains the last one, then invokes this.skip().

What's the expected result?

All commands invoked in step 2, including the global beforeEach are logged to the terminal.

What's the actual result?

None of the commands invoked in step 2 are logged to the terminal.

Additional details / screenshot

Minimal Repro: https://github.com/mmayors/cypress-terminal-report-skipped-test

I noticed that when a test is skipped the test event handler attached to Mocha is invoked twice: Once when the test begins and again after this.skip(). The 2nd time the test argument has an err property set:

{
  "message": "sync skip; aborting execution",
  "name": "CypressError",
  "isPending": true,
  ...
}

I don't know how all the command logs are pulled together but it appears commands captured before this.skip() are being discarded because startTest is called twice for the same test. Let me know if you need any additional info!

archfz added a commit that referenced this issue Aug 4, 2021
archfz added a commit that referenced this issue Aug 4, 2021
#111: Add support for skipped tests.
@archfz
Copy link
Owner

archfz commented Aug 4, 2021

Added support in 3.3.0. But please note that the error part is cypress issue cypress-io/cypress#14867

@archfz archfz closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants