sdk.watcher.waitforany
Home > @matterway/sdk > Watcher > waitForAny
Watcher.waitForAny() function
Waits for any of the given selectors.
Signature:
export declare function waitForAny(ctx: Context, selectors: string[], options?: WaitForSelectorOptions): Promise<[MaybeElementHandle | null, string]>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selectors | string[] | List of selectors to wait for. |
options | WaitForSelectorOptions | (Optional) |
Returns:
Promise<[MaybeElementHandle | null, string]>
Example
async function step(ctx: Context) {
await waitForAny(ctx, [selector1, selector2]);
}