mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add nearby activity Espresso test
Currently the nearby activity is not included in the Espresso tests. This commit adds one test that checks if the activity loads and the headline is displayed.
This commit is contained in:
parent
19eddb7d26
commit
0f75bb58f9
1 changed files with 29 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
||||||
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
|
import android.support.test.espresso.assertion.ViewAssertions;
|
||||||
|
import android.support.test.filters.LargeTest;
|
||||||
|
import android.support.test.rule.ActivityTestRule;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.nearby.NearbyActivity;
|
||||||
|
|
||||||
|
import static android.support.test.espresso.Espresso.onView;
|
||||||
|
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||||
|
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||||
|
|
||||||
|
@LargeTest
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class NearbyActivityTest {
|
||||||
|
@Rule
|
||||||
|
public final ActivityTestRule<NearbyActivity> nearby =
|
||||||
|
new ActivityTestRule<>(NearbyActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testActivityLaunch() {
|
||||||
|
onView(withText("Nearby Places")).check(ViewAssertions.matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue