element.isFocusable
element.isFocusable(): Promise<boolean>
Section titled “element.isFocusable(): Promise<boolean>”Checks if the element is focusable.
- Returns a promise that resolves to
trueif the element is focusable,falseotherwise. - An element is considered focusable if:
- It has a
tabindexattribute. - Is not disabled - has not
disabledattribute. - It is an input element (e.g.,
<input>,<textarea>). - It is a button element (e.g.,
<button>). - It is a link element (
<a>).
- It has a
describe('Test script', function () { it('Test 1', async () => { const element = await gf.get('.my-element'); const isFocusable = await element.isFocusable(); });});