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 - 5 #28269

Merged

Conversation

HarishKumarSF4517
Copy link
Contributor

@HarishKumarSF4517 HarishKumarSF4517 commented Mar 10, 2025

This pull request includes several updates to the test cases in the src/Controls/tests/TestCases.Shared.Tests/Tests/Issues directory. The changes focus on improving test reliability and handling platform-specific issues.

Improvements to test reliability:

  • BlankScreenOnNavigationBack.png - Also added Mac Snapshot for Issue28098.

TestCases

  • CarouselViewLoopNoFreeze
  • Issue20903
  • Issue27418

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 10, 2025
Copy link
Contributor

Hey there @HarishKumarSF4517! 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 the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 10, 2025
@HarishKumarSF4517 HarishKumarSF4517 marked this pull request as ready for review March 10, 2025 09:58
@Copilot Copilot bot review requested due to automatic review settings March 10, 2025 09:58
@HarishKumarSF4517 HarishKumarSF4517 requested a review from a team as a code owner March 10, 2025 09:58
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.

PR Overview

This PR improves the reliability of flaky UITests in CI by updating test interactions and timing for better platform-specific handling. Key changes include:

  • Updating CarouselViewUITests to use gesture-based scrolling and switching from App.Click to App.Tap.
  • Adding an extra WaitForElement in Issue20903 to ensure element readiness.
  • Replacing the conditional Catalyst directive with a Windows-specific Thread.Sleep to handle scrollbar visibility issues.

Reviewed Changes

File Description
Issue27418.cs Introduces a Windows-specific delay to avoid flaky scrollbar tests.
CarouselViewUITests.LoopNoFreeze.cs Modifies scroll interactions to use gesture-based scrolling and updates button interaction.
Issue20903.cs Adds a WaitForElement before a tap to improve test robustness.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27418.cs:19

  • [nitpick] Consider replacing Thread.Sleep with an explicit wait mechanism to verify the scrollbar has disappeared, which would improve test robustness on Windows.
Thread.Sleep(2000); // Wait for scrollbar to disappear to avoid flaky test failures in CI

@anandhan-rajagopal anandhan-rajagopal added the area-testing Unit tests, device tests label Mar 10, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can t we just hide the ScrollView bars? don t we have a API for that ?

@anandhan-rajagopal
Copy link
Contributor

Can t we just hide the ScrollView bars? don t we have a API for that ?

@rmarinho The horizontal scrollbar visibility is already set to 'never,' but it seems to be an issue on Windows. For more information, refer to this link: #7766.

@@ -18,8 +15,10 @@ public Issue27418(TestDevice device) : base(device) { }
public void CarouselItemsShouldRenderProperly()
{
App.WaitForElement("CarouselView");
#if WINDOWS
Thread.Sleep(2000); // Wait for scrollbar to disappear to avoid flaky test failures in CI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you review also the CarouselViewShouldRenderCorrectly test locally? Is failing in the latest build. Also, requires the same changes that this one Windows
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz I have addressed this issue, resolved it, and committed the changes. Please review them and share any concerns you may have. Thank you!

@jsuarezruiz
Copy link
Contributor

/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).

@PureWeen PureWeen dismissed rmarinho’s stale review March 11, 2025 14:02

WinUI ScrollView parameters are broken so this code will get cleaned up later.

@PureWeen
Copy link
Member

  • failing tests unrelated to tests modified here

@PureWeen PureWeen merged commit 4e92d0c into dotnet:main Mar 11, 2025
123 of 128 checks passed
rmarinho pushed a commit that referenced this pull request Mar 11, 2025
)

* Improve stability for flaky test case

* Updated Changes

* Fixed CarouselViewShouldRenderCorrectly and added mac images

* Update mac image

---------

Co-authored-by: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com>
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
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants