gf.isFocusable
gf.isFocusable(selector: string): Promise<boolean>
Section titled “gf.isFocusable(selector: string): Promise<boolean>”Checks if the specified element is focusable.
selector: The CSS selector of the element to check.- 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 isFocusable = await gf.isFocusable('.my-element'); });});