| @ -1,56 +0,0 @@ | |||||
| package com.datepickerexample; | |||||
| import android.support.test.espresso.ViewInteraction; | |||||
| import android.support.test.rule.ActivityTestRule; | |||||
| import android.support.test.runner.AndroidJUnit4; | |||||
| import android.test.suitebuilder.annotation.LargeTest; | |||||
| import android.view.KeyEvent; | |||||
| import org.junit.Rule; | |||||
| import org.junit.Test; | |||||
| import org.junit.runner.RunWith; | |||||
| import static android.support.test.espresso.Espresso.onView; | |||||
| import static android.support.test.espresso.action.ViewActions.click; | |||||
| import static android.support.test.espresso.action.ViewActions.pressKey; | |||||
| import static android.support.test.espresso.action.ViewActions.replaceText; | |||||
| import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; | |||||
| import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; | |||||
| import static android.support.test.espresso.matcher.ViewMatchers.withText; | |||||
| import static org.hamcrest.Matchers.allOf; | |||||
| @LargeTest | |||||
| @RunWith(AndroidJUnit4.class) | |||||
| public class HelloWorldEspressoTest { | |||||
| @Rule | |||||
| public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class); | |||||
| @Test | |||||
| public void mainActivityTest() { | |||||
| try { | |||||
| Thread.sleep(15000); | |||||
| } catch (InterruptedException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| ViewInteraction minimal = onView(allOf(withText("Minimal"), isDisplayed())); | |||||
| minimal.perform(click()); | |||||
| onView(allOf(withText("Today"), isDisplayed())); | |||||
| onView(allOf(withText("Back"), isDisplayed())).perform(click()); | |||||
| minimal = onView(allOf(withText("Minimal"), isDisplayed())); | |||||
| minimal.perform(click()); | |||||
| try { | |||||
| Thread.sleep(30000); | |||||
| } catch (InterruptedException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } | |||||