Repository navigation
Read an empty box as hidden and match mixed and absent role states - #1088
Merged
Merged
Conversation
…loses #1075, Closes #1076) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
…ility-role-states
Closes #1076) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
…ility-role-states
Member
Author
|
@coderabbitai review |
Contributor
Action not completed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An element with an empty box read as visible, and
GetByRolestate options matched mixed and absent states that Playwright (and upstream) skip. Seven ported Playwright tests failed because of it; they ran behindExpectedToFailAsync. This PR fixes the cause and removes the marker from them.IsVisible,IsHidden,toBeVisible,toBeHidden,WaitForand thevisibleoption now treat an element with an empty box as not visible (LocatorEngine.IsNodeVisible). Upstream puts this in itshiddenstate (in-page/read-semantics.ts). The port keepsHiddento the render rules, because role queries and the agent share it, so the page script sets a separate flag.CheckedorPressedskip a mixed node (indeterminate checkbox,aria-pressed="mixed").Expanded = falseskips a node with noaria-expanded.Levelof arole="heading"element is itsaria-level, else 2 (upstreamlevel).Upstream followed: tester-army/e2e at
bdf769b(packages/web/src/in-page/read-semantics.ts; testslocator-is-visible.e2e.ts,selectors-role.e2e.ts).Tests: no new upstream test.
ExpectedToFailAsyncis removed fromLocatorIsVisibleTests(IsVisible_and_isHidden_should_work,IsVisible_inside_a_button,IsVisible_inside_a_role_button) andSelectorsRoleTests(Should_support_checked,_pressed,_expanded,_level). TheLogoimage inWebEngineTestsgets a size, since an empty box is no longer visible..NET-only symbols:
NodeStates.EmptyBox,NodeStates.Mixed,NodeStates.ExpandedAbsent(web only; upstream reads these as nullable or insidehidden, and the port'sboolstates are shared with mobile and Windows, so flags avoid a breaking change). One .NET-only test,IsNodeVisibleTests.Treats_a_node_with_an_empty_box_as_not_visible.Known limits: actionability checks and the agent still read
Hiddenonly, so a click on an empty element is not refused.Mixedis one flag for bothCheckedandPressed.Docs: COMPATIBILITY.md and the
NodeStatesAPI page.Closes #1075
Closes #1076
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK