Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Last active August 29, 2015 14:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmdupr33/a25db0930e583db05535 to your computer and use it in GitHub Desktop.
Save kmdupr33/a25db0930e583db05535 to your computer and use it in GitHub Desktop.
Showing espresso code for testing a walking skeleton
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MainActivityTests {
@Rule
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
@Test
public void loadHackerNewsPostsOnStartup() {
onView(withId(R.id.recyclerView)).check(matches(isDisplayed()));
onView(withText("9897306")).check(matches(isDisplayed()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment