Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NafeelaNazhir
Copy link
Contributor

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 unnecessary async and await keywords, adding platform-specific handling to address CI flakiness, and updating conditional compilation directives.

TestCases

  • Issue19152
  • CarouselViewUITests
  • Issue24574
  • Issue25943
  • TimePickerUITest
  • Issue1614

Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Feb 19, 2025
@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests and removed community ✨ Community Contribution labels Feb 19, 2025
@NafeelaNazhir NafeelaNazhir changed the title Enabled flaky testcases 3 [Testing] Fix for flaky UITests in CI that occasionally fail - 3 Feb 19, 2025
@anandhan-rajagopal anandhan-rajagopal added the community ✨ Community Contribution label Feb 19, 2025
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review February 20, 2025 11:03
@Copilot Copilot bot review requested due to automatic review settings February 20, 2025 11:03
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner February 20, 2025 11:03
Copy link
Contributor

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -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.
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -20,6 +20,7 @@ public void DatePickerShouldDisplayProperSelectedDate()
App.WaitForElement("DatePicker");
App.Tap("DatePicker");
#if ANDROID
App.WaitForElement("OK");
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -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)
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -25,19 +24,18 @@ public override void TestSetup()

[Test]
[Category(UITestCategories.CarouselView)]
public async Task CarouselViewSetPosition()
public void CarouselViewSetPosition()
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -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
Copy link
Preview

Copilot AI Feb 20, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the enabled-flaky-testcases-3 branch from 16a66c2 to cda5bb0 Compare February 21, 2025 11:36
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants