Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Created January 11, 2022 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferPrieto/efd4ebd55dfed1aef83854a90fa5682e to your computer and use it in GitHub Desktop.
Save ferPrieto/efd4ebd55dfed1aef83854a90fa5682e to your computer and use it in GitHub Desktop.
This shows the functions that implement the test assertions
fun clickOnLaunchesTab() = launchesTabItem.assertIsDisplayed().performClick()
fun initialElementsShowed() {
launchesTitle.assertIsDisplayed()
dialogFilterButton.assertIsDisplayed()
}
fun listItemsShowed(numItemsShowed: Int) = launchesListItems.assertCountEquals(numItemsShowed)
fun advanceTimeBy(timeToAdvance: Long) = composeTestRule.mainClock.advanceTimeBy(timeToAdvance)
fun errorElementsDisplayed() {
connectionErrorMessage.assertExists().assertIsDisplayed()
connectionErrorAnimation.assertExists().assertIsDisplayed()
}
fun noResultsElementsShowed() {
noResultsText.assertExists().assertIsDisplayed()
listItemsShowed(0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment