-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Bug]: aria-disabled is not handled correctly in click() or toBeDisabled assertion #31439
Comments
There is no indication on this |
@pavelfeldman if that's the intended behaviour then it's fine and this bug is just a documentation improvement request then 🙂 |
@d4rky-pl do you want to send a PR? |
I ran into the same issue today. The |
@pavelfeldman I would love to send a PR but I'm going to need more details on what's the expected behaviour. When is |
I have another example where <html lang="en">
<body>
<label>
<ul role="menu">
<li role="menuitem" id="foo" aria-disabled="true">
AAAAA
</li>
</ul>
</label>
</body>
</html> and here is the test: test('aria-disabled is not ignored', async ({ page }) => {
await page.goto('http://localhost:57487/tests/');
await expect(page.locator('#foo')).toBeDisabled();
}); The error I got is:
Removing the |
Closing as per above as having no action item for the team. |
Version
1.45.0
Steps to reproduce
npx playwright test tests/aria-disable.spec.ts
Expected behavior
According to the documentation of
toBeDisabled
:Which sounds like the
aria-disabled="true"
attribute should be respected on all elements (anddisabled
attribute only on the listed ones). This is not the case here and both.click()
ignores the attribute and.toBeDisabled
treats this element as enabled.Actual behavior
Either the behaviour should be fixed and elements with
aria-disabled
should be treated as disabled for all intents and purposes of what "disabled" means in Playwright, or the documentation should be adjusted to state clearly that disabled state is only supported for HTML form elements.Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: