Skip to content

Commit a373335

Browse files
changes updated (#31625)
1 parent 15f857d commit a373335

File tree

1 file changed

+18
-7
lines changed
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues

1 file changed

+18
-7
lines changed

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,24 @@ public void PullToRefreshWorksWhenEnabled()
119119
{
120120
// Find the scroll view content to perform pull gesture on
121121
App.WaitForElement(ScrollViewContent);
122-
123-
// Perform pull-to-refresh
124-
App.ScrollUp(ScrollViewContent);
125-
App.WaitForTextToBePresentInElement(StatusLabel, "Refreshing...", timeout: TimeSpan.FromSeconds(5));
126-
127-
// Wait for refresh to complete and verify it worked
128-
Assert.That(App.WaitForTextToBePresentInElement(StatusLabel, "Refresh completed", timeout: TimeSpan.FromSeconds(5)), Is.True);
122+
bool refreshSucceeded = false;
123+
for (int i = 0; i < 3 && !refreshSucceeded; i++)
124+
{
125+
// Perform pull-to-refresh
126+
App.ScrollUp(ScrollViewContent, ScrollStrategy.Gesture, swipePercentage: 0.90, swipeSpeed: 1000);
127+
try
128+
{
129+
// Wait for refresh to complete and verify it worked
130+
App.WaitForTextToBePresentInElement(StatusLabel, "Refreshing...", timeout: TimeSpan.FromSeconds(5));
131+
refreshSucceeded = App.WaitForTextToBePresentInElement(StatusLabel, "Refresh completed", timeout: TimeSpan.FromSeconds(5));
132+
}
133+
134+
catch (Exception)
135+
{
136+
// Refresh not completed yet, will retry
137+
}
138+
}
139+
Assert.That(refreshSucceeded, Is.True, "Pull-to-refresh did not complete after multiple attempts");
129140
}
130141

131142
[Test]

0 commit comments

Comments
 (0)