-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Testing] Fix for flaky UITests in CI that occasionally fail - 3 #27905
base: main
Are you sure you want to change the base?
[Testing] Fix for flaky UITests in CI that occasionally fail - 3 #27905
Conversation
Hey there @NafeelaNazhir! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19152.cs:22
- [nitpick] Consider replacing the fixed Thread.Sleep delay with a more robust wait method (e.g. waiting for the keyboard element) to reduce potential flakiness on slower devices.
Thread.Sleep(500); // Wait for the keyboard to appear
@@ -25,6 +25,19 @@ public void TapThenDoubleTap() | |||
App.WaitForElement("Single"); | |||
|
|||
App.DoubleTap("TapLabel"); | |||
|
|||
#if ANDROID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a log or comment inside the retry block to record when the first double tap attempt fails. This can help diagnose intermittent CI issues on Android.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -1,4 +1,5 @@ | |||
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS. | |||
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the inclusion of the TEST_FAILS_ON_ANDROID flag is documented either in the test case or related docs to clarify its purpose for addressing the cancel button display issue.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -20,6 +20,7 @@ public void DatePickerShouldDisplayProperSelectedDate() | |||
App.WaitForElement("DatePicker"); | |||
App.Tap("DatePicker"); | |||
#if ANDROID | |||
App.WaitForElement("OK"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm that waiting for the 'OK' element is sufficiently robust across various Android devices and consider specifying a timeout if unexpected delays could occur.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -10,8 +10,7 @@ public class CarouselViewUITests : UITest | |||
{ | |||
const string CarouselViewGallery = "CarouselView Gallery"; | |||
|
|||
public CarouselViewUITests(TestDevice device) | |||
: base(device) | |||
public CarouselViewUITests(TestDevice device): base(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure consistent formatting in constructor declarations to adhere to the project's coding style guidelines.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -25,19 +24,18 @@ public override void TestSetup() | |||
|
|||
[Test] | |||
[Category(UITestCategories.CarouselView)] | |||
public async Task CarouselViewSetPosition() | |||
public void CarouselViewSetPosition() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify that removing async/await and fixed delays does not result in race conditions; consider whether additional waiting for elements is needed to ensure test stability across environments.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -1,4 +1,5 @@ | |||
#if TEST_FAILS_ON_CATALYST // TimePicker not opens the dialog, issue: https://github.com/dotnet/maui/issues/10827 | |||
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // TimePicker not opens the dialog, issue: https://github.com/dotnet/maui/issues/10827 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the updated conditional directive for iOS accurately targets devices with inconsistent picker popup layouts and that associated documentation is updated to reflect this change.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
/rebase |
16a66c2
to
cda5bb0
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Description of Change
This pull request includes various changes to the test cases in the
src/Controls/tests/TestCases.Shared.Tests/Tests
directory, primarily focusing on improving test stability and addressing platform-specific issues. The most important changes include modifying test methods to remove unnecessaryasync
andawait
keywords, adding platform-specific handling to address CI flakiness, and updating conditional compilation directives.src/Controls/tests/TestCases.Shared.Tests/Tests/CarouselViewUITests.cs
: Removed unnecessaryasync
andawait
keywords from multiple test methods to simplify the code and potentially improve test stability. [1] [2] [3]src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24574.cs
: Added a retry mechanism for double-tap actions on Android to address CI flakiness.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25943.cs
: Added a wait for the "OK" button on Android to ensure the date picker dialog is fully loaded before interacting with it.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/TimePickerUITest.cs
: Updated the conditional compilation directive to include iOS due to inconsistent picker popup layout.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1614.cs
: Updated the conditional compilation directive to include Android due to an issue with the cancel button not displaying after orientation changes.src/Controls/tests/TestCases.HostApp/Issues/Issue19152.xaml
: Updated theEntry
control to use a customUITestEntry
control with additional properties.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19152.cs
: Added a sleep delay to ensure the keyboard appears before dismissing it on Android.TestCases