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 to be returned.
A common example is to wait until a certain element contains a certain text (see example).
Usage
browser.waitUntil(condition, { timeout, timeoutMsg, interval })
Parameters
| Name | Type | Details |
|---|---|---|
condition | Function | condition to wait on until returning a truthy value |
optionsoptional | WaitUntilOptions | command options |
options.timeoutoptional | Number | time in ms (default set based on waitforTimeout config value) |
options.timeoutMsgoptional | String | error message to throw when waitUntil times out |
options.intervaloptional | Number | interval between condition checks (default set based on waitforInterval config value) |
Examples
index.html
loading...
waitUntilExample.js
loading...
Returns
- <Boolean>
return: true if condition is fulfilled