waitForClickable
Wait for an element for the provided amount of milliseconds to be clickable or not clickable.
Usage
$(selector).waitForClickable({ timeout, reverse, timeoutMsg, interval })
Parameters
| Name | Type | Details |
|---|---|---|
optionsoptional | WaitForOptions | waitForEnabled options (optional) |
options.timeoutoptional | Number | time in ms (default: 500) |
options.reverseoptional | Boolean | if true it waits for the opposite (default: false) |
options.timeoutMsgoptional | String | if exists it overrides the default error message |
options.intervaloptional | Number | interval between checks (default: waitforInterval) |
Example
it('should detect when element is clickable', () => {
const elem = $('#elem')
elem.waitForClickable({ timeout: 3000 });
});
it('should detect when element is no longer clickable', () => {
const elem = $('#elem')
elem.waitForClickable({ reverse: true });
});