waitForDisplayed
Warte auf ein Element für die angegebene Zeit in Millisekunden, bis es angezeigt wird oder nicht angezeigt wird.
Info
Im Gegensatz zu anderen Element-Befehlen wartet WebdriverIO nicht darauf, dass das Element existiert, um diesen Befehl auszuführen.
Usage
$(selector).waitForDisplayed({ timeout, reverse, timeoutMsg, interval, withinViewport })
Parameters
Name | Type | Details |
---|---|---|
options optional | WaitForOptions | waitForDisplayed options (optional) |
options.timeout optional | Number | time in ms (default set based on waitforTimeout config value) |
options.reverse optional | Boolean | if true it waits for the opposite (default: false) |
options.timeoutMsg optional | String | if exists it overrides the default error message |
options.interval optional | Number | interval between checks (default: waitforInterval ) |
options.withinViewport optional | Boolean | set to true to wait until element is displayed within viewport (default: false ) |
Examples
index.html
loading...
waitForDisplayedExample.js
loading...
Returns
- <Boolean>
return
: true if element is displayed (or doesn't if flag is set)