When I ran cypress run --browser chrome --headed, I observed that new browser (incognito) window was opening for each test file. Although I was doing cy.saveLocalStorage, local storage was cleared when the browser window was closed.
So I re-organized my tests so that I can test multiple related scenarios as part of one test file, logging in the start & logging out in the last test. Within each test file I do login & logout process & that's working fine.
Hey!
No I couldn't find a way to accomplish that.
When I ran
cypress run --browser chrome --headed
, I observed that new browser (incognito) window was opening for each test file. Although I was doingcy.saveLocalStorage
, local storage was cleared when the browser window was closed.So I re-organized my tests so that I can test multiple related scenarios as part of one test file, logging in the start & logging out in the last test. Within each test file I do login & logout process & that's working fine.
Hi @gsaran and @geabby ,
The version v2.2.0 of the plugin already supports preserving localStorage across spec files. The only requirement is to install the plugin's Node events, you can checkout its installation docs for further info.
That's brilliant. I was looking for that for a long long time. Thanks so much