I'm using Cypress for e2e tests on my Firebase web app, and I want test runs to always start fresh from an non-authenticated state.
How do I prevent Firebase Auth sessions from persisting across e2e test runs?
Currently, I have a logout()
function call at the end of the tests. But if a test fails before that point, logout()
often doesn't get called, and I have to manually log out before the next test run.
cy.clearCookie("nameOfCookie")
in yourbeforeEach()
– Candelariacandelariologout()
is working for you, call it inafterEach()
, see this document. – IrwinafterEach()
and then it lists the reasons why. Hence, I'm trying to find the correct way to implement. – Tocharian