Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Last active July 24, 2016 16:06

Revisions

  1. heitorcolangelo revised this gist Jul 24, 2016. 1 changed file with 6 additions and 14 deletions.
    20 changes: 6 additions & 14 deletions LoginActivityTest.java
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,7 @@
    @RunWith(AndroidJUnit4.class)
    public class LoginActivityTest {

    @Rule
    public ActivityTestRule<LoginActivity>
    mActivityRule = new ActivityTestRule<>(LoginActivity.class, false, true);

    @Test
    public void whenActivityIsLaunched_shouldDisplayInitialState() {
    onView(withId(R.id.login_image)).check(matches(isDisplayed()));
    onView(withId(R.id.login_username)).check(matches(isDisplayed()));
    onView(withId(R.id.login_password)).check(matches(isDisplayed()));
    onView(withId(R.id.login_button)).check(matches(isDisplayed()));
    }
    @Test
    public void whenActivityIsLaunched_shouldDisplayInitialState() {
    onView(withId(R.id.login_image)).check(matches(isDisplayed()));
    onView(withId(R.id.login_username)).check(matches(isDisplayed()));
    onView(withId(R.id.login_password)).check(matches(isDisplayed()));
    onView(withId(R.id.login_button)).check(matches(isDisplayed()));
    }
  2. heitorcolangelo created this gist Jul 24, 2016.
    15 changes: 15 additions & 0 deletions LoginActivityTest.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    @RunWith(AndroidJUnit4.class)
    public class LoginActivityTest {

    @Rule
    public ActivityTestRule<LoginActivity>
    mActivityRule = new ActivityTestRule<>(LoginActivity.class, false, true);

    @Test
    public void whenActivityIsLaunched_shouldDisplayInitialState() {
    onView(withId(R.id.login_image)).check(matches(isDisplayed()));
    onView(withId(R.id.login_username)).check(matches(isDisplayed()));
    onView(withId(R.id.login_password)).check(matches(isDisplayed()));
    onView(withId(R.id.login_button)).check(matches(isDisplayed()));
    }
    }