Cypress - Authentication and Sessions
You wrote this code to preserve cookies but the second test fails because the cookie is missing:
What is the likely cause of the failure?
beforeEach(() => {
Cypress.Cookies.preserveOnce('auth_token')
})
it('Login test', () => {
cy.setCookie('auth_token', 'xyz789')
})
it('Dashboard test', () => {
cy.getCookie('auth_token').should('exist')
})What is the likely cause of the failure?
