-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LocalStorage missing across spec files #401
Comments
Hi @aasimali, Could you please provide more information about how is the localStorage saved when the page performs the login action? Or even better, could you provide a fully reproducible example of the case in which the plugin is not working? To ensure that it is the plugin which is not working, maybe you can try to test the plugin simply setting one item in the localStorage, and then check that it is still present after restoring it. Thanks in advance |
Hi @javierbrea Thanks for your response, the issue is from Instagram login. To reproduce it, please log into Instagram and once you're successfully logged in one test, then see you still have cookies from Instagram or not. In my test, I'm logging into Instagram first as I needed to logged in Instagram to perform the next test, but as cookies is flushing, I'm not able to perform the test. |
Could you please be more specific and provide some code with a reproducible failing example, please? A link to a repository containing a failing test would be great, for example. On the contrary, please give more clues about what can be failing. Are you sure that the login is stored in the local storage? It is stored in the same domain or in another? Traces? Screenshots of developer tools? |
I am also having this issue. Don't have time to setup a demo repo right now unfortunately. |
@javierbrea Just used your plugin and faced with this issue As you can see I have 2 keys in local storage However, after my tests go to next test the local storage was disappeared I hope this will help you to investigate the issue and provide me what I am doing wrong or fix the issue from you side. |
Hi @DiederikvandenB , are tests in the same specs file or in different files? |
@javierbrea I am also having issues with this plugin since upgrading to Cypress 10. In my case tests are in different files |
@javierbrea i am also facing issues post upgrading to cypress 10 . Local storages are not being retained across specs . Is there any fix in pipeline to resolve this issue ? |
Hi @peeyushohri04 @vdineva , Thanks for the notice, by the way! |
Hi @vdineva @peeyushohri04 |
Update: It doesn't work either with version 9.0.0 |
Our current version of Cypress is 9.7.0 and things work fine. We've had every other 9.x.x version installed and things were working fine. In our case localStorage is not retained between soec files once we upgrade to v10 of Cypress |
@vdineva Could it be related to the new configuration files on Cypress 10 instead of the plugin itself? I mean, maybe the commands were not being installed properly. But I suppose that this would produce an error when trying to use them, it wouldn't produce such a specific bug. In order to understand it better, was the localStorage retained between tests in the same spec file properly in Cypress 10 in your case? Anyway, I have already found a solution. But I'd like to understand why was this happening. I suspect that in this issue there are problems related to the localStorage not being maintained between specs (which I have checked that was happening in previous versions already), and problems related to not installing the plugin properly in Cypress 10. I will publish the new version soon, and I will also update the installation docs. Apart from this, I will add also E2E tests using Cypress 9, and I'll keep a branch with the Cypress 9 failing tests before applying the fix, just in case it may be useful for further investigation. Thanks for a quick answer, by the way! 😃 |
. I installed this plugin using
npm i --save-dev cypress-localstorage-commands
. And I added this line:
import "cypress-localstorage-commands"
into cypress/support/commands.js. In my testcase.ts file, I added
And when I execute, it does not store cookies
The text was updated successfully, but these errors were encountered: