You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Unrendered text ends up in accessible names and aria snapshots #43019
There are two tests. One has a div role=button with light DOM text "Light" and a shadow root that contains "Shadow" and no slot. The other has a closed <details> with text directly inside it.
Expected behavior
The button is named "Shadow", like in Chromium's accessibility tree, so getByRole('button', { name: 'Shadow', exact: true }) finds it. The snapshot of the closed details is - group: Summary.
Actual behavior
The button is named "LightShadow", so the locator finds nothing. The snapshot is - group: Summary Details, the same as for an open details. Both tests fail in all three browsers.
Additional context
Unslotted elements are already treated as hidden in roleUtils, but text nodes are only checked through their parent element, which is visible in both cases. I'd like to work on this. I have a fix with tests ready, it was #42982, closed because there was no issue yet.
Environment
System:
OS: macOS 26.7
CPU: (14) arm64 Apple M4 Pro
Binaries:
Node: 20.20.2
npm: 10.8.2
npmPackages:
@playwright/test: 1.63.0 => 1.63.0
Activity