Skip to content
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue10563.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -40,23 +41,23 @@ 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");

// Test Top SwipeItems
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");

// Test Bottom SwipeItems
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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Loading