https://cypress.io logo
Ah so that's the issue ok. Yeah was hoping it's mo...
# e2e-testing
w
Ah so that's the issue ok. Yeah was hoping it's more readable. But then with the changes from the ticket above, would it not be the same as it is now?
f
Going to move this over to a thread
Well, there aren't any changes tied to that issue, it's just a proposal (and I agree with state being cleared between
it()
blocks)
> Also what you are saying goes against it retries right? Not really. Isolating each
it()
from the other ones means that the tests are better suited for retries.
There is an epic here (https://github.com/cypress-io/cypress/issues/22230) which is tracking work for adding an option to prevent this state clearing between
it()
blocks. Not sure when that is going to be done though If you really want to keep state between tests, I suggest not using
cy.session()
w
Yes that's what I'm gonna do
What you are saying about its sounds like the describe
So describe for the whole thing the sub things are the its
Also thank you very much for your time!
f
Yeah, the whole browser window is closed between specs, so all context is lost. However Cypress is also designed to clear the state between
it()
blocks. It doesn't do it for everything right now, but this is something that the team is looking to address (this ambiguous state management is also why 'run all specs' was removed in Cypress 10) The reason I warn against having interdependencies between
it()
blocks is because you could find that your tests will start failing in a subsequent version I hope that helps!