[android] fix naming for re-open tests

This commit is contained in:
Ivo van Dongen
2019-02-22 14:46:06 +02:00
committed by Ivo van Dongen
parent 4b8cff5b15
commit 7c874ab815
2 changed files with 12 additions and 12 deletions

View File

@@ -11,8 +11,6 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.lang.Thread.sleep
import android.support.test.uiautomator.UiSelector
import android.support.test.uiautomator.UiScrollable
private const val BASIC_SAMPLE_PACKAGE = "com.mapbox.mapboxsdk.testapp"
private const val LAUNCH_TIMEOUT = 5000L
@@ -50,21 +48,19 @@ class GLSurfaceViewReopenTest {
LAUNCH_TIMEOUT
)
// open TextureView debug activity
val appView = UiScrollable(UiSelector().scrollable(true))
appView.scrollIntoView(UiSelector().text("TextureView debug"))
device.findObject(UiSelector().text("TextureView debug")).clickAndWaitForNewWindow()
// open SimpleMapActivity
device.findObject(UiSelector().text("Simple Map")).clickAndWaitForNewWindow()
// wait for idle
device.waitForIdle(LAUNCH_TIMEOUT)
}
@Test
fun reopenTextureViewDebugActivity() {
fun reopenSimpleMapActivity() {
// return to home screen
device.pressHome()
// press recent apps button
// press recents apps button
device.pressRecentApps()
// click to reopen app

View File

@@ -11,6 +11,8 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import java.lang.Thread.sleep
import android.support.test.uiautomator.UiSelector
import android.support.test.uiautomator.UiScrollable
private const val BASIC_SAMPLE_PACKAGE = "com.mapbox.mapboxsdk.testapp"
private const val LAUNCH_TIMEOUT = 5000L
@@ -48,19 +50,21 @@ class TextureViewReopenTest {
LAUNCH_TIMEOUT
)
// open SimpleMapActivity
device.findObject(UiSelector().text("Simple Map")).clickAndWaitForNewWindow()
// open TextureView debug activity
val appView = UiScrollable(UiSelector().scrollable(true))
appView.scrollIntoView(UiSelector().text("TextureView debug"))
device.findObject(UiSelector().text("TextureView debug")).clickAndWaitForNewWindow()
// wait for idle
device.waitForIdle(LAUNCH_TIMEOUT)
}
@Test
fun reopenSimpleMapActivity() {
fun reopenTextureViewDebugActivity() {
// return to home screen
device.pressHome()
// press recents apps button
// press recent apps button
device.pressRecentApps()
// click to reopen app