diff options
Diffstat (limited to 'tests/tapl/com/android/launcher3/tapl/AllApps.java')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/AllApps.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 18a8f2755..d03035a87 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -20,8 +20,10 @@ import static com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel import android.graphics.Point; import android.graphics.Rect; +import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.test.uiautomator.By; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; @@ -42,6 +44,10 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { super(launcher); final UiObject2 allAppsContainer = verifyActiveContainer(); mHeight = allAppsContainer.getVisibleBounds().height(); + final UiObject2 appListRecycler = mLauncher.waitForObjectInContainer(allAppsContainer, + "apps_list_view"); + // Wait for the recycler to populate. + mLauncher.waitForObjectInContainer(appListRecycler, By.clazz(TextView.class)); } @Override @@ -115,7 +121,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { verifyActiveContainer(); } - final UiObject2 appIcon = mLauncher.getObjectInContainer(allAppsContainer, + final UiObject2 appIcon = mLauncher.getObjectInContainer(appListRecycler, appIconSelector); ensureIconVisible(appIcon, allAppsContainer, appListRecycler); return new AppIcon(mLauncher, appIcon); |