doubleClick
Double-click on an element.
Usage
$(selector).doubleClick()
Examples
- Asynchronous Mode
- Synchronous Mode
example.html
<button id="myButton" ondblclick="document.getElementById('someText').innerHTML='I was dblclicked'">Click me</button>
<div id="someText">I was not clicked</div>
doubleClick.js
it('should demonstrate the doubleClick command', async () => {
const myButton = await $('#myButton')
await myButton.doubleClick()
const value = await myButton.getText()
assert(value === 'I was dblclicked') // true
})
example.html
<button id="myButton" ondblclick="document.getElementById('someText').innerHTML='I was dblclicked'">Click me</button>
<div id="someText">I was not clicked</div>
doubleClick.js
it('should demonstrate the doubleClick command', () => {
const myButton = $('#myButton')
myButton.doubleClick()
const value = myButton.getText()
assert(value === 'I was dblclicked') // true
})
caution
Synchronous Mode will depcrecated with Node.js v16. With an update to the underlying Chromium version it became technically impossible to provide the same synchronous behavior. We recommend to start transition to asynchronous command execution. For more information, see our RFC.