Taiko
Documentation

Home / API Reference

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.waitForNavigation boolean
  • Wait for navigation after the click. Default navigation timeout is 15 seconds, to override pass { navigationTimeout: 10000 } in options parameter.
Default value
true

options.force boolean

Set to true to perform action on hidden/disabled elements.

Default value
false

options.waitForEvents Array<string>

Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']

Default value
[]

args Array

Proximity selectors


Returns

Promise<void>