Skip to content

hover()

Fetches an element with the given selector, scrolls it into view if needed, and then hovers over the center of the element. If there’s no element matching selector, the method throws an error.

Examples

await hover('Get Started')
await hover(link('Get Started'))
await hover(link('Get Started'), { waitForEvents: ['firstMeaningfulPaint'],  force: true })

Parameters

Name Type Description
selector selector | string A selector to search for element to right click. If there are multiple elements satisfying the selector, the first will be hovered.
options Object Default: {}.
options.force boolean Set to true to perform action on hidden/disabled elements. Default: false.
options.waitForEvents Array Events available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].

Returns

This API does not return any values.