-
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
12 changed files
with
150 additions
and
10 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
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,63 @@ | ||
import React from 'react'; | ||
import Argument from '../Argument'; | ||
|
||
function ArgumentWaitForPage() { | ||
return ( | ||
<React.Fragment> | ||
<Argument | ||
description={ | ||
<React.Fragment> | ||
The{' '} | ||
<a href="https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext"> | ||
Playwright <code>BrowserContext</code> | ||
</a>{' '} | ||
instance where the page will load. | ||
</React.Fragment> | ||
} | ||
name="context" | ||
type="BrowserContext" | ||
/> | ||
<Argument | ||
description={ | ||
<React.Fragment> | ||
The index of the page, starting from <code>0</code>. | ||
</React.Fragment> | ||
} | ||
name="index" | ||
type="number" | ||
/> | ||
<Argument | ||
description="Wait for page options." | ||
name="options" | ||
optional | ||
type="Object" | ||
/> | ||
<Argument | ||
description={ | ||
<React.Fragment> | ||
Maximum time in milliseconds to wait for the page. <b>Default:</b>{' '} | ||
<code>30000</code>. | ||
</React.Fragment> | ||
} | ||
name="timeout" | ||
indent | ||
optional | ||
type="number" | ||
/> | ||
<Argument | ||
description={ | ||
<React.Fragment> | ||
When to consider navigation on the page over. <b>Default:</b>{' '} | ||
<code>"load"</code>. | ||
</React.Fragment> | ||
} | ||
indent | ||
name="waitUntil" | ||
optional | ||
type='"commit" | "load" | "domcontentloaded" | "networkidle0" | "networkidle2"' | ||
/> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
export default ArgumentWaitForPage; |
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,22 @@ | ||
import React from 'react'; | ||
import Argument from '../Argument'; | ||
|
||
function ReturnPage() { | ||
return ( | ||
<Argument | ||
description={ | ||
<React.Fragment> | ||
Resolves with a{' '} | ||
<a href="https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page"> | ||
Playwright <code>Page</code> | ||
</a>{' '} | ||
instance. | ||
</React.Fragment> | ||
} | ||
name="" | ||
type="Promise<Page>" | ||
/> | ||
); | ||
} | ||
|
||
export default ReturnPage; |
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
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,49 @@ | ||
--- | ||
id: wait_for_page | ||
sidebar_label: waitForPage | ||
title: qawolf.waitForPage | ||
--- | ||
|
||
import ArgumentWaitForPage from '../components/qawolf/ArgumentWaitForPage'; | ||
import ReturnPage from '../components/qawolf/ReturnPage'; | ||
import Syntax from '../components/Syntax'; | ||
|
||
<Syntax code="waitForPage(context, index[, options])" /> | ||
|
||
Wait for [Playwright `Page`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page) instance with specified index to load. | ||
|
||
### Arguments | ||
|
||
<ArgumentWaitForPage /> | ||
|
||
### Returns | ||
|
||
<ReturnPage /> | ||
|
||
### Examples | ||
|
||
Wait for the page with index `1`: | ||
|
||
```js | ||
const qawolf = require('qawolf'); | ||
// ... | ||
const page = await qawolf.waitForPage(context, 1); | ||
``` | ||
|
||
Wait for the page with index `0`, timing out in 10 seconds if the page does not load: | ||
|
||
```js | ||
const qawolf = require('qawolf'); | ||
// ... | ||
const page = await qawolf.waitForPage(context, 0, { timeout: 10000 }); | ||
``` | ||
|
||
Wait for the page with index `0`, considering navigation to be complete after the `DOMContentLoaded` event fires: | ||
|
||
```js | ||
const qawolf = require('qawolf'); | ||
// ... | ||
const page = await qawolf.waitForPage(context, 0, { | ||
waitUntil: 'domcontentloaded', | ||
}); | ||
``` |
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