Перейти до основного вмісту

waitForDisplayed

Очікує, поки елемент буде відображений або не відображений протягом вказаної кількості мілісекунд.

інфо

На відміну від інших команд для елементів, WebdriverIO не буде чекати існування елемента для виконання цієї команди.

Usage
$(selector).waitForDisplayed({ timeout, reverse, timeoutMsg, interval, withinViewport })
Parameters
NameTypeDetails
options
optional
WaitForOptionswaitForDisplayed options (optional)
options.timeout
optional
Numbertime in ms (default set based on waitforTimeout config value)
options.reverse
optional
Booleanif true it waits for the opposite (default: false)
options.timeoutMsg
optional
Stringif exists it overrides the default error message
options.interval
optional
Numberinterval between checks (default: waitforInterval)
options.withinViewport
optional
Booleanset 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)

Welcome! How can I help?

WebdriverIO AI Copilot