-
Notifications
You must be signed in to change notification settings - Fork 112
Extensive listing of android elements #103
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
base: main
Are you sure you want to change the base?
Extensive listing of android elements #103
Conversation
src/android.ts
Outdated
@@ -207,9 +212,15 @@ export class AndroidRobot implements Robot { | |||
} | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding node["resource-id"] to hasTextOrLabel to support Android compose semantics. I've added more details in one of my issues
#99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource Id should be checked as well
label: node["resource-id"] || node["content-desc"] || node.hint || "",
@kamalsingh11 Fixed, thanks for the feedback :) |
My pleasure. Thanks for making these improvements |
@benlmyers I'm looking into merging this today. Btw, we have Slack, would be nice to talk :) |
No rush :) |
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.