Skip to content
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

Cypress v14 fails to save session between files when using the cacheAccrossSpecs option #31130

Open
SaratogaHazel opened this issue Feb 18, 2025 · 5 comments
Labels
stage: needs information Not enough info to reproduce the issue type: bug v14.0.0 🐛 Issue present since 14.0.0

Comments

@SaratogaHazel
Copy link

Current behavior

I use the cy.session to run all of my tests which span multiple files. So I use the cacheAcrossSpecs: true option. When I upgraded to v14, the session worked for the first file, but didn't for all of the following files. When I moved back to 13.17.0 version, it all worked fine. I will have to wait for a fix before I can move to v14. So please look at fixing this.

Desired behavior

Allow the cacheAcrossSpecs: true to work in V14 so I can use the same login session for my tests that span more than on file.

Test code to reproduce

My code is confidential and requires login to use the cy.sessions command. I'm sure you have test code that tests this.

Cypress Version

14.0.2

Node version

v20.17.0

Operating System

Windows 11

Debug Logs

Other

No response

@jennifer-shehane
Copy link
Member

@SaratogaHazel We do have some tests around this option, so likely there's something specific with your tests that we've missed. Can you try a couple of things?

  • On Cypress 14, can you set injectDocumentDomain: true and let us know if this resolves the issue?
  • Can you provide an example of what your code kind of looks like? What your calling in cy.session (without the keys) and then how you're calling that and when the cy.visit or any cy.origin calls happen?

@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue v14.0.0 🐛 Issue present since 14.0.0 labels Feb 18, 2025
@SaratogaHazel
Copy link
Author

SaratogaHazel commented Feb 18, 2025 via email

@jennifer-shehane
Copy link
Member

@SaratogaHazel This injectDocumentDomain config will be removed in Cypress 15 - as this behavior is not supported in Chrome browsers. We'd like to fix the underlying issue.

Can you provide an example of what your code kind of looks like? What your calling in cy.session (without the keys) and then how you're calling that and when the cy.visit or any cy.origin calls happen?

@SaratogaHazel
Copy link
Author

SaratogaHazel commented Feb 19, 2025 via email

@jennifer-shehane
Copy link
Member

@SaratogaHazel Are you calling cy.origin anywhere else in your tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue type: bug v14.0.0 🐛 Issue present since 14.0.0
Projects
None yet
Development

No branches or pull requests

2 participants