diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs index 58a018cec83e..9f61336868fd 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs @@ -119,13 +119,24 @@ public void PullToRefreshWorksWhenEnabled() { // Find the scroll view content to perform pull gesture on App.WaitForElement(ScrollViewContent); - - // Perform pull-to-refresh - App.ScrollUp(ScrollViewContent); - App.WaitForTextToBePresentInElement(StatusLabel, "Refreshing...", timeout: TimeSpan.FromSeconds(5)); - - // Wait for refresh to complete and verify it worked - Assert.That(App.WaitForTextToBePresentInElement(StatusLabel, "Refresh completed", timeout: TimeSpan.FromSeconds(5)), Is.True); + bool refreshSucceeded = false; + for (int i = 0; i < 3 && !refreshSucceeded; i++) + { + // Perform pull-to-refresh + App.ScrollUp(ScrollViewContent, ScrollStrategy.Gesture, swipePercentage: 0.90, swipeSpeed: 1000); + try + { + // Wait for refresh to complete and verify it worked + App.WaitForTextToBePresentInElement(StatusLabel, "Refreshing...", timeout: TimeSpan.FromSeconds(5)); + refreshSucceeded = App.WaitForTextToBePresentInElement(StatusLabel, "Refresh completed", timeout: TimeSpan.FromSeconds(5)); + } + + catch (Exception) + { + // Refresh not completed yet, will retry + } + } + Assert.That(refreshSucceeded, Is.True, "Pull-to-refresh did not complete after multiple attempts"); } [Test]