waitUntil
This wait command is your universal weapon if you want to wait on something. It expects a condition and waits until that condition is fulfilled with a truthy value.
info
As opposed to other element commands WebdriverIO will not wait for the element to exist to execute this command.
A common example is to wait until a certain element contains a certain text (see example).
Usage
$(selector).waitUntil(condition, { timeout, timeoutMsg, interval })
Parameters
| Name | Type | Details | 
|---|---|---|
| condition | param | condition to wait on | 
| optionsoptional | WaitUntilOptions | command options | 
| options.timeoutoptional | Number | timeout in ms (default: 5000) | 
| options.timeoutMsgoptional | String | error message to throw when waitUntil times out | 
| options.intervaloptional | Number | interval between condition checks (default: 500) | 
Examples
index.html
loading...
waitUntilExample.js
loading...