Created
August 27, 2015 07:53
-
-
Save yamanetoshi/19d998f7d1df8a757817 to your computer and use it in GitHub Desktop.
Espresso Hello World
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
import android.support.test.rule.ActivityTestRule; | |
import android.support.test.runner.AndroidJUnit4; | |
import android.test.suitebuilder.annotation.LargeTest; | |
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.assertion.ViewAssertions.matches; | |
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; | |
import static android.support.test.espresso.matcher.ViewMatchers.withText; | |
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class HelloWorldEspressoTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mainActivityRule | |
= new ActivityTestRule(MainActivity.class); | |
@Test | |
public void listGoesOverTheFold() { | |
onView(withText("Hello world!")).check(matches(isDisplayed())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment