Skip to content

Commit

Permalink
Use waitUntil instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
riggaroo committed Aug 8, 2024
1 parent 954258b commit acc99e1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.example.jetnews

import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithContentDescription
Expand Down Expand Up @@ -62,13 +63,14 @@ class JetnewsTests {
}
}

@OptIn(ExperimentalTestApi::class)
@Test
fun app_opensInterests() {
composeTestRule.onNodeWithContentDescription(
label = "Open navigation drawer",
useUnmergedTree = true
).performClick()
composeTestRule.onNodeWithText("Interests", useUnmergedTree = true).performClick()
composeTestRule.onNodeWithText("Topics", useUnmergedTree = true).assertExists()
composeTestRule.onNodeWithText("Interests").performClick()
composeTestRule.waitUntilAtLeastOneExists(hasText("Topics"))
}
}

0 comments on commit acc99e1

Please sign in to comment.