dokar3 / sheets

Another feature-rich bottom sheet for Compose Multiplatform.

Home Page:https://dokar3.github.io/sheets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Benchmarking problem

rezafaraji93 opened this issue · comments

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.

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.

commented

Closed due to no further information provided.