Conversation
This reverts commit 6ade6a4.
4e6780c to
4993f2f
Compare
| if (el['@_text']) { | ||
| return { | ||
| strategy: '-android uiautomator', | ||
| selector: `new UiSelector().text("${el['@_text']}")`, | ||
| }; | ||
| } |
There was a problem hiding this comment.
It would be nice to avoid using this UiSelector since Google is going to deprecate it
https://developer.android.com/training/testing/other-components/ui-automator-legacy#ui-automator
| ]); | ||
|
|
||
| // Interactive classes that should always be kept | ||
| const INTERACTIVE_CLASSES = new Set([ |
There was a problem hiding this comment.
How did you collect them? (I'm not sure if they are sufficient for this "interactive" meaning.)
If you have a reference for these list, it makes sense to leave such a url etc in the comment for future maintenance
There was a problem hiding this comment.
What if there are other layout classes from the apps that needs to be fetched, which is not in the list here? We should all the users to append to this list from the config we have
| }; | ||
| } | ||
|
|
||
| // Layout containers that should be excluded |
There was a problem hiding this comment.
As same as INTERACTIVE_CLASSES, it makes sense to leave a rerefence for them
| @@ -0,0 +1,67 @@ | |||
| /** | |||
| * Test script to verify page-source-filter with real data | |||
There was a problem hiding this comment.
Please add this kind of code into tests https://github.com/appium/appium-mcp/tree/main/src/tests and implement as test code with jest
| ]); | ||
|
|
||
| // Interactive classes that should always be kept | ||
| const INTERACTIVE_CLASSES = new Set([ |
There was a problem hiding this comment.
What if there are other layout classes from the apps that needs to be fetched, which is not in the list here? We should all the users to append to this list from the config we have
Page Source Filtering
Summary
New Tools
Page Source Filtering
The
appium_get_page_sourcetool now returns filtered JSON for Android devices instead of raw XML:Filtered output includes:
content-desc(accessibility)resource-idappium_find_elementExample output:
{ "elements": [ { "type": "Button", "text": "Login", "strategy": "accessibility id", "selector": "Login button", "clickable": true } ], "stats": { "totalElements": 120, "filteredElements": 41 } }Use
raw=trueparameter to get unfiltered XML if needed.Test Plan