Created
September 28, 2016 08:22
-
-
Save maydin/94463046e5a52fd028198b6805d6e1aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@LargeTest | |
@RunWith(AndroidJUnit4.class) | |
public class MainActivityTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class); | |
@Test | |
public void mainActivityTest() { | |
ViewInteraction textView = onView(allOf(withId(R.id.textview), | |
withText("Hello World"))); | |
textView.check(matches(withText("Hello World"))); | |
ViewInteraction appCompatButton = onView( | |
allOf(withId(R.id.button), withText("Click"), isDisplayed())); | |
appCompatButton.perform(click()); | |
try { | |
Thread.sleep(300); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
ViewInteraction textView2 = onView(allOf(withId(R.id.textview), | |
withText("Bye World"))); | |
textView.check(matches(withText("Bye World"))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment