gf.isVisible
gf.isVisible(selector: string): Promise<boolean>
Section titled “gf.isVisible(selector: string): Promise<boolean>”Checks if the specified element is visible.
selector: The CSS selector of the element to check.- Returns a promise that resolves to
trueif the element is visible,falseotherwise. - An element is considered visible if:
- Its
displayproperty is not set tonone. - Its
visibilityproperty is not set tohidden. - Its
opacityproperty is not set to0. - It is not off-screen.
- It has a positive width and height.
- Its
describe('Test script', function () { it('Test 1', async () => { const isVisible = await gf.isVisible('.my-element'); });});