Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Created August 18, 2016 01:28
Show Gist options
  • Save heitorcolangelo/e5acf937428e3055de6266d3a68e2008 to your computer and use it in GitHub Desktop.
Save heitorcolangelo/e5acf937428e3055de6266d3a68e2008 to your computer and use it in GitHub Desktop.
MainActivityTest - testing list item no tricks
@Test
public void checkUserItemView_isDisplayed_noTricks() {
server.enqueue(new MockResponse().setResponseCode(200).setBody(Mocks.SUCCESS));
mActivityRule.launchActivity(new Intent());
onView(allOf(withId(R.id.user_view_image), hasSibling(withText("Eddie Dunn")))).check(matches(isDisplayed()));
onView(allOf(withId(R.id.user_view_name), withText("Eddie Dunn"))).check(matches(isDisplayed()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment