Skip to content

Commit 23ecafc

Browse files
committed
Add new commands examples
1 parent 3bb4798 commit 23ecafc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1818
- Add removeLocalStorage command
1919
- Add acceptance tests
2020

21+
### Changed
22+
- Improve documentation
23+
2124
## [1.0.0] - 2019-10-26
2225
### Added
2326
- Add saveLocalStorage command

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ npm i --save-dev cypress-localstorage-commands
3131
Add this line to your project's `cypress/support/commands.js`:
3232

3333
```js
34-
import 'cypress-localstorage-commands'
34+
import "cypress-localstorage-commands"
3535
```
3636

3737
You can now use all next commands:
@@ -48,6 +48,18 @@ cy.restoreLocalStorage() // Restore localStorage to previously "snapshot" saved
4848
cy.clearLocalStorageSnapshot() // Clear localStorage "snapshot" values
4949
```
5050

51+
```js
52+
cy.getLocalStorage("item") // Get localStorage item
53+
```
54+
55+
```js
56+
cy.setLocalStorage("item", "value") // Set localStorage item
57+
```
58+
59+
```js
60+
cy.removeLocalStorage("item") // Remove localStorage item
61+
```
62+
5163
## Contributing
5264

5365
Contributors are welcome.

0 commit comments

Comments
 (0)