Function clickToNavigate

  • Clicks on an element, and wait for navigation to complete.

    Parameters

    • ctx: Context
    • selector: string

      Selector to click for navigation.

    Returns Promise<void>

    Remarks

    Keep in mind, that this is fragile, because navigation ends before a website is fully ready; and that waiting for a selector is a much more robust way to detect when navigation is complete and the website is ready.

    Example

    await clickToNavigate(page, '.submit.button');
    

Generated using TypeDoc