Skip to content

Instantly share code, notes, and snippets.

@drawers
Last active November 1, 2017 21:00
Show Gist options
  • Save drawers/b5e49e5d68dac4d70055ba919e6501dd to your computer and use it in GitHub Desktop.
Save drawers/b5e49e5d68dac4d70055ba919e6501dd to your computer and use it in GitHub Desktop.
An Espresso test
@Test
public void testShowAlertDialog() throws Exception {
//act
registrationActivity.showAlertDialog("No internet available.")
ScreenShotter.takeScreenshot("details", activity);
//assert
onView(withId(R.id.custom_alert_dialog_picture)).check(matches(isCompletelyDisplayed()));
onView(withId(R.id.custom_alert_dialog_button)).check(matches(withText("Shucks")));
onView(withId(R.id.custom_alert_dialog_button)).check(matches("No internet available."));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment