Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

elementHandle.isVisible should return straight away even if the selector was not found #981

Closed
9 tasks done
ankur22 opened this issue Jul 26, 2023 · 0 comments
Closed
9 tasks done
Assignees
Labels
bug Something isn't working user request Requested by the community

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jul 26, 2023

Brief summary

Currently when we work with elementHandle.isVisible it will wait and try to match on the given selector before returning true or false on whether it is visible or not. To match Playwrights behaviour, and the expectations of our users, we should change the behaviour to return straight away even if the selector is not present in the DOM.

  await page.goto(`url-redacted`)

  const alreadyInstalled = await page.locator('//h3[text()="Resource consumption"]').isVisible()

  if (alreadyInstalled) {
    console.log('Dashboards and alert rules already installed on the page')
    return
  }

xk6-browser version

v0.45.0

OS

NA

Chrome version

NA

Docker version and image (if applicable)

NA

Steps to reproduce the problem

  1. Work with elementHandle.isVisible and set the selector to something that will not be present on the page that the test navigates to.

Expected behaviour

It should return false straight away.

Actual behaviour

It waits for the selector to match, but eventually times out.

Tasks

Preview Give feedback
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working user request Requested by the community
Projects
None yet
Development

No branches or pull requests

1 participant