Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a66a121b authored by helencheuk's avatar helencheuk Committed by Helen Cheuk
Browse files

Add test to long press icon on home screen

Fix: 292083404
Test: TaplTestsLauncher3#testLaunchHomeScreenMenuItem
Change-Id: I301ac719aeda744e8b8dca9a405208625eff89e7
parent d34fe6d6
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -391,6 +391,28 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
        }
    }

    @Test
    public void testLaunchHomeScreenMenuItem() {
        // Drag the test app icon to home screen and open short cut menu from the icon
        final HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
        allApps.freeze();
        try {
            allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
            final AppIconMenu menu = mLauncher.getWorkspace().getWorkspaceAppIcon(
                    APP_NAME).openDeepShortcutMenu();

            executeOnLauncher(
                    launcher -> assertTrue("Launcher internal state didn't switch to Showing Menu",
                            isOptionsPopupVisible(launcher)));

            final AppIconMenuItem menuItem = menu.getMenuItem(1);
            assertEquals("Wrong menu item", "Shortcut 2", menuItem.getText());
            menuItem.launch(getAppPackageName());
        } finally {
            allApps.unfreeze();
        }
    }

    @PlatinumTest(focusArea = "launcher")
    @Test
    @PortraitLandscape