Extensive listing of android elements#103
Open
benlmyers wants to merge 3 commits intomobile-next:mainfrom
Open
Extensive listing of android elements#103benlmyers wants to merge 3 commits intomobile-next:mainfrom
benlmyers wants to merge 3 commits intomobile-next:mainfrom
Conversation
src/android.ts
Outdated
|
|
||
| if (node.text || node["content-desc"] || node.hint) { | ||
| // Include elements with text/labels OR clickable/focusable elements (like icons, buttons) | ||
| const hasTextOrLabel = node.text || node["content-desc"] || node.hint; |
There was a problem hiding this comment.
I suggest adding node["resource-id"] to hasTextOrLabel to support Android compose semantics. I've added more details in one of my issues
#99
kamalsingh11
left a comment
There was a problem hiding this comment.
resource Id should be checked as well
label: node["resource-id"] || node["content-desc"] || node.hint || "",
Contributor
Author
|
@kamalsingh11 Fixed, thanks for the feedback :) |
kamalsingh11
approved these changes
Jun 20, 2025
|
My pleasure. Thanks for making these improvements |
Member
|
@benlmyers I'm looking into merging this today. Btw, we have Slack, would be nice to talk :) |
Contributor
Author
|
No rush :) |
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.
I noticed sometimes buttons or elements not containing text are missed when listing elements. This seems to happen on Android, but iOS works fine.
This will increase the token cost of Android tests. I'm happy to make these changes behind a parameter, but based on iOS parity, I believe it makes more sense for this to be default.
In this example, before we don't see the Pen icon in the elements list, but after we do:
Before (ignore the funky indentation):
After:
which contains
{"type":"android.view.View","text":"","labe l":"","identifier":"fixture_login_button","coordinates":{"x":912,"y":1199,"width":126," height":126}}, the pen button.