Skip to content

Commit 2cc5a76

Browse files
fix for flaky tests (#28887)
1 parent c4c3ca5 commit 2cc5a76

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Diff for: src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ async void InitCV()
6464

6565
cv.ScrollTo(items.Count - 1);
6666

67-
//give the cv time to scroll
68-
var rand = new Random();
69-
await Task.Delay(rand.Next(10, 200));
67+
await Task.Delay(200);
7068

7169
await Navigation.PopAsync(false);
7270

Diff for: src/Controls/tests/TestCases.Shared.Tests/Tests/DragAndDropUITests.cs

+6
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ public void DropEventCoordinates()
360360
App.WaitForElement("Green");
361361
App.DragAndDrop("Blue", "Green");
362362

363+
// Wait for all UI elements to confirm drag and drop operation completion
364+
App.WaitForElement("DropRelativeLayout");
365+
App.WaitForElement("DropRelativeScreen");
366+
App.WaitForElement("DropRelativeLabel");
367+
App.WaitForElement("DragStartRelativeScreen");
368+
363369
var dropRelativeToLayout = GetCoordinatesFromLabel(App.FindElement("DropRelativeLayout").GetText());
364370
var dropRelativeToScreen = GetCoordinatesFromLabel(App.FindElement("DropRelativeScreen").GetText());
365371
var dropRelativeToLabel = GetCoordinatesFromLabel(App.FindElement("DropRelativeLabel").GetText());

Diff for: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public void Issue10222Test()
1818
{
1919
App.WaitForElement("goTo");
2020
App.Tap("goTo");
21-
App.WaitForElement("items1");
22-
App.WaitForElement("goTo");
21+
App.WaitForElement("items1", timeout: TimeSpan.FromSeconds(1));
22+
App.WaitForElement("goTo", timeout: TimeSpan.FromSeconds(2));
2323
}
2424
}
2525
#endif

0 commit comments

Comments
 (0)