Skip to content

Instantly share code, notes, and snippets.

@igor-brishkoski
Last active January 13, 2019 22:07
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/fa13565aefcf75cbf9552c6bab88e872 to your computer and use it in GitHub Desktop.
Save igor-brishkoski/fa13565aefcf75cbf9552c6bab88e872 to your computer and use it in GitHub Desktop.
class CreatePostRobot : BaseRobot() {
fun enterPostText(text: String) =
postText().typeText(text)
fun submitPost() =
postButton().click()
fun matchResultText(expectedText: String) =
postSubmitResultText().isTextDisplayed(expectedText)
companion object {
fun postText(): ViewInteraction =
onView(withId(R.id.post_text))
fun postButton(): ViewInteraction =
onView(withId(R.id.post_button))
fun postSubmitResultText(): ViewInteraction =
onView(withId(R.id.post_submit_result_text))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment