[feat] cy.clearSession command #17991
Labels
stage: proposal 💡
No work has been done of this issue
topic: session
Issues when using session command
type: feature
New feature that does not currently exist
What would you like?
I'd like cypress to add a command that allows explicitly clearing a specific cached session.
Something like
Alternatively, the
cy.session
command could accept an optional argument that forces the session to be re-created (as it would be if the validation function fails, but this is not working due to #17805 and besides it's not exactly the same use case)Why is this needed?
The
Cypress.session.clearAllSavedSessions()
command is not enough as I want to clear specific sessions.Example scenario:
In an application I'm working on, there is some server code that invalidates all user's sessions when a password reset is completed. Therefore when testing that workflow I can anticipate the session to be invalid in under certain circumstances, and would like to be able to recreate the session without waiting for the validate function to fail.
Other
No response
The text was updated successfully, but these errors were encountered: