Android Compose UI test: I am getting this error when I tried to use composeTestRule to access compose node. This only happens when my app finishes login sync and app brings up the homescreen. My app has a takeover screen over the homescreen after the sync. It's like when the sync finishes, first app shows homescreen and the takeover screen shows up. Homescreen and login sync screen is done using xml and the takeover screen is doing using jetpack compose. Takeover screen (jetpack compose screen) is setcontent in a fragment from HomeActivity. Fyi: I am doing full app UI test (end to end).I have it at my class level
@get:Rule val composeTestRule = createAndroidComposeRule<HomeActivity>() composeTestRule.onNodeWithText("Dismiss").assertIsDisplayed()
Does anybody know, why I can't access to composeTestRule on the takeover screen? and get the below error? java.lang.IllegalStateException: Test not setup properly. Use a ComposeTestRule in your test to be able to interact with composables