click

Click on an element based on given selector.

Usage

1
client.click(selector).then(callback);

Parameters

Param Type Details
selector String element to click on. If it matches with more than one DOM-element it automatically clicks on the first element

Example

example.html
1
2
<button id="myButton" onclick="document.getElementById('someText').innerHTML='I was clicked'">Click me</button>
<div id="someText">I was not clicked</div>
click.js
1
2
3
4
5
client
.click('#myButton')
.getText('#someText').then(function(value) {
assert(value === 'I was clicked'); // true
});

Uses