Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Last active January 5, 2022 00:18
Embed
What would you like to do?
This is the simplified test using MockWebServer
@ExperimentalMaterialApi
@RunWith(AndroidJUnit4::class)
@HiltAndroidTest
class LaunchesScreenKtTest : BaseScreenTest() {
@Test
@InternalCoroutinesApi
fun visibleItemsCountAfterOpeningTheScreen() {
mockWebServer.dispatcher = SuccessDispatcher()
setMainContent()
composeTestRule.apply{
onNodeWithText("Launches").assertIsDisplayed().performClick()
mainClock.advanceTimeBy(2000)
onAllNodesWithContentDescription(
"Item",
substring = true,
useUnmergedTree = true
).assertCountEquals(6)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment