Lauri Koskela
04/28/2025, 5:06 PMComposeTestRule
for UI automation when generating baseline profiles? UiAutomator does not really seem to work that well with compose+wear (e.g. scrollUntil
does not detect scrolling), and I'm wondering if Compose's better UI testing APIs could be used here
I tried to use createEmptyComposeRule
but that does not seem to work either ("No compose hierarchies found in the app")yschimke
04/28/2025, 5:49 PMyschimke
04/28/2025, 5:50 PMyschimke
04/28/2025, 5:54 PM/** Represents a screen that can be used in Macrobenchmark tests. */
interface MacrobenchmarkScreen {
val content: @Composable BoxScope.() -> Unit
val exercise: MacrobenchmarkScope.() -> Unit
get() = { device.waitForIdle() }
}
yschimke
04/28/2025, 5:56 PMLauri Koskela
04/29/2025, 5:16 AMscrollUntil
should be working with compose? Right now I'm getting these kinds of errors in the logs: "Couldn't determine whether scroll was finished, retrying: count 1" - I think scrollUntil is trying to listen for some View-based scroll events, but won't receive them because scrolling is handled by compose. And after only a few tries it aborts before reaching the specified condition.
Is this expected or am I doing something wrong here? I'm using the function like this: col.scrollUntil(Direction.DOWN, Until.hasObject(By.res("settingsButton")))
yschimke
04/29/2025, 5:20 AMyschimke
04/29/2025, 5:20 AMLauri Koskela
04/29/2025, 9:51 AMstevebower
05/01/2025, 3:02 PM