-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[Bug]: toBeVisible() ignores screen reader invisibility (aria-hidden=true) #35829
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
Comments
@mleonhard Playwright has a specific definition of the element visibility that does not include Note that we are not going to change our existing visibility definition, because that would be a large breaking change. |
@dgozman Thanks for your quick reply! I made a modal that starts out hidden ( Does Playwright provide any way to check if an element matched by testID or locator is visible to screen readers?
Does Playwright team ever make breaking changes? Maybe a slow rollout would be acceptable: add a global 'ariaVisibility' option defaulting to "warning", then a year later make it "error". This would give folks time to notice the warning and either opt out by setting the option to "ignore" or update their tests and hopefully find and fix some accessibility problems and set the option to "error" to prevent the class of accessibility regressions. |
@mleonhard It seems like you need some kind of accessibility tests for your page, because everything works in a standard scenario, but some things are not accessible. The tools for that are axe accessibility audits, aria snapshots and various
I'd say no. Certainly not any big changes like this one. |
Version
1.52.0
Steps to reproduce
Download attached file and then:
playwright-aria-hidden.zip
Expected behavior
I expect
expect(element1).toBeVisible()
to fail saying that the element is invisible to screen readers because of attributearia-hidden="true"
.Actual behavior
expect(element1).toBeVisible()
succeeds.Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: