diff --git a/content/_data/sidebar.json b/content/_data/sidebar.json
index 1293df44a4..1f7025b510 100644
--- a/content/_data/sidebar.json
+++ b/content/_data/sidebar.json
@@ -174,7 +174,7 @@
{
"title": "Svelte API",
"slug": "svelte/api"
- }
+ }
]
},
{
@@ -693,6 +693,14 @@
"title": "blur",
"slug": "blur"
},
+ {
+ "title": "clearAllLocalStorage",
+ "slug": "clearalllocalstorage"
+ },
+ {
+ "title": "clearAllSessionStorage",
+ "slug": "clearallsessionstorage"
+ },
{
"title": "clearCookie",
"slug": "clearcookie"
@@ -729,6 +737,14 @@
"title": "focus",
"slug": "focus"
},
+ {
+ "title": "getAllLocalStorage",
+ "slug": "getalllocalstorage"
+ },
+ {
+ "title": "getAllSessionStorage",
+ "slug": "getallsessionstorage"
+ },
{
"title": "getCookie",
"slug": "getcookie"
diff --git a/content/api/commands/clearalllocalstorage.md b/content/api/commands/clearalllocalstorage.md
new file mode 100644
index 0000000000..3f6d4c5155
--- /dev/null
+++ b/content/api/commands/clearalllocalstorage.md
@@ -0,0 +1,69 @@
+---
+title: clearAllLocalStorage
+---
+
+Clear
+[`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
+data for all origins with which the test has interacted.
+
+
+
+Cypress automatically runs this command _before_ each test to prevent state from
+being shared across tests when
+[test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation)
+is `on`. You shouldn't need to use this command unless you're using it to clear
+localStorage inside a single test or test isolation is `off`.
+
+
+
+## Syntax
+
+```javascript
+cy.clearAllLocalStorage()
+cy.clearAllLocalStorage(options)
+```
+
+### Usage
+
+** Correct Usage**
+
+```javascript
+cy.clearAllLocalStorage()
+```
+
+### Arguments
+
+** options** **_(Object)_**
+
+Pass in an options object to change the default behavior of
+`cy.clearAllLocalStorage()`.
+
+| Option | Default | Description |
+| ------ | ------- | ---------------------------------------------------------------------------------------- |
+| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/cypress-app#Command-Log) |
+
+### Yields [](/guides/core-concepts/introduction-to-cypress#Subject-Management)
+
+- `cy.clearAllLocalStorage()` yields `null`.
+
+## Rules
+
+### Requirements [](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
+
+- `cy.clearAllLocalStorage()` requires being chained off of `cy`.
+
+### Assertions [](/guides/core-concepts/introduction-to-cypress#Assertions)
+
+- `cy.clearAllLocalStorage()` cannot have any assertions chained.
+
+### Timeouts [](/guides/core-concepts/introduction-to-cypress#Timeouts)
+
+`cy.clearAllLocalStorage()` cannot time out.
+
+## See also
+
+- [`cy.clearAllSessionStorage()`](/api/commands/clearallsessionstorage)
+- [`cy.clearCookies()`](/api/commands/clearcookies)
+- [`cy.clearLocalStorage()`](/api/commands/clearlocalstorage)
+- [`cy.getAllLocalStorage()`](/api/commands/getalllocalstorage)
+- [`cy.getAllSessionStorage()`](/api/commands/getallsessionstorage)
diff --git a/content/api/commands/clearallsessionstorage.md b/content/api/commands/clearallsessionstorage.md
new file mode 100644
index 0000000000..e63f0bd86a
--- /dev/null
+++ b/content/api/commands/clearallsessionstorage.md
@@ -0,0 +1,69 @@
+---
+title: clearAllSessionStorage
+---
+
+Clear
+[`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)
+data for all origins with which the test has interacted.
+
+
+
+Cypress automatically runs this command _before_ each test to prevent state from
+being shared across tests when
+[test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation)
+is `on`. You shouldn't need to use this command unless you're using it to clear
+localStorage inside a single test or test isolation is `off`.
+
+
+
+## Syntax
+
+```javascript
+cy.clearAllSessionStorage()
+cy.clearAllSessionStorage(options)
+```
+
+### Usage
+
+** Correct Usage**
+
+```javascript
+cy.clearAllSessionStorage()
+```
+
+### Arguments
+
+** options** **_(Object)_**
+
+Pass in an options object to change the default behavior of
+`cy.clearAllSessionStorage()`.
+
+| Option | Default | Description |
+| ------ | ------- | ---------------------------------------------------------------------------------------- |
+| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/cypress-app#Command-Log) |
+
+### Yields [](/guides/core-concepts/introduction-to-cypress#Subject-Management)
+
+- `cy.clearAllSessionStorage()` yields `null`.
+
+## Rules
+
+### Requirements [](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
+
+- `cy.clearAllSessionStorage()` requires being chained off of `cy`.
+
+### Assertions [](/guides/core-concepts/introduction-to-cypress#Assertions)
+
+`cy.clearAllSessionStorage()` cannot have any assertions chained.
+
+### Timeouts [](/guides/core-concepts/introduction-to-cypress#Timeouts)
+
+`cy.clearAllSessionStorage()` cannot time out.
+
+## See also
+
+- [`cy.clearAllLocalStorage()`](/api/commands/clearalllocalstorage)
+- [`cy.clearCookies()`](/api/commands/clearcookies)
+- [`cy.clearLocalStorage()`](/api/commands/clearlocalstorage)
+- [`cy.getAllLocalStorage()`](/api/commands/getalllocalstorage)
+- [`cy.getAllSessionStorage()`](/api/commands/getallsessionstorage)
diff --git a/content/api/commands/getalllocalstorage.md b/content/api/commands/getalllocalstorage.md
new file mode 100644
index 0000000000..57d3a31e40
--- /dev/null
+++ b/content/api/commands/getalllocalstorage.md
@@ -0,0 +1,95 @@
+---
+title: getAllLocalStorage
+---
+
+Get
+[`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
+data for all origins with which the test has interacted.
+
+## Syntax
+
+```javascript
+cy.getAllLocalStorage()
+cy.getAllLocalStorage(options)
+```
+
+### Usage
+
+** Correct Usage**
+
+```javascript
+cy.getAllLocalStorage()
+```
+
+### Arguments
+
+** options** **_(Object)_**
+
+Pass in an options object to change the default behavior of
+`cy.getAllLocalStorage()`.
+
+| Option | Default | Description |
+| ------ | ------- | ---------------------------------------------------------------------------------------- |
+| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/cypress-app#Command-Log) |
+
+### Yields [](/guides/core-concepts/introduction-to-cypress#Subject-Management)
+
+`cy.getAllLocalStorage()` yields an object where the keys are origins and the
+values are key-value pairs of `localStorage` data.
+
+For example, if `key1` is set to `value1` on `https://example.com` and `key2` is
+set to `value2` on `https://other.com`, `cy.getAllLocalStorage()` will yield:
+
+```js
+{
+ 'https://example.com': {
+ key1: 'value1',
+ },
+ 'https://other.com': {
+ key2: 'value2',
+ },
+}
+```
+
+## Examples
+
+### Get all localStorage
+
+```javascript
+cy.visit('https://example.com', {
+ onBeforeLoad(win) {
+ win.localStorage.setItem('key', 'value')
+ },
+})
+
+cy.getAllLocalStorage().then((result) => {
+ expect(result).to.deep.equal({
+ 'https://example.com': {
+ key: 'value',
+ },
+ })
+})
+```
+
+## Rules
+
+### Requirements [](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
+
+- `cy.getAllLocalStorage()` requires being chained off of `cy`.
+
+### Assertions [](/guides/core-concepts/introduction-to-cypress#Assertions)
+
+`cy.getAllLocalStorage()` will only run assertions you have chained
+once, and will not [retry](/guides/core-concepts/retry-ability).
+
+### Timeouts [](/guides/core-concepts/introduction-to-cypress#Timeouts)
+
+- `cy.getAllLocalStorage()` cannot time out.
+
+## See also
+
+- [`cy.clearAllLocalStorage()`](/api/commands/clearalllocalstorage)
+- [`cy.clearAllSessionStorage()`](/api/commands/clearallsessionstorage)
+- [`cy.clearCookies()`](/api/commands/clearcookies)
+- [`cy.clearLocalStorage()`](/api/commands/clearlocalstorage)
+- [`cy.getAllSessionStorage()`](/api/commands/getallsessionstorage)
diff --git a/content/api/commands/getallsessionstorage.md b/content/api/commands/getallsessionstorage.md
new file mode 100644
index 0000000000..568d4825df
--- /dev/null
+++ b/content/api/commands/getallsessionstorage.md
@@ -0,0 +1,95 @@
+---
+title: getAllSessionStorage
+---
+
+Get
+[`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)
+data for all origins with which the test has interacted.
+
+## Syntax
+
+```javascript
+cy.getAllSessionStorage()
+cy.getAllSessionStorage(options)
+```
+
+### Usage
+
+** Correct Usage**
+
+```javascript
+cy.getAllSessionStorage()
+```
+
+### Arguments
+
+** options** **_(Object)_**
+
+Pass in an options object to change the default behavior of
+`cy.getAllSessionStorage()`.
+
+| Option | Default | Description |
+| ------ | ------- | ---------------------------------------------------------------------------------------- |
+| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/cypress-app#Command-Log) |
+
+### Yields [](/guides/core-concepts/introduction-to-cypress#Subject-Management)
+
+`cy.getAllSessionStorage()` yields an object where the keys are origins and the
+values are key-value pairs of `sessionStorage` data.
+
+For example, if `key1` is set to `value1` on `https://example.com` and `key2` is
+set to `value2` on `https://other.com`, `cy.getAllSessionStorage()` will yield:
+
+```js
+{
+ 'https://example.com': {
+ key1: 'value1',
+ },
+ 'https://other.com': {
+ key2: 'value2',
+ },
+}
+```
+
+## Examples
+
+### Get all sessionStorage
+
+```javascript
+cy.visit('https://example.com', {
+ onBeforeLoad(win) {
+ win.sessionStorage.setItem('key', 'value')
+ },
+})
+
+cy.getAllSessionStorage().then((result) => {
+ expect(result).to.deep.equal({
+ 'https://example.com': {
+ key: 'value',
+ },
+ })
+})
+```
+
+## Rules
+
+### Requirements [](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
+
+- `cy.getAllSessionStorage()` requires being chained off of `cy`.
+
+### Assertions [](/guides/core-concepts/introduction-to-cypress#Assertions)
+
+`cy.getAllSessionStorage()` will only run assertions you have chained
+once, and will not [retry](/guides/core-concepts/retry-ability).
+
+### Timeouts [](/guides/core-concepts/introduction-to-cypress#Timeouts)
+
+- `cy.getAllSessionStorage()` cannot time out.
+
+## See also
+
+- [`cy.clearAllLocalStorage()`](/api/commands/clearalllocalstorage)
+- [`cy.clearAllSessionStorage()`](/api/commands/clearallsessionstorage)
+- [`cy.clearCookies()`](/api/commands/clearcookies)
+- [`cy.clearsessionStorage()`](/api/commands/clearsessionStorage)
+- [`cy.getAllLocalStorage()`](/api/commands/getalllocalstorage)