cypress-fail-on-console-error
cypress-fail-on-console-error copied to clipboard
Spies still does not get resetted between cypress commands
First failed test due to console errors makes all other test failed as well due to same console error
Plugin version 3.2.1
Hi @rkhomi I am willing to help but the provided information is not enough to debug into this.
If you execute the corresponding internal integration test you can verify this is no general issue. this feature is covered by tests.
- clone this repo
- execute
npm install
- execute
cypress open
- execute
e2e/shouldResetSpiesBetweenTests.cy.js
test case
my request:
- cypress version
- operating os
- provide cypress runner log with config.cypressLog = true (see readme)
- provide console.log from chrome dev tools
- provide formal test case description including hooks: before, beforeEach, After, AfterEach (I need to know which commands are executed in the tests and if the page is refreshed between tests)
alternatively you can also provide a repo where I can reproduce the issue locally. That would be most helpful!
1.cypress version: 10.6.0 2. Operating system: cypress/browsers:node14.17.6-chrome100-ff98 3. Spec structure describe(name, () => { it(test 1) it(test 2) it(test 3) it(test 4)
})
Hmm, it might be that this depends on some specific console error I will try to get some logs and see how it appears in console
it(test 1, () =》{
// element is not present, command is retried, in the middle of command retry console error is appeared in dev console, after commad retry timeout test is failed cy.get(element).should(be.visible) })
it(test 2, () => { cy.log() cy.request() // and now this test is failed because of console error from first test
})
Hi @rkhomi,
thanks for sharing additional information. It was very helpful. I could reproduce the issue and provided a fix with version 4.0.1
https://github.com/nils-hoyer/cypress-fail-on-console-error/releases/tag/4.0.1