clearAllSessionStorage
Clear
sessionStorage
data for all origins with which the test has interacted.
caution
Cypress automatically clears all session storage before each test to prevent state from being shared across tests when test isolation is enabled. You shouldn't need to use this command unless you're using it to clear sessionStorage inside a single test or test isolation is disabled.
Syntax​
cy.clearAllSessionStorage()
cy.clearAllSessionStorage(options)
Usage​
Correct Usage
cy.clearAllSessionStorage()
Arguments​
options (Object)
Pass in an options object to change the default behavior of
cy.clearAllSessionStorage()
.
Option | Default | Description |
---|---|---|
log | true | Displays the command in the Command log |
Yields ​
cy.clearAllSessionStorage()
yieldsnull
.
Rules​
Requirements ​
cy.clearAllSessionStorage()
requires being chained off ofcy
.
Assertions ​
cy.clearAllSessionStorage()
cannot have any assertions chained.
Timeouts ​
cy.clearAllSessionStorage()
cannot time out.