Last active
October 8, 2016 20:28
-
-
Save heitorcolangelo/8644f123ed867c14a02a8b5ea3ff531b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginRobot { | |
LoginRobot username(String username) { | |
onView(withId(R.id.login_username)).perform(typeText(username), closeSoftKeyboard()); | |
return this; | |
} | |
LoginRobot password(String password) { | |
onView(withId(R.id.login_password)).perform(typeText(password), closeSoftKeyboard()); | |
return this; | |
} | |
ResultLoginRobot login() { | |
Intents.init(); | |
Matcher<Intent> matcher = hasComponent(MainActivity.class.getName()); | |
onView(withId(R.id.login_button)).perform(scrollTo(), click()); | |
return new ResultLoginRobot(); | |
} | |
} | |
class ResultLoginRobot { | |
ResultRobot isSuccess() { | |
onView(withId(R.id.login_button)).perform(click()); | |
intended(matcher); | |
Intents.release(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment