In Android Studio, in the androidTest folder, I have this test case:
@RunWith(AndroidJUnit4.class)
@LargeTest
public class LoginActivityTest {
@Rule
public ActivityTestRule<LoginActivity> activityTestRule =
new ActivityTestRule<>(LoginActivity.class);
@Test
public void teamsListIsSortedAlphabetically() {
onView(withId(R.id.etEmail)).perform(click(), replaceText("asd@asd.vf")
);
onView(withId(R.id.etPassword)).perform(click(), replaceText("asdasd")
);
onView(withId(R.id.bLoginSubmit)).perform(click());
}
}
The app launches LoginActivity, logs in, the next activity is shown for 1-2 seconds and then it exits the activity leaving me on the launcher screen. How do I make Espresso stay on that screen?