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
With test isolation enabled, the browser session is not cleared between it-tests.
Desired behavior
With test isolation enabled, clear the browser session between it-tests.
Test code to reproduce
This issue persists across devices (both used Ubuntu). So, I suspect this may be an OS or cypress version specific issue. If you want to try to reproduce on Windows, try WSL. That is what I used on my Windows machine to run Ubuntu. I also have a native Ubuntu OS machine, where this issue also persist. Sadly, I could not test it on Windows itself, because I had an unrelated issue there installing and setting up cypress.
I have a Nuxt2 website with a simple email/password login (auth via Firebase). I use the following config: cypress.config.js
describe('My test suite',()=>{beforeEach(()=>{cy.visit('/logout/')// <-- my workaround// cy.clearAllCookies() // <-- this does not work// cy.clearAllLocalStorage() // <-- this does not work// cy.clearAllSessionStorage() // <-- this does not workcy.contains('Welcome').should('be.visible')// <- wait for /logout visit to complete})it('tests email/pass login',()=>{cy.visit('/login')cy.get('input[name=email]').type('example@domain.com')cy.get('input[name=password]').type('password')cy.get('button[type=submit]').click()cy.url().should('include','/dashboard')// logged in})it('tests password forgot',()=>{cy.visit('/login')// <-- ERROR redirects to /dashboard, still logged in!!! (when not using my workaround)cy.get('a[href="/forgot"]').click()cy.url().should('include','/forgot')})})
I've added comments to clarify some stuff. As you can see, the only workaround I found to work, is to manually logout... This is far from desirable, as I'd like my tests to run in isolation naturally.
Cypress Version
12.17.1
Node version
v18.16.1 (I also tried 16)
Operating System
Ubuntu 22.04.2 LTS (64 bit)
Debug Logs
No response
Other
I have also reported this in the Discord server with little help. But if you'd like to chat, I'm available there.
I copied the title of a different issue with 1 key difference, so hopefully it's easier for people to tell them apart.
The text was updated successfully, but these errors were encountered:
OK, I figured out the underlying issue. Because my website uses Firebase auth, the session is stored in indexedDB, which for some odd reason is not cleared between tests...
There is a longstanding issue about this problem: #1208
Hopefully, this will be solved in the near future!
Current behavior
With test isolation enabled, the browser session is not cleared between
it
-tests.Desired behavior
With test isolation enabled, clear the browser session between
it
-tests.Test code to reproduce
This issue persists across devices (both used Ubuntu). So, I suspect this may be an OS or cypress version specific issue. If you want to try to reproduce on Windows, try WSL. That is what I used on my Windows machine to run Ubuntu. I also have a native Ubuntu OS machine, where this issue also persist. Sadly, I could not test it on Windows itself, because I had an unrelated issue there installing and setting up cypress.
I have a Nuxt2 website with a simple email/password login (auth via Firebase). I use the following config:
cypress.config.js
I have 2 simple test in a single file
spec.cy.js
:I've added comments to clarify some stuff. As you can see, the only workaround I found to work, is to manually logout... This is far from desirable, as I'd like my tests to run in isolation naturally.
Cypress Version
12.17.1
Node version
v18.16.1 (I also tried 16)
Operating System
Ubuntu 22.04.2 LTS (64 bit)
Debug Logs
No response
Other
I have also reported this in the Discord server with little help. But if you'd like to chat, I'm available there.
I copied the title of a different issue with 1 key difference, so hopefully it's easier for people to tell them apart.
The text was updated successfully, but these errors were encountered: