cypress
cypress copied to clipboard
feat(sessions): add option to cache sessions across specs
- Closes #17710
User facing changelog
- A new command option, called
cacheAcrossSpecs
, was added to thecy.session()
to allow users to re-use session data across specs. Addressed #17710.
PR Tasks
- [x] Have tests been added/updated?
- [x] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
- [x] Has a PR for user-facing changes been opened in
cypress-documentation
?- https://github.com/cypress-io/cypress-documentation/pull/4746
- [x] Have API changes been updated in the
type definitions
?
Thanks for taking the time to open a PR!
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
- Become familiar with the Code Review Checklist for guidelines on coding standards and what needs to be done before a PR can be merged.
Test summary
Run details
Project | cypress |
Status | Passed |
Commit | 1d472268a8 |
Started | Sep 23, 2022 9:03 PM |
Ended | Sep 23, 2022 9:18 PM |
Duration | 15:22 💡 |
OS | Linux Debian - 11.3 |
Browser | Multiple |
View run in Cypress Dashboard ➡️
Flakiness
![]() |
cypress/e2e/next.cy.ts ![]() |
1 ![]() |
|
---|---|---|---|
1 | Working with next-12.1.6 > should show compilation errors on src changes |
![]() |
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard
@emilyrohrbough If I may ask, does this work with test parallelization? this.Cypress.backend('save:session', { ...data, setup: data.setup.toString(), validate: data.validate?.toString() }).catch(console.error)
seems to be what is saving the sessions state between states, but I can't find a clear doc on how that interacts with parallelization?
@henry-filosa This only persists sessions across specs on the same machine.
@emilyrohrbough Does the option - cacheAcrossSpecs works in npm run mode? It is only working in open mode for me. I am using cypress version - 13.7.1.
@chrisbreiding , @AtofStryker