|
|
@@ -1,6 +1,5 @@
|
|
|
package kr.co.zumo.app.lifeplus.activity;
|
|
|
|
|
|
-import android.support.test.espresso.ViewInteraction;
|
|
|
import android.support.test.rule.ActivityTestRule;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
@@ -12,17 +11,6 @@ import org.hamcrest.TypeSafeMatcher;
|
|
|
import org.junit.Rule;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
-import kr.co.zumo.app.R;
|
|
|
-
|
|
|
-import static android.support.test.espresso.Espresso.onView;
|
|
|
-import static android.support.test.espresso.Espresso.pressBack;
|
|
|
-import static android.support.test.espresso.action.ViewActions.click;
|
|
|
-import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
|
|
-import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
|
|
-import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
|
|
-import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
|
|
-import static org.hamcrest.Matchers.allOf;
|
|
|
-
|
|
|
public class MainActivityTest {
|
|
|
|
|
|
@Rule
|
|
|
@@ -30,97 +18,7 @@ public class MainActivityTest {
|
|
|
|
|
|
@Test
|
|
|
public void startFragment() {
|
|
|
- ViewInteraction appCompatButton = onView(
|
|
|
- allOf(withId(R.id.button_login), withText("Login"),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- appCompatButton.perform(click());
|
|
|
-
|
|
|
- ViewInteraction button = onView(
|
|
|
- allOf(withId(R.id.button_sign_up),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 1),
|
|
|
- isDisplayed()));
|
|
|
- button.check(matches(isDisplayed()));
|
|
|
-
|
|
|
- ViewInteraction button2 = onView(
|
|
|
- allOf(withId(R.id.button_back),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- button2.check(matches(isDisplayed()));
|
|
|
-
|
|
|
- ViewInteraction appCompatButton2 = onView(
|
|
|
- allOf(withId(R.id.button_sign_up), withText("Sign Up"),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 1),
|
|
|
- isDisplayed()));
|
|
|
- appCompatButton2.perform(click());
|
|
|
-
|
|
|
- ViewInteraction button3 = onView(
|
|
|
- allOf(withId(R.id.button_back),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- button3.check(matches(isDisplayed()));
|
|
|
-
|
|
|
- ViewInteraction appCompatButton3 = onView(
|
|
|
- allOf(withId(R.id.button_back), withText("Back"),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- appCompatButton3.perform(click());
|
|
|
-
|
|
|
- ViewInteraction button4 = onView(
|
|
|
- allOf(withId(R.id.button_back),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- button4.check(matches(isDisplayed()));
|
|
|
-
|
|
|
- ViewInteraction button5 = onView(
|
|
|
- allOf(withId(R.id.button_sign_up),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 1),
|
|
|
- isDisplayed()));
|
|
|
- button5.check(matches(isDisplayed()));
|
|
|
-
|
|
|
- pressBack();
|
|
|
|
|
|
- ViewInteraction button6 = onView(
|
|
|
- allOf(withId(R.id.button_login),
|
|
|
- childAtPosition(
|
|
|
- childAtPosition(
|
|
|
- withId(R.id.container),
|
|
|
- 0),
|
|
|
- 0),
|
|
|
- isDisplayed()));
|
|
|
- button6.check(matches(isDisplayed()));
|
|
|
|
|
|
}
|
|
|
|