Skip to content

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.

await tap('Gmail')
await tap(link('Gmail'))
tap(link('Gmail'), { waitForNavigation: true, waitForEvents: ['firstMeaningfulPaint'], force: true });
tap(link('Gmail'), {}, below('title'))
NameTypeDescription
selectorselector
optionsObjectDefault: {}.
options.waitForNavigationboolean- Wait for navigation after the click. Default navigation timeout is 15 seconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true.
options.forcebooleanSet to true to perform action on hidden/disabled elements. Default: false.
options.waitForEventsArrayEvents available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].
argsArrayProximity selectors
TypeDescription
Promise<void>