Created
July 26, 2016 17:32
-
-
Save heitorcolangelo/05c669fa49cdd64e1f36373d31a1a3ca to your computer and use it in GitHub Desktop.
LoginActivityTest - intent test 1
This file contains 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
@Test | |
public void whenBothFieldsAreFilled_andClickOnLoginButton_shouldOpenMainActivity() { | |
Intents.init(); | |
onView(withId(R.id.login_username)).perform(typeText("username"), closeSoftKeyboard()); | |
onView(withId(R.id.login_password)).perform(typeText("password"), closeSoftKeyboard()); | |
Matcher<Intent> matcher = hasComponent(MainActivity.class.getName()); | |
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