Last active
September 3, 2016 18:29
-
-
Save heitorcolangelo/2551db7f8dfe1d7b7ba84d460ca3a8b4 to your computer and use it in GitHub Desktop.
UserDetailsActivity - check no info text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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())); | |
} | |
private Intent createIntent(boolean missingInfo) { | |
return new Intent().putExtra(UserDetailsActivity.CLICKED_USER, getMockedUser(missingInfo)); | |
} | |
private UserVO getMockedUser(boolean missingInfo) { | |
final String mock = missingInfo ? Mocks.USER_MISSING_INFO : Mocks.USER; | |
return UsersApi.GSON.fromJson(mock, UserVO.class); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment