You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recipe for setting a global timeout that applies to every test using Cypress.on('test:before:run' ... does not work as expected when you hit the maximum time while a beforeEach is running.
Code to Reproduce:
describe('Wait 3 Seconds in beforeEach then Wait 7 Seconds In Test',function(){beforeEach(function(){cy.wait(3000)})it('Test 1',function(){cy.wait(7000)})})describe('Wait 7 Seconds in beforeEach then Wait 3 Seconds In Test',function(){beforeEach(function(){cy.wait(7000)})it('Test 2',function(){cy.wait(3000)})})
I've used the recipe to set a timeout of 5 seconds. Both tests should fail with the error that it ran longer than 5 seconds, but the second test does not time out and eventually passes.
The text was updated successfully, but these errors were encountered:
I've been revisiting this after a long period of time. 😂
After learning in this comment about cy.state('test'), I wondered if I replaced uses of cy.state('runnable') in the recipe with cy.state('test') that would resolve the issue I reported here. It seemed to fix things, but given that cy.state is undocumented I really don't know if making such a change is worrisome. I'd appreciate some insight on this @bahmutov; if doing so isn't a worry then maybe resolving this issue is as simple as updating the recipe accordingly?
Issue:
The recipe for setting a global timeout that applies to every test using
Cypress.on('test:before:run' ...
does not work as expected when you hit the maximum time while abeforeEach
is running.Code to Reproduce:
I've used the recipe to set a timeout of 5 seconds. Both tests should fail with the error that it ran longer than 5 seconds, but the second test does not time out and eventually passes.
The text was updated successfully, but these errors were encountered: