https://cypress.io logo
Need some help with the documentation
# i-need-help
c
I am getting confused after reading this section in the documentation. Under Reference -> Best Practices, there is this section called "Dangling State is your friend" https://docs.cypress.io/guides/references/best-practices#Dangling-state-is-your-friend Here, it says that we should make use of the state in which a given test finishes. But doesn't this kind of conflicts with cypress's philosophy of test isolation and beginning each test on a clean slate? It's also mentioned there that
In fact, Cypress does not clean up its own internal state when the test ends.
But isn't this contradictory to the fact that cypress cleans up everything like cookies, local storage, spies etc after each test? Moreover, in the example in the section referred above, won't logout anyway happen (as cookies are cleared after each test) and so there won't be no need to write
cy.logout()
? Could someone plz throw some clarity on this? I'm getting confused after reading it, apologies if i am missing anything 😅
g
Nope, the test runner cleans up before each test, not after the last test. So the test finishes and you still have your application there, just like the last test left it