Skip to content

Commit 95ecfbd

Browse files
author
Vivek Maskara
authored
Merge pull request commons-app#620 from tobias47n9e/master
Add nearby activity Espresso test
2 parents 6a56291 + 2f713ba commit 95ecfbd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package fr.free.nrw.commons;
2+
3+
import static android.support.test.espresso.Espresso.onView;
4+
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
5+
import static android.support.test.espresso.matcher.ViewMatchers.withText;
6+
7+
import android.support.test.espresso.assertion.ViewAssertions;
8+
import android.support.test.filters.LargeTest;
9+
import android.support.test.rule.ActivityTestRule;
10+
import android.support.test.runner.AndroidJUnit4;
11+
12+
import fr.free.nrw.commons.nearby.NearbyActivity;
13+
14+
import org.junit.Rule;
15+
import org.junit.Test;
16+
import org.junit.runner.RunWith;
17+
18+
@LargeTest
19+
@RunWith(AndroidJUnit4.class)
20+
public class NearbyActivityTest {
21+
@Rule
22+
public final ActivityTestRule<NearbyActivity> nearby =
23+
new ActivityTestRule<>(NearbyActivity.class);
24+
25+
@Test
26+
public void testActivityLaunch() {
27+
onView(withText("Nearby Places")).check(ViewAssertions.matches(isDisplayed()));
28+
}
29+
}

0 commit comments

Comments
 (0)