Skip to content

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 true if the element is visible, false otherwise.
  • An element is considered visible if:
    • Its display property is not set to none.
    • Its visibility property is not set to hidden.
    • Its opacity property is not set to 0.
    • It is not off-screen.
    • It has a positive width and height.
describe('Test script', function () {
it('Test 1', async () => {
const isVisible = await gf.isVisible('.my-element');
});
});