Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Last active January 5, 2022 00:18
Show Gist options
  • Save ferPrieto/9fd4054541cfb3a7c01198bef6dc3888 to your computer and use it in GitHub Desktop.
Save ferPrieto/9fd4054541cfb3a7c01198bef6dc3888 to your computer and use it in GitHub Desktop.
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