Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created January 24, 2020 02:36
Show Gist options
  • Save cdmunoz/ffe51ece89880490ce62769169014ad5 to your computer and use it in GitHub Desktop.
Save cdmunoz/ffe51ece89880490ce62769169014ad5 to your computer and use it in GitHub Desktop.
@RunWith(AndroidJUnit4ClassRunner::class)
class MyUITestWithIdlingResourcesTest {
... //some variable def
@get:Rule
val activityRule = ActivityScenarioRule(MyMainActivity::class.java)
@Before
fun setup() {
//register idling resource
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun close() {
//unregister idling resource
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
... //Tests
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment