summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt17
1 files changed, 8 insertions, 9 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt
index 98b251027f..708b633db4 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/GLSurfaceViewReopenTest.kt
@@ -2,15 +2,18 @@ package com.mapbox.mapboxsdk.maps
import android.content.Intent
import android.support.test.InstrumentationRegistry
+import android.support.test.InstrumentationRegistry.getTargetContext
import android.support.test.filters.SdkSuppress
import android.support.test.runner.AndroidJUnit4
-import android.support.test.uiautomator.*
+import android.support.test.uiautomator.By
+import android.support.test.uiautomator.UiDevice
+import android.support.test.uiautomator.UiSelector
+import android.support.test.uiautomator.Until
import org.hamcrest.CoreMatchers.notNullValue
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import java.lang.Thread.sleep
private const val BASIC_SAMPLE_PACKAGE = "com.mapbox.mapboxsdk.testapp"
private const val LAUNCH_TIMEOUT = 5000L
@@ -57,17 +60,13 @@ class GLSurfaceViewReopenTest {
@Test
fun reopenSimpleMapActivity() {
- // return to home screen
- device.pressHome()
-
- // press recents apps button
+ // press recent apps button to pause the app
device.pressRecentApps()
- // click to reopen app
- device.findObject(UiSelector().description("Mapbox Android SDK TestApp")).click()
+ // return to app
+ device.findObject(UiSelector().text(getTargetContext().getString(getTargetContext().applicationInfo.labelRes))).click()
// wait for idle
device.waitForIdle(LAUNCH_TIMEOUT)
- sleep(LAUNCH_TIMEOUT)
}
} \ No newline at end of file