waitForDisplayed
Wait for an element for the provided amount of milliseconds to be displayed or not displayed.
thông tin
As opposed to other element commands WebdriverIO will not wait for the element to exist to execute this command.
Usage
$(selector).waitForDisplayed({ timeout, reverse, timeoutMsg, interval, withinViewport })
Parameters
| Name | Type | Details |
|---|---|---|
optionsoptional | WaitForOptions | waitForDisplayed options (optional) |
options.timeoutoptional | Number | time in ms (default set based on waitforTimeout config value) |
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) |
options.withinViewportoptional | 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)