Swipe from all apps from overview starts on an icon
In some configs, Overview has prediction row, in others hotseat. So
swiping from an icon in either.
Change-Id: I98db3df4f612fcd9d5b7057835c49ca58313210f
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index db447ee..ec62188 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -532,6 +532,14 @@
}
@NonNull
+ UiObject2 waitForLauncherObjectByClass(String clazz) {
+ final BySelector selector = getLauncherObjectSelectorByClass(clazz);
+ final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS);
+ assertNotNull("Can't find a launcher object; selector: " + selector, object);
+ return object;
+ }
+
+ @NonNull
UiObject2 waitForFallbackLauncherObject(String resName) {
final BySelector selector = getFallbackLauncherObjectSelector(resName);
final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS);
@@ -543,6 +551,10 @@
return By.res(getLauncherPackageName(), resName);
}
+ BySelector getLauncherObjectSelectorByClass(String clazz) {
+ return By.pkg(getLauncherPackageName()).clazz(clazz);
+ }
+
BySelector getFallbackLauncherObjectSelector(String resName) {
return By.res(getOverviewPackageName(), resName);
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Overview.java b/tests/tapl/com/android/launcher3/tapl/Overview.java
index 08d974c..ec99d26 100644
--- a/tests/tapl/com/android/launcher3/tapl/Overview.java
+++ b/tests/tapl/com/android/launcher3/tapl/Overview.java
@@ -49,11 +49,12 @@
"want to switch from overview to all apps")) {
verifyActiveContainer();
- // Swipe from the prediction row to the top.
+ // Swipe from an app icon to the top.
LauncherInstrumentation.log("Overview.switchToAllApps before swipe");
- final UiObject2 predictionRow = mLauncher.waitForLauncherObject("prediction_row");
+ final UiObject2 appIcon = mLauncher.waitForLauncherObjectByClass(
+ "android.widget.TextView");
mLauncher.swipeToState(mLauncher.getDevice().getDisplayWidth() / 2,
- predictionRow.getVisibleBounds().centerY(),
+ appIcon.getVisibleBounds().centerY(),
mLauncher.getDevice().getDisplayWidth() / 2,
0, 50, ALL_APPS_STATE_ORDINAL);