Skip to content

Instantly share code, notes, and snippets.

@nottyo
Created June 2, 2017 03:02
Show Gist options
  • Save nottyo/85cdc3b6c6b127405d3b6c440d11823e to your computer and use it in GitHub Desktop.
Save nottyo/85cdc3b6c6b127405d3b6c440d11823e to your computer and use it in GitHub Desktop.
EspressoTestBase.java
public class TestBase {
@Rule
public ActivityTestRule<LoadingActivity> mActivityTestRule = new ActivityTestRule<>(LoadingActivity.class);
protected Activity activity;
@Before
public void setUp(){
mActivity = mActivityTestRule.getActivity();
Espresso.registerIdlingResources(mActivityTestRule.getActivity().getCountingIdlingResource());
}
@After
public void tearDown(){
Espresso.unregisterIdlingResources(mActivityTestRule.getActivity().getCountingIdlingResource());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment