diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs index 6229790a9cbb..8aab56270196 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/CarouselViewUITests.RemoveAt.cs @@ -17,7 +17,9 @@ public CarouselViewRemoveAt(TestDevice device) [Category(UITestCategories.CarouselView)] public void Issue10300Test() { + App.WaitForElement("AddMe"); App.Click("AddMe"); + App.WaitForElement("DeleteMe"); App.Click("DeleteMe"); App.WaitForElement("CloseMe"); App.Click("CloseMe"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs index 0b87e51b1fa9..572a63c41ea4 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue10608.cs @@ -27,7 +27,9 @@ public Issue10608(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.Shell)] public void ShellWithTopTabsFreezesWhenNavigatingFlyoutItems() { + App.WaitForElement(FlyoutItem6); App.Tap(FlyoutItem6); + App.WaitForElement("FlyoutItem0"); App.Tap("FlyoutItem0"); for (int i = 0; i < 5; i++) { diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs index c5d277c6e097..86bf6cd6e137 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs @@ -16,6 +16,9 @@ public Issue2809(TestDevice testDevice) : base(testDevice) [Category(UITestCategories.ToolbarItem)] public void TestPageDoesntCrash() { +#if ANDROID && WINDOWS // WaitForMoreButton is only supported on Android and Windows + App.WaitForMoreButton(); +#endif App.TapMoreButton(); App.Tap("Item 1"); } diff --git a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs index d8e72e9f864d..954e3c8dd2f0 100644 --- a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs +++ b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs @@ -2280,6 +2280,27 @@ public static void ToggleSecondaryToolbarItems(this IApp app) app.CommandExecutor.Execute("toggleSecondaryToolbarItems", ImmutableDictionary.Empty); } + /// + /// Waits for the "More" button in the app, with platform-specific logic for Android and Windows. + /// This method does not currently support iOS and macOS platforms, where the "More" button is not shown. + /// + /// Represents the main gateway to interact with an app. + public static void WaitForMoreButton(this IApp app) + { + if (app is AppiumAndroidApp) + { + app.WaitForElement(AppiumQuery.ByXPath("//android.widget.ImageView[@content-desc=\"More options\"]")); + } + else if (app is AppiumWindowsApp) + { + app.WaitForElement(AppiumQuery.ByAccessibilityId("MoreButton")); + } + else + { + throw new InvalidOperationException($"WaitForMoreButton is not supported on this platform."); + } + } + /// /// Taps the "More" button in the app, with platform-specific logic for Android and Windows. /// This method does not currently support iOS and macOS platforms, where the "More" button is not shown.