Mikołaj Kąkol
11/10/2020, 2:10 PMCucumber
for testing in compose?
Currently I'm having quite a big issue:
@RunWith(AndroidJUnit4::class)
class GivenDefinitionsComposeRule {
@get:Rule
var composeTestRule = createAndroidComposeRule<MainActivity>()
@Given("I have a freshly installed application")
fun i_have_a_freshly_installed_application() {
composeTestRule.onNodeWithTag("TextUser").performTextInput("test")
}
}
Fails with:
java.lang.IllegalStateException: Test not setup properly. Use a ComposeTestRule in your test to be able to interact with composables
at androidx.ui.test.android.SynchronizedTreeCollector.ensureAndroidOwnerRegistryIsSetUp(SynchronizedTreeCollector.kt:178)
at androidx.ui.test.android.SynchronizedTreeCollector.getAllSemanticsNodes$ui_test_release(SynchronizedTreeCollector.kt:54)
While similar setup for test uiautomator works