-
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
Screenshot (failed) captured during skipped tests #17660
Comments
I'm seeing this with 8.4.1 using the https://github.com/cypress-io/cypress-skip-test plugin, as well. |
I have this issue as well, i am not able to use describe('tests', () => {
it('failing test', function () {
if (process.env.FOO_ENABLED === 'false') {
this.skip();
}
console.assert(false);
});
}); I get the feeling that the docs are over simplifying, maybe there is not really Mocha under Cypress. https://docs.cypress.io/faq/questions/general-questions-faq#Mocha
I can see references to mocha https://github.com/cypress-io/cypress/search?q=mocha I made a sample repo which demos how Mocha skips work, in case you want to use it to find out why Cypress isn't able to support this.skip() https://github.com/cesine/mocha-skip-demo |
Same bug when using cypress-cucumber-preprocessor, which I use to filter tests by tags, thus I'm having plenty of failed screenshots when none of my tests fail. |
I think I am running into this, but even in a weirder form on 8.7.0. In my case, is have two test specs, called Foo and Bar. In Foo.spec.ts, I have a failing case: describe('Foo', () => {
it('foo fails', () => {
throw new Error('Fail');
});
}); I have describe('Bar', () => {
it.skip('skip', () => {
// noop
});
}); When running the tests, I had the following screenshot saved:
The test output shows that I have no idea what's going on with that. |
The code for this is done in cypress-io/cypress#19279, but has yet to be released. |
The code for this is done in cypress-io/cypress#19331, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
In some circumstances invovling skipped tests and the Cypress 'fail' event listener a failure screenshot will be taken when it shouldn't be.
Desired behavior
fail
event handler shouldn't be triggered during skipped tests.Test code to reproduce
spec.js
Cypress Version
8.2.0
Other
No response
The text was updated successfully, but these errors were encountered: