sdk.watcher.waitfortext
Home > @matterway/sdk > Watcher > waitForText
Watcher.waitForText() function
Waits for text to appear in element.
Signature:
export declare function waitForText(ctx: Context, label: string, element?: string, options?: WaitForSelectorOptions): Promise<import("puppeteer-core").ElementHandle<Node> | null>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
label | string | Text to wait for. |
element | string | (Optional) Element in which to wait for text. |
options | WaitForSelectorOptions | (Optional) Wait options. |
Returns:
Promise<import("puppeteer-core").ElementHandle<Node> | null>
Example 1
const xlabel = waitForText(ctx, '*', element);
Example 2
const xlabel = waitForText(ctx, '*', element, {hidden:true, timeout:200});