Created
July 30, 2019 13:13
-
-
Save reactivedroid/ed947609a06ee6e550dfffce0decc560 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@LargeTest | |
@RunWith(AndroidJUnit4::class) | |
class HomeTest { | |
@get:Rule | |
val homeActivityTestRule = ActivityTestRule(HomeActivity::class.java) | |
private lateinit var loadingIdlingResource: LoadingIdlingResource | |
@Before | |
fun setUp() { | |
loadingIdlingResource = | |
LoadingIdlingResource(homeActivityTestRule.activity) | |
IdlingRegistry.getInstance().register(loadingIdlingResource) | |
} | |
@Test | |
fun testHomePageWithFavorites() { | |
launchHome { | |
verifyHome() | |
// Click on add to favorites icon | |
verifyFavorite() | |
// Verify that added to favorites toast is shown | |
verifyToast(homeActivityTestRule.activity) | |
verifyFavoriteScreen() | |
// Verify that pressing back from favorites goes to home | |
pressBack() | |
verifyHome() | |
} | |
} | |
@After | |
fun tearDown() { | |
IdlingRegistry.getInstance().unregister(loadingIdlingResource) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment