If I have a MainActivity and a DetailActivity, how can I test that the DetailActivity has been launched?
public class MainScreenTest {
@Rule
public IntentsTestRule<MainActivity> mainActivityRule =
new IntentsTestRule<>(MainActivity.class);
@Test
public void shouldOpenDetailActivityOnClick() {
onView(withId(R.id.button)).check(matches(withText("Detail")));
onView(withId(R.id.button))
.perform(click());
...
}
}