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

Commit a3eff1fe authored by Jordan Silva's avatar Jordan Silva
Browse files

Update save app pair test to validate when icon chip menu is disabled

This CL adds a validation in the test to check if save app pair action is available in the overview actions. Kept the validation to check if save app pair is available in the menu only for overview icon menu flag enabled.

Bug: 330515672
Flag: N/A
Test: TaplTestsSplitscreen
Change-Id: I3097180a24b430f2310d11ddec36e6d6cf4982fb
parent ffb90d85
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));
        }
    }
}