Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Created July 26, 2016 17:32
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 heitorcolangelo/05c669fa49cdd64e1f36373d31a1a3ca to your computer and use it in GitHub Desktop.
Save heitorcolangelo/05c669fa49cdd64e1f36373d31a1a3ca to your computer and use it in GitHub Desktop.
LoginActivityTest - intent test 1
@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