Status Update
Comments
be...@google.com <be...@google.com>
be...@google.com <be...@google.com>
ni...@ansman.se <ni...@ansman.se> #2
You can provide your own regex to By.text()
.
For example, By.text(Pattern.compile("All albums.*", Pattern.DOTALL))
should be equivalent to a multi-line startsWith.
be...@google.com <be...@google.com> #3
I'm probably dumb but why would it be the default and wanted behavior if not documented properly?
Every known startWith / contains function in Java/Kotlin are multiline, the javadoc says: A UI element will be considered a match if its text value starts with the substring parameter
Many people will fall into this non standard default behavior and loose tons of time trying to figure out why.
If you still consider this default is the correct one, then please document it.
ap...@google.com <ap...@google.com> #4
Branch: androidx-main
commit 1625e615b9aed44323029da2726a57390956e4ab
Author: Daniel Peykov <peykov@google.com>
Date: Wed Nov 02 21:46:28 2022
Support multiline text and description matching
* Fixes inconsistency between UiSelector (partial support) and
BySelector, and clarifies the case sensitivity of related methods.
* Also, reorganizes byselector_test_activity to decrease its height
which was right up to the limit on some device types.
Bug: 255787130
Test: ./gradlew :test:uiautomator:integration-tests:t:cAT
Change-Id: Ied9eff43ce4ce6f2ace2889a55b0382e71604b61
M test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/BySelectorTest.java
M test/uiautomator/integration-tests/testapp/src/main/res/layout/byselector_test_activity.xml
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/UiSelector.java
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Until.java
ub...@gmail.com <ub...@gmail.com> #5
Will be fixed in version 2.3.0-alpha02.
To clarify
However, looking at this again, it was inconsistent between UiSelector and BySelector, and users are unlikely to be relying on single line matching.
pr...@google.com <pr...@google.com> #6
Thanks a lot for the change.
I understand legacy and everything, it was just the close without discussion about proper solution (including doc that would have worked too) that was strange.
Seeing the $ in the regexp took me time, and it's good to avoid this to other users when improvement is possible.
Description
The plugin option is set to allow multiple occurrences , but then we only read one path.
We should either just disable that, or support multiple files.