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

Commit 65972d5b authored by Jordan Silva's avatar Jordan Silva Committed by Android (Google) Code Review
Browse files

Merge "Update save app pair test to validate when icon chip menu is disabled" into main

parents 9462c3b6 a3eff1fe
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -117,18 +117,21 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest {
    }

    @Test
    public void testSaveAppPairMenuItemExistsOnSplitPair() throws Exception {
    public void testSaveAppPairMenuItemOrActionExistsOnSplitPair() {
        assumeTrue("App pairs feature is currently not enabled, no test needed",
                Flags.enableAppPairs());

        createAndLaunchASplitPair();

        Overview overview = mLauncher.goHome().switchToOverview();
        if (mLauncher.isGridOnlyOverviewEnabled() || !mLauncher.isTablet()) {
            assertTrue("Save app pair menu item is missing",
                mLauncher.goHome()
                        .switchToOverview()
                        .getCurrentTask()
                    overview.getCurrentTask()
                            .tapMenu()
                            .hasMenuItem("Save app pair"));
        } else {
            overview.getOverviewActions().assertHasAction("Save app pair");
        }
    }

    @Test
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.launcher3.tapl;

import androidx.annotation.NonNull;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;

/**
@@ -110,4 +111,12 @@ public class OverviewActions {
            }
        }
    }

    /** Asserts that an item matching the given string is present in the overview actions. */
    public void assertHasAction(String text) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                "want to check if the action [" + text + "] is present")) {
            mLauncher.waitForObjectInContainer(mOverviewActions, By.text(text));
        }
    }
}