Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Created September 6, 2016 20:53
Show Gist options
  • Save heitorcolangelo/1e7cc97629faca62cf60086851b7654a to your computer and use it in GitHub Desktop.
Save heitorcolangelo/1e7cc97629faca62cf60086851b7654a to your computer and use it in GitHub Desktop.
UserDetailsActivity - testing text color
@Test
public void whenEmailIsMissing_shouldDisplay_noInfoMessage() {
mActivityRule.launchActivity(createIntent(true));
onView(withId(R.id.user_details_image)).check(matches(isDisplayed()));
onView(withId(R.id.user_details_name)).check(matches(isDisplayed()));
onView(allOf(
withId(R.id.image_and_text_image),
hasSibling(withText("No info available.")))
).check(matches(isDisplayed()));
onView(allOf(
withText("No info available."),
withTextColor(ContextCompat.getColor(mActivityRule.getActivity(), R.color.red)))
).check(matches(isDisplayed()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment