From 20a9f45281eec3114a02d129df8846b3d30d66f4 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 22 Aug 2022 13:46:11 -0400 Subject: [PATCH] Add ScreenRecord for flaky tests Bug: 242163245 Bug: 242163855 Bug: 242163822 Bug: 206481237 Test: presubmit Change-Id: Id1e58c70802107f5b964c1f67bff4ef3a7e5de70 --- tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java | 1 + tests/src/com/android/launcher3/ui/WorkProfileTest.java | 3 +++ .../com/android/launcher3/ui/widget/AddConfigWidgetTest.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index c3839977cb..f46d78ff97 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -527,6 +527,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { } @Test + @ScreenRecord // b/242163245 public void getIconsPosition_afterIconRemoved_notContained() throws IOException { Point[] gridPositions = getCornersAndCenterPositions(); createShortcutIfNotExist(STORE_APP_NAME, gridPositions[0]); diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/ui/WorkProfileTest.java index a7a17b10fb..d4810d850c 100644 --- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java +++ b/tests/src/com/android/launcher3/ui/WorkProfileTest.java @@ -34,6 +34,7 @@ import com.android.launcher3.allapps.WorkEduCard; import com.android.launcher3.allapps.WorkPausedCard; import com.android.launcher3.allapps.WorkProfileManager; import com.android.launcher3.tapl.LauncherInstrumentation; +import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import org.junit.After; import org.junit.Before; @@ -98,6 +99,7 @@ public class WorkProfileTest extends AbstractLauncherUiTest { } @Test + @ScreenRecord // b/242163855 public void workTabExists() { waitForLauncherCondition("Personal tab is missing", launcher -> launcher.getAppsView().isPersonalTabVisible(), @@ -108,6 +110,7 @@ public class WorkProfileTest extends AbstractLauncherUiTest { } @Test + @ScreenRecord // b/242163822 public void toggleWorks() { waitForWorkTabSetup(); diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java index 2c9785c93d..655a77e112 100644 --- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +++ b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java @@ -33,6 +33,7 @@ import com.android.launcher3.tapl.Widgets; import com.android.launcher3.testcomponent.WidgetConfigActivity; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.TestViewHelpers; +import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; @@ -72,6 +73,7 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { @Test @PortraitLandscape + @ScreenRecord // b/206481237 public void testConfigCancelled() throws Throwable { runTest(false); }