Fixed
Status Update
Comments
ry...@google.com <ry...@google.com>
as...@google.com <as...@google.com> #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.
ap...@google.com <ap...@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.
Description
I have created a code sample which shows the issue.
Steps to Reproduce:
Compile this code and start the TestKeyContent() composable. Observe the log messages.
Result:
The items list contains the elements 1...6 or only 2 (changes every 2 seconds). The element 2 is always part of the items. The composable KeyContent1 should log the message 'KeyContent1 remember 2' only in the composition phase. CORRECT! The composable KeyContent2 should also log the message 'KeyContent2 remember 2' only in the composition phase. BUG! Each recomposition creates a new log message 'KeyContent2 remember 2'.