Skip to content

Instantly share code, notes, and snippets.

@igor-brishkoski
Last active January 13, 2019 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igor-brishkoski/5f0ee3c10618c6ca17f9cdc8337ea083 to your computer and use it in GitHub Desktop.
Save igor-brishkoski/5f0ee3c10618c6ca17f9cdc8337ea083 to your computer and use it in GitHub Desktop.
class CreatePostActivityTest {
@Test
fun void createPost_WithText_Success() {
// Find the edit text and perform typing text action
// close the keyboard after text has been entered
onView(withId(R.id.post_text))
.perform(ViewActions.typeText("This is a post"),ViewActions.closeSoftKeyboard))
// Find the submit post button and perform a click
onView(withId(R.id.post_button))
.perform(ViewActions.click())
// Find the verification text and verify the result text
onView(withId(R.id.post_submit_result_text))
.check(ViewAssertions.matches(ViewMatchers.withText(R.string.post_submitted)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment