Skip to content

Instantly share code, notes, and snippets.

@maltebucksch
Last active March 29, 2018 09:42
Show Gist options
  • Save maltebucksch/a1f3880ef62489c9308bf7e524928d06 to your computer and use it in GitHub Desktop.
Save maltebucksch/a1f3880ef62489c9308bf7e524928d06 to your computer and use it in GitHub Desktop.
Espresso Example
@Test
public void testAddNote() {
// press “add note” button
onView(withId(R.id.addNote)).perform(click());
// type “Espresso rules” as the note content
onView(withId(R.id.noteContent)).perform(typeText("Espresso rules"));
// press “ok/save” button
onView(withId(R.id.ok)).perform(click());
// check if note-list contains note with the text “Espresso rules"
onView(withText("Espresso rules")).check(matches(isDisplayed()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment