Skip to content

Commit

Permalink
docs(api.md): improve page.waitFor docs for the options object (#5021)
Browse files Browse the repository at this point in the history
  • Loading branch information
theeko authored and mathiasbynens committed Oct 24, 2019
1 parent 8132b39 commit 7f3e372
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/api.md
Expand Up @@ -1965,6 +1965,12 @@ This is a shortcut for [page.mainFrame().url()](#frameurl)
#### page.waitFor(selectorOrFunctionOrTimeout[, options[, ...args]])
- `selectorOrFunctionOrTimeout` <[string]|[number]|[function]> A [selector], predicate or timeout to wait for
- `options` <[Object]> Optional waiting parameters
- `visible` <[boolean]> wait for element to be present in DOM and to be visible. Defaults to `false`.
- `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) method.
- `hidden` <[boolean]> wait for element to not be found in the DOM or to be hidden. Defaults to `false`.
- `polling` <[string]|[number]> An interval at which the `pageFunction` is executed, defaults to `raf`. If `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed. If `polling` is a string, then it can be one of the following values:
- `raf` - to constantly execute `pageFunction` in `requestAnimationFrame` callback. This is the tightest polling mode which is suitable to observe styling changes.
- `mutation` - to execute `pageFunction` on every DOM mutation.
- `...args` <...[Serializable]|[JSHandle]> Arguments to pass to `pageFunction`
- returns: <[Promise]<[JSHandle]>> Promise which resolves to a JSHandle of the success value

Expand Down
2 changes: 1 addition & 1 deletion lib/Page.js
Expand Up @@ -1108,7 +1108,7 @@ class Page extends EventEmitter {

/**
* @param {(string|number|Function)} selectorOrFunctionOrTimeout
* @param {!Object=} options
* @param {!{visible?: boolean, hidden?: boolean, timeout?: number, polling?: string|number}=} options
* @param {!Array<*>} args
* @return {!Promise<!Puppeteer.JSHandle>}
*/
Expand Down

0 comments on commit 7f3e372

Please sign in to comment.