Update TaplOpenCloseAllApps click position to dismiss All Apps
After enabling responsive grid all apps container for tablet got wider. The previous calculation to click outside the All Apps container for this test no longer works.
This CL updates the click position to click after the All Apps scrollbar position. Also it changes the click to be right next to the container and not halfway to the edge. The calculation to get the position halfway to the edge was leading to a invalid click position where the click was happening inside the 24dp limit of the edge, and it was not dismissing the AllApps container.
Fix: 315076033
Fix: 315084703
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: TaplOpenCloseAllApps
Test: TaplTestsTaskbar
Change-Id: I38bcdb4e0d4c27f35a16fa04411c65627bc88b11
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index 7d25121..0e78565 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -54,6 +54,7 @@
private static final int MAX_SCROLL_ATTEMPTS = 40;
private static final String BOTTOM_SHEET_RES_ID = "bottom_sheet_background";
+ private static final String FAST_SCROLLER_RES_ID = "fast_scroller";
private static final Pattern EVENT_ALT_ESC_DOWN = Pattern.compile(
"Key event: KeyEvent.*?action=ACTION_DOWN.*?keyCode=KEYCODE_ESCAPE.*?metaState=0");
@@ -369,9 +370,12 @@
LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"want to tap outside AllApps bottom sheet on the "
+ (tapRight ? "right" : "left"))) {
- final UiObject2 allAppsBottomSheet =
+
+ final UiObject2 container = (tapRight)
+ ? mLauncher.waitForLauncherObject(FAST_SCROLLER_RES_ID) :
mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID);
- mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight);
+
+ mLauncher.touchOutsideContainer(container, tapRight, false);
try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer(
"tapped outside AllApps bottom sheet")) {
verifyVisibleContainerOnDismiss();