Created
May 17, 2020 21:57
-
-
Save cdmunoz/0396fb111bad72820de9dba5d1084fb6 to your computer and use it in GitHub Desktop.
Espresso IdleResource UI Test
This file contains hidden or 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 HomeFragmentUITest { | |
@get:Rule | |
val activityTestRule = ActivityScenarioRule(MainActivity::class.java) | |
@Before | |
fun setUp() { | |
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource) | |
} | |
@After | |
fun tearDown() { | |
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource) | |
} | |
@Test | |
fun initial_state_home_screen_UI_test() { | |
activityTestRule.scenario.moveToState(Lifecycle.State.RESUMED) | |
onView(withId(R.id.home_photos_progress_container)).check(matches(not(isDisplayed()))) | |
onView(withId(R.id.home_photos_list)).check(matches(isDisplayed())) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment