-
Notifications
You must be signed in to change notification settings - Fork 5
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
5 changed files
with
48 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
# puppeteer-extensions | ||
|
||
[![Build Status](https://travis-ci.org/HuddleEng/puppeteer-extensions.svg?branch=master)](https://travis-ci.org/HuddleEng/puppeteer-extensions) | ||
|
||
This library exposes a number of convenience functions to extend Puppeteer's API, in order to make writing tests easier. | ||
The idea is that many of these functions (or similar ones) will eventually make their way into Puppeteer's own API, but | ||
this allows us to experiment with new ways of improving UI testing. | ||
Provides extension functions for working with Puppeteer, in order to make writing tests easier. | ||
|
||
## Usage | ||
- `page` Puppeteer page instance | ||
- `timeout` [Optional] Timeout for waits in milliseconds (default: 5000 ms) | ||
|
||
- `page` Puppeteer page instance | ||
- `timeout` [Optional] Timeout for waits in milliseconds (default: 5000 ms) | ||
|
||
```javascript | ||
const extensions = require('puppeteer-extensions')(page); | ||
``` | ||
|
||
**Example:** | ||
|
||
```javascript | ||
(async() { | ||
const listItem = '.todo-list li'; | ||
... | ||
await extensions.waitForNthSelectorAttributeValue(listItem, 1, 'class', 'completed'); | ||
})(); | ||
|
||
``` | ||
``` |
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
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
Oops, something went wrong.