clearAllLocalStorage

Clear localStorage data for all origins with which the test has interacted.

Syntax

cy.clearAllLocalStorage()
cy.clearAllLocalStorage(options)

Usage

Correct Usage

cy.clearAllLocalStorage()

Arguments

options (Object)

Pass in an options object to change the default behavior of cy.clearAllLocalStorage().

OptionDefaultDescription
logtrueDisplays the command in the Command log

Yields

  • cy.clearAllLocalStorage() yields null.

Rules

Requirements

  • cy.clearAllLocalStorage() requires being chained off of cy.

Assertions

  • cy.clearAllLocalStorage() cannot have any assertions chained.

Timeouts

  • cy.clearAllLocalStorage() cannot time out.

See also