Skip to content

Instantly share code, notes, and snippets.

@DiegoGSantos
Created July 29, 2019 01:52
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 DiegoGSantos/374ae244c219ac428881bf116a6928c7 to your computer and use it in GitHub Desktop.
Save DiegoGSantos/374ae244c219ac428881bf116a6928c7 to your computer and use it in GitHub Desktop.
class ScreenRobot {
fun enterTextIntoView(@IdRes viewId: Int, text: String): T {
onView(withId(viewId)).perform(typeText(text))
closeKeyboard()
return this as T
}
}
class LoginRobot: ScreenRobot() {
fun inputPassword(pass: String): LoginRobot {
return enterTextIntoView(LOGIN_PASSWORD, pass)
}
companion object {
private val LOGIN_PASSWORD = R.id.login_password
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment