mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-24 09:29:35 -05:00
792 B
792 B
title, comments, description
| title | comments | description |
|---|---|---|
| clearlocalstorage | true |
Clears all data in local storage.
Cypress automatically invokes this command before each test to prevent state from building up. You shouldn't need to invoke this command unless you're using it to clear localStorage inside a single test.
| Returns | the remote local storage object |
| Timeout | cannot timeout |
cy.clearLocalStorage()
Clear all data in local storage.
cy.clearLocalStorage( string )
Clears all keys in local storage matching the string.
cy.clearLocalStorage( RegExp )
Clears all keys in local storage matching the RegExp.
Usage
Clear Local Storage
// returns local storage object
cy.clearLocalStorage()