waitForClickable
Warte auf ein Element für die angegebene Anzahl von Millisekunden, bis es anklickbar oder nicht anklickbar ist.
Info
Im Gegensatz zu anderen Element-Befehlen wartet WebdriverIO nicht darauf, dass das Element existiert, um diesen Befehl auszuführen.
Usage
$(selector).waitForClickable({ timeout, reverse, timeoutMsg, interval })
Parameters
Name | Type | Details |
---|---|---|
options optional | WaitForOptions | waitForEnabled options (optional) |
options.timeout optional | Number | Zeit in ms (Standardwert basierend auf waitforTimeout Konfigurationswert) |
options.reverse optional | Boolean | wenn true, wartet es auf das Gegenteil (Standard: false) |
options.timeoutMsg optional | String | wenn vorhanden, überschreibt es die Standard-Fehlermeldung |
options.interval optional | Number | Intervall zwischen Prüfungen (Standard: waitforInterval ) |
Example
waitForClickable.js
it('should detect when element is clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ timeout: 3000 });
});
it('should detect when element is no longer clickable', async () => {
const elem = await $('#elem')
await elem.waitForClickable({ reverse: true });
});
Returns
- <Boolean>
return
:true
wenn Element anklickbar ist (oder nicht, wenn Flag gesetzt ist)