-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
id: set_state | ||
sidebar_label: setState | ||
title: qawolf.setState | ||
--- | ||
|
||
import ArgumentSaveState from '../components/qawolf/ArgumentSaveState'; | ||
import ReturnVoid from '../components/qawolf/ReturnVoid'; | ||
import Syntax from '../components/Syntax'; | ||
|
||
<Syntax code="setState(page, savePath)" /> | ||
|
||
Set the state of a page (cookies, [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)) to the values saved as [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) in the specified file. | ||
|
||
See the [handle log in guide](TODOFIXLINK) to learn more about using `setState`. | ||
|
||
### Arguments | ||
|
||
<ArgumentSaveState isSaved /> | ||
|
||
### Returns | ||
|
||
<ReturnVoid /> | ||
|
||
### Examples | ||
|
||
Set the state of a page to the values saved in the `admin.json` file: | ||
|
||
```js | ||
const qawolf = require('qawolf'); | ||
// ... | ||
await qawolf.setState(page, '../state/admin.json'); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters