diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration')
9 files changed, 0 insertions, 299 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/BaseIntegrationTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/BaseIntegrationTest.kt deleted file mode 100644 index 2afff34d34..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/BaseIntegrationTest.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.content.Context -import android.content.Intent -import android.content.Intent.FLAG_ACTIVITY_NEW_TASK -import android.support.test.InstrumentationRegistry -import android.support.test.uiautomator.* -import com.mapbox.mapboxsdk.AppCenter -import org.junit.Before - -const val TIMEOUT_UI_SEARCH_WAIT = 5000L - -abstract class BaseIntegrationTest : AppCenter() { - - protected lateinit var device: UiDevice - - @Before - open fun beforeTest() { - device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) - } -} - -/** - * Launches an activity with FLAG_ACTIVITY_NEW_TASK. - * <p> - * To resume an activity, you need to add a single instance launchmode to your manifest configuration. - * <p> - */ -fun UiDevice.launchActivity(context: Context, clazz: Class<*>) { - val applicationPackage = InstrumentationRegistry.getTargetContext().packageName - val intent = Intent(context, clazz) - intent.addFlags(FLAG_ACTIVITY_NEW_TASK) - InstrumentationRegistry.getContext().startActivity(intent) - wait(Until.hasObject(By.pkg(applicationPackage).depth(0)), TIMEOUT_UI_SEARCH_WAIT) -} - -fun UiDevice.scrollRecyclerViewTo(recycleItem: String) { - val appView = UiScrollable(UiSelector().scrollable(true)) - appView.scrollIntoView(UiSelector().text(recycleItem)) -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/FragmentBackStackTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/FragmentBackStackTest.kt deleted file mode 100644 index 5673ffd4c1..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/FragmentBackStackTest.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.test.uiautomator.UiSelector -import com.mapbox.mapboxsdk.testapp.activity.fragment.FragmentBackStackActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates MapFragment integration on the backstack - */ -@RunWith(AndroidJUnit4::class) -class FragmentBackStackTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<FragmentBackStackActivity> = ActivityTestRule(FragmentBackStackActivity::class.java) - - @Test - @LargeTest - fun backPressedOnBackStackResumed() { - device.waitForIdle() - clickReplaceFragmentButton() - device.pressHome() - device.waitForIdle() - device.launchActivity(activityRule.activity.applicationContext, FragmentBackStackActivity::class.java) - backPressBackStack() - device.waitForIdle() - } - - private fun clickReplaceFragmentButton() { - device.findObject(UiSelector().description(textDescription)).click() - } - - private fun backPressBackStack() { - device.pressBack() // pops fragment, showing map - device.pressBack() // finish activity - } - - private companion object { - const val textDescription = "btn_change_fragment" - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReopenTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReopenTest.kt deleted file mode 100644 index 40bc182bd7..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReopenTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.maplayout.SimpleMapActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates reopening an Activity with a GLSurfaceView - */ -@RunWith(AndroidJUnit4::class) -class GLSurfaceViewReopenTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<SimpleMapActivity> = ActivityTestRule(SimpleMapActivity::class.java) - - @Test - @LargeTest - fun reopenSimpleMapActivity() { - device.waitForIdle() - device.pressHome() - device.waitForIdle() - device.launchActivity(activityRule.activity, SimpleMapActivity::class.java) - device.waitForIdle() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReuseTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReuseTest.kt deleted file mode 100644 index 5bf45518ec..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/GLSurfaceViewReuseTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.maplayout.GLSurfaceRecyclerViewActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates if a GLSurfaceView surface can be recreated without crashing. - */ -@RunWith(AndroidJUnit4::class) -class GLSurfaceViewReuseTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<GLSurfaceRecyclerViewActivity> = ActivityTestRule(GLSurfaceRecyclerViewActivity::class.java) - - @Test - @LargeTest - fun scrollRecyclerView() { - device.waitForIdle() - device.scrollRecyclerViewTo("Twenty-one") - device.waitForIdle() - device.scrollRecyclerViewTo("One") - device.waitForIdle() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/OrientationChangeTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/OrientationChangeTest.kt deleted file mode 100644 index 8d5b5eb8aa..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/OrientationChangeTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.maplayout.SimpleMapActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -@RunWith(AndroidJUnit4::class) -class OrientationChangeTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<SimpleMapActivity> = ActivityTestRule(SimpleMapActivity::class.java) - - @Test - @LargeTest - fun rotateSimpleMap() { - device.setOrientationLeft() - device.waitForIdle() - device.setOrientationNatural() - device.waitForIdle() - device.setOrientationRight() - device.waitForIdle() - device.setOrientationNatural() - device.setOrientationLeft() - device.setOrientationNatural() - device.setOrientationRight() - device.setOrientationNatural() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/QueryRenderedFeaturesBoxCountTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/QueryRenderedFeaturesBoxCountTest.kt deleted file mode 100644 index e94d568e86..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/QueryRenderedFeaturesBoxCountTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.feature.QueryRenderedFeaturesBoxCountActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates reopening an Activity and querying the map before surface recreation #14394 - */ -@RunWith(AndroidJUnit4::class) -class QueryRenderedFeaturesBoxCountTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<QueryRenderedFeaturesBoxCountActivity> = - ActivityTestRule(QueryRenderedFeaturesBoxCountActivity::class.java) - - @Test - @LargeTest - fun reopenQueryRendererFeaturesActivity() { - device.waitForIdle() - device.pressHome() - device.waitForIdle() - device.launchActivity(activityRule.activity, QueryRenderedFeaturesBoxCountActivity::class.java) - device.waitForIdle() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReopenTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReopenTest.kt deleted file mode 100644 index cbfd5d6d55..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReopenTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.textureview.TextureViewDebugModeActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates reopening an Activity with a TextureView - */ -@RunWith(AndroidJUnit4::class) -class TextureViewReopenTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<TextureViewDebugModeActivity> = ActivityTestRule(TextureViewDebugModeActivity::class.java) - - @Test - @LargeTest - fun reopenTextureViewDebugActivity() { - device.waitForIdle() - device.pressHome() - device.waitForIdle() - device.launchActivity(activityRule.activity, TextureViewDebugModeActivity::class.java) - device.waitForIdle() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReuseTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReuseTest.kt deleted file mode 100644 index dc2f74df4a..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/TextureViewReuseTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import com.mapbox.mapboxsdk.testapp.activity.maplayout.TextureRecyclerViewActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates if a GLSurfaceView surface can be recreated without crashing. - */ -@RunWith(AndroidJUnit4::class) -class TextureViewReuseTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<TextureRecyclerViewActivity> = ActivityTestRule(TextureRecyclerViewActivity::class.java) - - @Test - @LargeTest - fun scrollRecyclerView() { - device.waitForIdle() - device.scrollRecyclerViewTo("Twenty-one") - device.waitForIdle() - device.scrollRecyclerViewTo("One") - device.waitForIdle() - } -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/ViewPagerScrollTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/ViewPagerScrollTest.kt deleted file mode 100644 index 5178ea9fc0..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/integration/ViewPagerScrollTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -package com.mapbox.mapboxsdk.integration - -import android.support.test.filters.LargeTest -import android.support.test.rule.ActivityTestRule -import android.support.test.runner.AndroidJUnit4 -import android.support.test.uiautomator.UiSelector -import com.mapbox.mapboxsdk.testapp.activity.fragment.ViewPagerActivity -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Regression test that validates MapFragment integration with a ViewPager - */ -@RunWith(AndroidJUnit4::class) -class ViewPagerScrollTest : BaseIntegrationTest() { - - @get:Rule - var activityRule: ActivityTestRule<ViewPagerActivity> = ActivityTestRule(ViewPagerActivity::class.java) - - @Test - @LargeTest - fun scrollViewPager() { - for (i in 1..4) { - clickTab(i) - } - - for (i in 3 downTo 0) { - clickTab(i) - } - } - - private fun clickTab(index: Int) { - device.findObject(UiSelector().text("Page $index")).click() - } -}
\ No newline at end of file |