8000 [Bug]: waitForHidden() times out even after the element is detached from DOM · Issue #1791 · microsoft/playwright-java · GitHub
[go: up one dir, main page]

Skip to content

[Bug]: waitForHidden() times out even after the element is detached from DOM #1791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
devTodead opened this issue May 14, 2025 · 0 comments

Comments

@devTodead
Copy link

Version

1.51.0

Steps to reproduce

  1. Perform the action that makes the progress bar visible.
  2. Immediately before or after the progress bar is detached, call waitFor to wait for it to disappear.
page.locator("xpath=//app-progress-bar//div[@id='nprogress']")
locator.first().waitFor(new Locator.WaitForOptions() 
.setState(WaitForSelectorState.HIDDEN) 
.setTimeout(timeout * 1000));
  1. waitFor does not resolve but continues to wait until the set timeout is reached.

Expected behavior

Logically, once an element has been completely removed from the DOM, it no longer exists to be either "visible" or "hidden". In this case, waitFor State HIDDEN should recognize that the element no longer exists and resolve immediately, instead of waiting for a "hidden" state that can never occur.

Actual behavior

Playwright continues to wait until the set timeout is reached, leading to unnecessary delays in tests and potentially causing inaccurate failures.

Additional context

No response

Environment

Playwright version: 1.51.0
Operating system: Windows 10
Programming language: Java
Browser: Chromium (Playwright's bundled version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0