Status Update
Comments
is...@google.com <is...@google.com>
[Deleted User] <[Deleted User]> #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.
os...@google.com <os...@google.com>
ho...@google.com <ho...@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.
ti...@gmail.com <ti...@gmail.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
[Deleted User] <[Deleted User]> #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.
ap...@google.com <ap...@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.
ri...@ffw.com <ri...@ffw.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.test.uiautomator:uiautomator:2.3.0-alpha02
os...@google.com <os...@google.com> #8
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha06
Description
I'm using a Composable which take a content @Composable in parameter, and it seems that with the final version of ConstraintLayout, there is no update.
Here is the code
@Composable
Example(
modifier : Modifier = Modifier,
content : @Composable () -> Unit
) {
ConstraintLayout(modifier = modifier
.fillMaxSize()
.background(color = Color.Blue)
) {
val (title, someContent) = createRefs()
Text(text = "a text", modifier = Modifier.constrainAs(title) {
top.linkTo(parent.top)
height = Dimension.wrapContent
width = Dimension.wrapContent
})
Box(modifier = Modifier
.constrainAs(someContent) {
width = Dimension.fillToConstraints
linkTo(start = parent.start, end = parent.end)
linkTo(top = parent.top, bottom = parent.bottom, bias = 1.0f)
height = Dimension.preferredWrapContent
}
.background(color = Color.Yellow)) {
content()
}
}
}
The Box height is initialized with the fist element received by the composable and does not change anymore.
For example, I send to this composable a Column with [Button + result of a Webservice]. The button is displayed at startup, and then after some times I received the result of the API, it does not recompose correctly, the size of the Box stays wrapcontent with the button only!
Moreover, it seems that the behaviour in a compose MotionLayout is the same (no update)