[android] #3943 #3775 #3885 - added sample feature activity + espresso test

This commit is contained in:
Tobrun
2016-02-15 12:00:51 +01:00
parent b395302990
commit 7d6ac6adfc
11 changed files with 272 additions and 8 deletions

View File

@@ -0,0 +1,33 @@
package com.mapbox.mapboxsdk.testapp;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import com.mapbox.mapboxsdk.testapp.utils.ViewUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests on DynamicMarkerChange
*/
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DynamicMarkerChangeActivityTest extends BaseTest {
@Rule
public ActivityTestRule<DynamicMarkerChangeActivity> mActivityRule = new ActivityTestRule<>(
DynamicMarkerChangeActivity.class);
@Test
public void testSanity() {
checkViewIsDisplayed(R.id.mapView);
}
@Test
public void testFabClick() {
ViewUtils.clickView(R.id.fab);
}
}

View File

@@ -0,0 +1,15 @@
package com.mapbox.mapboxsdk.testapp.utils;
import android.support.annotation.IdRes;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
public class ViewUtils {
public static void clickView(@IdRes int viewRes) {
onView(withId(viewRes))
.perform(click());
}
}