Function waitForSelector

  • Waits for a selector to become visible.

    Parameters

    • ctx: Context

      Context object.

    • selector: string

      the selector to wait for.

    • Optional options: WaitForSelectorOptions

      Wait for selector options.

    Returns Promise<null | ElementHandle<Element>>

    Example

    async function step(ctx: Context) {
    const $el = await waitForSelector(ctx, selector);
    }