[Testing] Fix for flaky UITests in CI that occasionally fail#29360
Conversation
|
Hey there @@anandhan-rajagopal! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Pull Request Overview
This pull request aims to improve the stability and reliability of UI tests by adding explicit WaitForElement calls and refactoring platform-specific behavior for improved readability and maintainability.
- Added WaitForElement calls to ensure UI elements are present before actions are taken.
- Replaced preprocessor directives with runtime platform checks and renamed a conditional flag for clarity.
- Enhanced test reliability in tests across multiple issues.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs | Replaced preprocessor directives with runtime checks for platform-specific WaitForMoreButton call. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2597.cs | Added WaitForElement call to ensure the Stepper is visible before interaction. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla34632.cs | Introduced WaitForElement checks for modal buttons to improve test stability. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs | Added WaitForElement calls and updated the conditional compilation flag to TEST_FAILS_ON_IOS for better clarity. |
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue2809.cs:23
- Confirm that calling TapMoreButton outside the conditional runtime check is intentional for platforms where WaitForMoreButton is not supported. Consider adding a clarifying comment if needed.
App.TapMoreButton();
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla31333.cs:45
- [nitpick] Ensure that the conditional flag TEST_FAILS_ON_IOS is documented in the testing configuration to clarify its usage for future maintainers.
#if TEST_FAILS_ON_IOS //Once Editor text is entered the cursor move to second line when using App.EnterText method in appium which results retrived text is not as expected one.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
The failing tests seems not related with the changes.
Pass everything after a retry. |
…tnet#29360) * fix for flaky tests fails on candidate branch * fix some more flaky tests on android * Update Issue2809.cs * Update HelperExtensions.cs * Update Issue2809.cs
Description of Change
This pull request enhances test reliability by adding explicit
WaitForElementcalls to ensure UI elements are present before interacting with them. It also removes platform-specific restrictions for certain tests and refactors related utility methods.Enhancements to test reliability:
Bugzilla31333.cs: AddedApp.WaitForElementcalls in multiple test methods to ensure UI elements are present before interacting with them. This improves test stability for scenarios involvingListViewandTableViewcells. [1] [2] [3]Bugzilla34632.cs: AddedApp.WaitForElementcalls to ensure modal-related buttons (btnModalandbtnDismissModal) are ready before interaction. [1] [2]Issue2597.cs: AddedApp.WaitForElementfor theStepperelement to ensure it is visible before performing actions.Improvements to platform-specific behavior handling:
Issue2809.cs: Replaced preprocessor directives with runtime checks (AppiumAndroidAppandAppiumWindowsApp) to determine platform-specific behavior dynamically. This change improves code readability and maintainability.Updates to conditional compilation flags:
Bugzilla31333.cs: Renamed the conditional compilation flag from!IOStoTEST_FAILS_ON_IOSfor better clarity and alignment with its purpose.