-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Skipped tests due to a failure in before() are not reported #7302
Comments
When there is an error thrown within a I can't speak to how junit creates their reports. This is how we've implemented failures in hooks, so if there is a failure in a hook, you should expect one test to be attributed as a 'fail' and the rest as 'skip' within all of Cypress reporting. Outside reports are outside of our control. |
This is the desired behavior: “If there is a failure in a hook, you should expect one test to be attributed as a ‘fail’ and the rest as ‘skip’ within all of Cypress reporting.” The issue is that what Mocha reporters report are not that. As you see in my screenshots and snippets, Cypress correctly reports skipped tests in the command line output and the GUI, but the test reporters don’t report skipped tests. In this page, the Cypress docs say “Because Cypress is built on top of Mocha, that means any reporter built for Mocha can be used with Cypress.” What I suspect is simply that there is some inconsistency with how Mocha registers skipped tests and how Cypress does, and that inconsistency should be fixed so the reporting is correct. This is not an issue in a third party reporter like JUnit, but rather how Cypress sends its test data to all Mocha reporters. |
Hey Cypress team, any update on this? Thanks a lot! |
When you run this simple test:
You get the following command line output:
And the GUI looks like this:
Both the command line and the GUI reports one skipped test: “Should also be skipped”. But the XML report created using the JUnit reporter doesn’t list the test case as a skipped test; it just vanishes:
To Jenkins, the total number of tests is one. If the test didn’t fail in
before()
, the report would instead look like this:You can see that if
before()
succeeds, we get two test cases, but if it fails, we get one.These are my reporter options:
I have tried turning on and off
jenkinsMode
, and have tried other reporters, including “json”, “spec”, and “mocha-jenkins-reporter”. None of them correctly report skipped tests.I believe fixing this issue is important because the reported test results should match what the user sees in the command line or the GUI.
I am using Cypress 4.4.0 on Windows 10.
The text was updated successfully, but these errors were encountered: