docs: improve waitForElementState documentation (#4883)

This commit is contained in:
Yury Semikhatsky 2021-01-05 10:56:02 -08:00 committed by GitHub
parent d8187bb5af
commit 0f8d7ec0a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -3846,7 +3846,7 @@ When all steps combined have not finished during the specified [`option: timeout
## async method: ElementHandle.waitForElementState
Returns the element satisfies the [`param: state`].
Returns when the element satisfies the [`param: state`].
Depending on the [`param: state`] parameter, this method waits for one of the [actionability](./actionability.md)
checks to pass. This method throws when the element is detached while waiting, unless waiting for the `"hidden"` state.
@ -3868,7 +3868,7 @@ A state to wait for, see below for more details.
## async method: ElementHandle.waitForSelector
- returns: <[null]|[ElementHandle]>
Returns element specified by selector satisfies [`option: state`] option. Returns `null` if waiting for `hidden` or
Returns element specified by selector when it satisfies [`option: state`] option. Returns `null` if waiting for `hidden` or
`detached`.
Wait for the [`param: selector`] relative to the element handle to satisfy [`option: state`] option (either

5
types/types.d.ts vendored
View File

@ -5407,7 +5407,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
$$eval<R, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(selector: string, pageFunction: PageFunctionOn<E[], void, R>, arg?: any): Promise<R>;
/**
* Returns element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or `detached`.
* Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
* Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or
* become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
@ -6196,7 +6197,7 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
}): Promise<void>;
/**
* Returns the element satisfies the `state`.
* Returns when the element satisfies the `state`.
*
* Depending on the `state` parameter, this method waits for one of the [actionability](https://github.com/microsoft/playwright/blob/master/docs/actionability.md) checks to pass.
* This method throws when the element is detached while waiting, unless waiting for the `"hidden"` state.