Skip to content

Instantly share code, notes, and snippets.

@ecgreb
Created April 11, 2017 07:37
Show Gist options
  • Save ecgreb/618f33bcf00bb34b6d8736a5f8dca6bf to your computer and use it in GitHub Desktop.
Save ecgreb/618f33bcf00bb34b6d8736a5f8dca6bf to your computer and use it in GitHub Desktop.
@RunWith(AndroidJUnit4.class)
public class LoginActivityTest {
@Rule public ActivityTestRule<LoginActivity> activityRule =
new ActivityTestRule(LoginActivity.class);
@Test public void useAppContext() throws Exception {
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.ecgreb.mvpc", appContext.getPackageName());
}
@Test public void onLoginFormClick_shouldDisplayProgressView() throws Exception {
onView(withId(R.id.login_form)).perform(click());
onView(withId(R.id.login_progress)).check(matches(isDisplayed()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment