Created
February 23, 2016 02:04
-
-
Save luizmarcus/d8df0ea88d416e102360 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
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class LoginTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( | |
MainActivity.class); | |
@Test | |
public void executarTesteLoginContaCorreta() { | |
//Insere o usuário no campo user | |
onView(withId(R.id.user)).perform(typeText("Testeapp"), closeSoftKeyboard()); | |
//Insere a senha no campo pass | |
onView(withId(R.id.pass)).perform(typeText("Password"), closeSoftKeyboard()); | |
//Clica no botao submit | |
onView(withId(R.id.submit)).perform(click()); | |
//Verifica se o texto é exibido no textView da SecondActivity | |
onView(withId(R.id.success)).check(matches(withText("Logado!"))); | |
} | |
@Test | |
public void executarTesteLoginContaErrada() { | |
//Insere o usuário no campo user | |
onView(withId(R.id.user)).perform(typeText("Usuario"), closeSoftKeyboard()); | |
//Insere a senha no campo pass | |
onView(withId(R.id.pass)).perform(typeText("Senha"), closeSoftKeyboard()); | |
//Clica no botao submit | |
onView(withId(R.id.submit)).perform(click()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment