.toBeFocused()
Asserts focus status of element.
Usage
expect(value).toBeFocused()
Returns
Promise
: A promise that resolves if the assertion is successful.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | TODO |
Examples
Check if the text input is focused:
const { element, by, expect } = require("appdriver");
(async () => {
const $input = await element(by.label("text-input"));
return expect($input).toBeFocused();
})();