tap
Fetches an element with the given selector, scrolls it into view if needed, and then taps on the element. If there's no element matching selector, the method throws an error.
Examples
await tap('Gmail')
await tap(link('Gmail'))
tap(link('Gmail'), { waitForNavigation: true, waitForEvents: ['firstMeaningfulPaint'], force: true });
tap(link('Gmail'), {}, below('title'))
Parameters
-
selector
-
options
-
options.waitForNavigationboolean -
- Wait for navigation after the click. Default navigation timeout is 15 seconds, to override pass
{ navigationTimeout: 10000 }inoptionsparameter.
- Default value
-
true
- Wait for navigation after the click. Default navigation timeout is 15 seconds, to override pass
-
options.forceboolean -
Set to true to perform action on hidden/disabled elements.
- Default value
-
false
-
options.waitForEventsArray<string> -
Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']
- Default value
-
[]
-
argsArray -
Proximity selectors
Returns
Promise<void>