Cypress · Method
cy.clearLocalStorage
Clears localStorage for the current origin. You can clear everything or only keys that match a string or regular expression.
Last updated
Syntax
cy.clearLocalStorage()
cy.clearLocalStorage(key)
cy.clearLocalStorage(options)
cy.clearLocalStorage(key, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.clearAllLocalStorage()cy.clearAllCookies()cy.clearAllSessionStorage()