sdk.watcher.waitforselector
Home > @matterway/sdk > Watcher > waitForSelector
Watcher.waitForSelector() function
Waits for a selector to become visible.
Signature:
export declare function waitForSelector(ctx: Context, selector: string, options?: WaitForSelectorOptions): Promise<ElementHandle<Element> | null>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | the selector to wait for. |
options | WaitForSelectorOptions | (Optional) Wait for selector options. |
Returns:
Promise<ElementHandle<Element> | null>
Example
async function step(ctx: Context) {
const $el = await waitForSelector(ctx, selector);
}