Benchmarking problem
rezafaraji93 opened this issue · comments
rezafaraji93 commented
While writing macro benchmark test, I realized that the UiAutomator is not able to find or recognize the elements inside the bottom sheet. I wanted to make sure if using this library can be the reason and also find a solution for this. Thanks.
dokar3 commented
Haven't tested it with a macro benchmark yet, but it should work with Ui Automator as the doc mentioned: Interoperability with UiAutomator.
Tried createComposeRule() + Ui Automator, and it works well.
@Test
fun testOpenAndCloseSheet() {
composeTestRule.setContent {
App()
}
val device = UiDevice.getInstance(getInstrumentation())
device.findObject(By.text("Simple")).click()
composeTestRule.waitForIdle()
assertTrue(device.hasObject(By.text("Close")))
device.findObject(By.text("Close")).click()
composeTestRule.waitForIdle()
assertFalse(device.hasObject(By.text("Close")))
}
I think maybe there are some other reasons preventing Ui Automator from finding the elements.
dokar3 commented
Closed due to no further information provided.