diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index 5baa7d2dbc..be49974574 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -214,9 +214,9 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { // Test that ensureWorkspaceIsScrollable adds a page by dragging an icon there. executeOnLauncher(launcher -> assertFalse("Initial workspace state is scrollable", isWorkspaceScrollable(launcher))); - workspace.verifyWorkspaceAppIconIsGone( - "Chrome app was found on empty workspace", "Chrome"); - + assertEquals("Initial workspace doesn't have the correct page", workspace.pagesPerScreen(), + workspace.getPageCount()); + workspace.verifyWorkspaceAppIconIsGone("Chrome app was found on empty workspace", "Chrome"); workspace.ensureWorkspaceIsScrollable(); executeOnLauncher( diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index efbdb2318f..5fab7ebfea 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -192,6 +192,12 @@ public final class Workspace extends Home { } } + /** Returns the number of pages. */ + public int getPageCount() { + final UiObject2 workspace = verifyActiveContainer(); + return workspace.getChildCount(); + } + /** * Returns the number of pages that are visible on the screen simultaneously. */