Files
cypress/docs/source/api/commands/clearlocalstorage.md
T
2017-05-19 12:01:36 -04:00

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()