diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Bottom_SwipeItems.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Bottom_SwipeItems.png index 86039d856077..ecfb611f6614 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Bottom_SwipeItems.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Bottom_SwipeItems.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Left_SwipeItems.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Left_SwipeItems.png index 6312a9859b3c..4f3d6cf24f97 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Left_SwipeItems.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Left_SwipeItems.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Right_SwipeItems.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Right_SwipeItems.png index 2a5277de4d96..d14a3ecd8f54 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Right_SwipeItems.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Right_SwipeItems.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Top_SwipeItems.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Top_SwipeItems.png index a26031442af9..16c0413cf8c2 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Top_SwipeItems.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Top_SwipeItems.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue10563.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue10563.cs index cc67c772933b..bc5fec6f419e 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue10563.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue10563.cs @@ -24,34 +24,42 @@ protected override void Init() Margin = new Thickness(12) }; + // Use flat Background to disable ripple/animation artifacts in screenshots + var buttonBackground = new SolidColorBrush(Colors.LightGray); + var openLeftButton = new Button { AutomationId = OpenLeftId, - Text = "Open Left SwipeItem" + Text = "Open Left SwipeItem", + Background = buttonBackground }; var openRightButton = new Button { AutomationId = OpenRightId, - Text = "Open Right SwipeItem" + Text = "Open Right SwipeItem", + Background = buttonBackground }; var openTopButton = new Button { AutomationId = OpenTopId, - Text = "Open Top SwipeItem" + Text = "Open Top SwipeItem", + Background = buttonBackground }; var openBottomButton = new Button { AutomationId = OpenBottomId, - Text = "Open Bottom SwipeItem" + Text = "Open Bottom SwipeItem", + Background = buttonBackground }; var closeButton = new Button { AutomationId = CloseId, - Text = "Close SwipeView" + Text = "Close SwipeView", + Background = buttonBackground }; swipeLayout.Children.Add(openLeftButton); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs index e9e8840cc02a..ddc61d2bd588 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10563.cs @@ -31,7 +31,8 @@ public void Issue10563OpenSwipeViewTest() App.Tap(OpenLeftId); // Wait for swipe animation to complete - the SwipeItem text becomes visible App.WaitForElement("Issue 10563"); - VerifyScreenshotOrSetException(ref exception, "Left_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); + // SwipeView animations can have timing variance - use retryTimeout + VerifyScreenshotOrSetException(ref exception, "Left_SwipeItems", retryTimeout: TimeSpan.FromSeconds(3)); App.Tap(CloseId); // Wait for close animation to complete - the SwipeItem text disappears App.WaitForNoElement("Issue 10563"); @@ -40,7 +41,7 @@ public void Issue10563OpenSwipeViewTest() App.WaitForElement(OpenRightId); App.Tap(OpenRightId); App.WaitForElement("Issue 10563"); - VerifyScreenshotOrSetException(ref exception, "Right_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); + VerifyScreenshotOrSetException(ref exception, "Right_SwipeItems", retryTimeout: TimeSpan.FromSeconds(3)); App.Tap(CloseId); App.WaitForNoElement("Issue 10563"); @@ -48,7 +49,7 @@ public void Issue10563OpenSwipeViewTest() App.WaitForElement(OpenTopId); App.Tap(OpenTopId); App.WaitForElement("Issue 10563"); - VerifyScreenshotOrSetException(ref exception, "Top_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); + VerifyScreenshotOrSetException(ref exception, "Top_SwipeItems", retryTimeout: TimeSpan.FromSeconds(3)); App.Tap(CloseId); App.WaitForNoElement("Issue 10563"); @@ -56,7 +57,7 @@ public void Issue10563OpenSwipeViewTest() App.WaitForElement(OpenBottomId); App.Tap(OpenBottomId); App.WaitForElement("Issue 10563"); - VerifyScreenshotOrSetException(ref exception, "Bottom_SwipeItems", retryTimeout: TimeSpan.FromSeconds(2)); + VerifyScreenshotOrSetException(ref exception, "Bottom_SwipeItems", retryTimeout: TimeSpan.FromSeconds(3)); App.Tap(CloseId); App.WaitForNoElement("Issue 10563"); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs index dd8f14f21712..40948cc17760 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18857.cs @@ -24,10 +24,10 @@ public async Task GradientImageButtonBackground() App.WaitForElement("TestImageButton"); - await Task.Yield(); // Wait for Ripple Effect animation to complete. + await Task.Yield(); // Ensure UI thread completes pending work - Thread.Sleep(1000); - VerifyScreenshot(retryDelay: TimeSpan.FromSeconds(2)); + // Use retryTimeout to wait for ripple animation to complete + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24856.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24856.cs index fcabf4a33db3..3646213be4cb 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24856.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24856.cs @@ -20,8 +20,8 @@ public void ImageButtonAspectFitWorks() App.WaitForElement("WaitForStubControl"); App.Tap("UpdateAspect"); - Thread.Sleep(1000); - VerifyScreenshot(retryDelay: TimeSpan.FromSeconds(2)); + // Use retryTimeout to wait for aspect change to render + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs index 8a6cd4dc2d57..77116e45281b 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25192.cs @@ -17,8 +17,8 @@ public Issue25192(TestDevice testDevice) : base(testDevice) public void CarouselViewShouldRenderCorrectly() { App.WaitForElement("Item1"); - Thread.Sleep(1000); // Wait for carouselView items loading - VerifyScreenshot(); + // Use retryTimeout to wait for CarouselView items to fully load and render + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27418.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27418.cs index 2fe92b733815..e3d4970508aa 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27418.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27418.cs @@ -15,10 +15,8 @@ public Issue27418(TestDevice device) : base(device) { } public void CarouselItemsShouldRenderProperly() { App.WaitForElement("CarouselView"); -#if WINDOWS - Thread.Sleep(2000); // Wait for scrollbar to disappear to avoid flaky test failures in CI -#endif - VerifyScreenshot(); + // Use retryTimeout to wait for scrollbar to disappear on Windows + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28657.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28657.cs index 96d1b3fee2cd..ac671536d50e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28657.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28657.cs @@ -18,11 +18,10 @@ public void CellLayoutUpdatesCorrectlyAfterDeviceOrientationChanges() { App.WaitForElement("StubLabel"); App.SetOrientationLandscape(); - Thread.Sleep(400); - VerifyScreenshot("Issue28657_Landscape"); + // Use retryTimeout to wait for orientation change to complete + VerifyScreenshot("Issue28657_Landscape", retryTimeout: TimeSpan.FromSeconds(2)); App.SetOrientationPortrait(); - Thread.Sleep(400); - VerifyScreenshot("Issue28657_Portrait"); + VerifyScreenshot("Issue28657_Portrait", retryTimeout: TimeSpan.FromSeconds(2)); } } #endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30575.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30575.cs index f1bbf2c00220..1dfae5f4a78f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30575.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30575.cs @@ -15,7 +15,7 @@ public Issue30575(TestDevice device) : base(device) { } public void WebViewShouldNotMirrored() { App.WaitForElement("WebViewLabel"); - Thread.Sleep(3000); - VerifyScreenshot(); + // Use retryTimeout to wait for WebView content to fully load + VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(3)); } } \ No newline at end of file