Skip to content

Commit

Permalink
docs: document Python's expect_event methods (#4963)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Jan 11, 2021
1 parent e67d897 commit 4dbbb47
Show file tree
Hide file tree
Showing 6 changed files with 347 additions and 27 deletions.
10 changes: 1 addition & 9 deletions docs/src/api/class-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -856,15 +856,7 @@ await frame.click('button'); // Click triggers navigation.
await frame.waitForLoadState(); // Waits for 'load' state by default.
```

### param: Frame.waitForLoadState.state
- `state` <"load"|"domcontentloaded"|"networkidle">

Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
method returns immediately. Can be one of:
* `'load'` - wait for the `load` event to be fired.
* `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
* `'networkidle'` - wait until there are no network connections for at least `500` ms.

### param: Frame.waitForLoadState.state = %%-wait-for-load-state-state-%%
### option: Frame.waitForLoadState.timeout = %%-navigation-timeout-%%

## async method: Frame.waitForNavigation
Expand Down
20 changes: 3 additions & 17 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -1608,10 +1608,7 @@ Returns the event data value.
Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy
value. Will throw an error if the page is closed before the event is fired.

### param: Page.waitForEvent.event
- `event` <[string]>

Event name, same one would pass into `page.on(event)`.
### param: Page.waitForEvent.event = %%-wait-for-event-event-%%

### param: Page.waitForEvent.optionsOrPredicate
* langs: js
Expand Down Expand Up @@ -1693,15 +1690,7 @@ console.log(await popup.title()); // Popup is ready to use.

Shortcut for main frame's [`method: Frame.waitForLoadState`].

### param: Page.waitForLoadState.state
- `state` <"load"|"domcontentloaded"|"networkidle">

Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
method resolves immediately. Can be one of:
* `'load'` - wait for the `load` event to be fired.
* `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
* `'networkidle'` - wait until there are no network connections for at least `500` ms.

### param: Page.waitForLoadState.state = %%-wait-for-load-state-state-%%
### option: Page.waitForLoadState.timeout = %%-navigation-timeout-%%

## async method: Page.waitForNavigation
Expand Down Expand Up @@ -1729,10 +1718,7 @@ Shortcut for main frame's [`method: Frame.waitForNavigation`].

### option: Page.waitForNavigation.timeout = %%-navigation-timeout-%%

### option: Page.waitForNavigation.url
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>

A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.
### option: Page.waitForNavigation.url = %%-wait-for-navigation-url-%%

### option: Page.waitForNavigation.waitUntil = %%-navigation-wait-until-%%

Expand Down
19 changes: 19 additions & 0 deletions docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,25 @@ Options to select. If the `<select>` has the `multiple` attribute, all matching
first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
is considered matching if all specified properties match.

## wait-for-navigation-url
- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]>

A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation.

## wait-for-event-event
- `event` <[string]>

Event name, same one typically passed into `page.on(event)`.

## wait-for-load-state-state
- `state` <"load"|"domcontentloaded"|"networkidle">

Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
method resolves immediately. Can be one of:
* `'load'` - wait for the `load` event to be fired.
* `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
* `'networkidle'` - wait until there are no network connections for at least `500` ms.

## python-select-options-element
* langs: python
- `element` <[ElementHandle]|[Array]<[ElementHandle]>>
Expand Down
Loading

0 comments on commit 4dbbb47

Please sign in to comment.