fix: pick locator uses correct role and full name for elements with children (#843)#844
Merged
Merged
Conversation
…hildren (#843) parseAriaSnapshot treated multi-line snapshots as parent→child, but when the picked element itself has structural children (generic, img, text), it misidentified the child as the element. This caused: - pw assertion using child's role (generic) instead of element's role (link) - pw command using truncated JS name instead of full aria accessible name Fix: check if the first child has an interactive role (button, checkbox, link, etc.). If not, the first line IS the element — children are just DOM contents. Container→child parsing only applies when the child is interactive (e.g. listitem → checkbox). Closes #843 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
parseAriaSnapshottreated all multi-line snapshots as parent→child, but when the picked element has structural children (generic, img, text), it misidentified the child as the elementgenericinstead oflink) and truncated name in pw commandBefore / After
Before:
After:
Test plan
Closes #843
🤖 Generated with Claude Code