Skip to content

Conversation

@NafeelaNazhir
Copy link
Contributor

This pull request improves the reliability of the pull-to-refresh test in Issue30690.cs by adding retry logic and more robust verification for the refresh completion. The main change is to ensure the test does not fail due to transient issues with the pull gesture or UI timing.

Test robustness improvements:

  • Added a retry loop to attempt the pull-to-refresh gesture up to three times, increasing the likelihood of a successful refresh in case of intermittent failures.
  • Enhanced the gesture by specifying ScrollStrategy.Gesture, a high swipe percentage, and a defined swipe speed for more consistent interaction.
  • Improved verification by waiting for both "Refreshing..." and "Refresh completed" statuses, and only passing the test if refresh succeeds within the retries.

@NafeelaNazhir NafeelaNazhir added the area-testing Unit tests, device tests label Sep 16, 2025
@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Sep 16, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review September 16, 2025 07:00
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner September 16, 2025 07:00
Copilot AI review requested due to automatic review settings September 16, 2025 07:00
Copy link
Contributor

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.

Pull Request Overview

This PR improves the reliability of a flaky UI test for pull-to-refresh functionality by adding retry logic and more precise gesture parameters. The test was failing intermittently in CI due to timing issues and unreliable gesture recognition.

Key Changes

  • Added retry loop with up to 3 attempts for pull-to-refresh gesture
  • Enhanced gesture parameters with specific scroll strategy, swipe percentage, and speed
  • Improved error handling with try-catch block around verification steps

Comment on lines +134 to +137
catch (Exception)
{
// Refresh not completed yet, will retry
}
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

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

Catching all exceptions with a generic Exception handler can mask important errors. Consider catching specific exceptions related to timeout or element not found scenarios, or at minimum log the exception details for debugging purposes.

Suggested change
catch (Exception)
{
// Refresh not completed yet, will retry
}
catch (WebDriverTimeoutException ex)
{
// Refresh not completed yet, will retry
TestContext.WriteLine($"Timeout waiting for refresh: {ex.Message}");
}
catch (NoSuchElementException ex)
{
// Element not found, will retry
TestContext.WriteLine($"Element not found during refresh: {ex.Message}");
}
catch (Exception ex)
{
// Unexpected exception, log details
TestContext.WriteLine($"Unexpected exception during refresh: {ex}");
}

Copilot uses AI. Check for mistakes.
@PureWeen PureWeen merged commit a373335 into dotnet:net10.0 Sep 16, 2025
98 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants