.waitToBeFocused(options)
Polls until the element is focused every options.interval or exceeds options.maxDuration timeout.
Usage
element(matcher).waitToBeFocused(options)
Parameters
options(Object?):options.interval(Number?): Duration in milliseconds to wait between polling. Defaults to 200.options.maxDuration(Number?): Max duration in milliseconds to poll for before throwing. Defaults to 10000.
Returns
Element: A new element to avoid mutation and allow function chaining.
Support
| Platform | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| Web | TODO |
Examples
Wait for an input to be focused:
const { element, by } = require("appdriver");
(async () => {
await element(by.label("text-input"))
.waitToBeFocused();
})();
Related Methods
.waitFor(condition, options).waitToBeVisible(options).waitToBeInvisible(options).waitToExist(options).waitToNotExist(options)