Socket
Socket
Sign inDemoInstall

cypress-localstorage-commands

Package Overview
Dependencies
174
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cypress-localstorage-commands

Extends Cypress' cy commands with localStorage methods. Allows preserving localStorage between tests


Version published
Weekly downloads
254K
decreased by-12.52%
Maintainers
1
Install size
8.28 kB
Created
Weekly downloads
 

Changelog

Source

[1.0.0] - 2019-10-26

Added

  • Add saveLocalStorage command
  • Add restoreLocalStorage command
  • Add clearLocalStorageSnapshot command

Readme

Source

Build status Coverage Status Quality Gate

NPM dependencies Last commit Last release

NPM downloads License

Cypress localStorage commands

Extends Cypress' cy commands with localStorage methods. Allows preserving localStorage between tests.

The problem

You want to preserve localStorage between Cypress tests.

This solution

This solution allows you to use all browser localStorage methods through Cypress commands, and preserve it between tests.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm i --save-dev cypress-localstorage-commands

Usage

cypress-localstorage-commands extends Cypress' cy command.

Add this line to your project's cypress/support/commands.js:

import 'cypress-localstorage-commands'

You can now use all next commands:

cy.saveLocalStorage() // Save current localStorage values into an internal "snapshot"
cy.restoreLocalStorage() // Restore localStorage to previously "snapshot" saved values
cy.clearLocalStorageSnapshot() // Clear localStorage "snapshot" values

Contributing

Contributors are welcome. Please read the contributing guidelines and code of conduct.

License

MIT, see LICENSE for details.

Keywords

FAQs

Last updated on 26 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc