[Testing] Fix for flaky UITests in CI - 5#33259
Conversation
|
Hey there @@TamilarasanSF4853! 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 fix flaky UI tests for the Shadow feature by making two key changes: removing the numeric keyboard specification from Entry fields in the test UI page, and adding a ClearText call before entering color values in the test logic.
Key Changes:
- Removal of
Keyboard="Numeric"from 4 Entry fields (OffsetX, OffsetY, Radius, Opacity) - Addition of
App.ClearText("ColorEntry")before text entry inShadow_SetColortest - Updated iOS snapshot image for the
Shadow_SetVisibilityToFalsetest
Reviewed changes
Copilot reviewed 2 out of 15 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
ShadowFeaturePage.xaml |
Removed Keyboard="Numeric" from 4 Entry fields that accept numeric shadow property values |
ShadowFeatureTests.cs |
Added ClearText("ColorEntry") call before entering text to ensure clean test state |
Shadow_SetVisibilityToFalse_VerifyScreenshot.png |
New snapshot image added for iOS test baseline |
| <controls:UITestEntry x:Name="OffsetXEntry" AutomationId="OffsetXEntry" IsCursorVisible="False" Text="{Binding OffsetX}" TextChanged="OnOffsetXChanged" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Offset X" /> | ||
| <Label AutomationId="OffsetYValue" Text="{Binding OffsetY, StringFormat='OffsetY: {0}'}" FontSize="15" /> | ||
| <controls:UITestEntry x:Name="OffsetYEntry" AutomationId="OffsetYEntry" IsCursorVisible="False" Text="{Binding OffsetY}" TextChanged="OnOffsetYChanged" Keyboard="Numeric" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Offset Y" /> | ||
| <controls:UITestEntry x:Name="OffsetYEntry" AutomationId="OffsetYEntry" IsCursorVisible="False" Text="{Binding OffsetY}" TextChanged="OnOffsetYChanged" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Offset Y" /> | ||
| <Label AutomationId="RadiusValue" Text="{Binding Radius, StringFormat='Radius: {0}'}" FontSize="15" /> | ||
| <controls:UITestEntry x:Name="RadiusEntry" AutomationId="RadiusEntry" IsCursorVisible="False" Text="{Binding Radius}" TextChanged="OnRadiusChanged" Keyboard="Numeric" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Radius" /> | ||
| <controls:UITestEntry x:Name="RadiusEntry" AutomationId="RadiusEntry" IsCursorVisible="False" Text="{Binding Radius}" TextChanged="OnRadiusChanged" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Radius" /> | ||
| <Label AutomationId="OpacityValue" Text="{Binding Opacity, StringFormat='Opacity: {0}'}" FontSize="15" /> | ||
| <controls:UITestEntry x:Name="OpacityEntry" AutomationId="OpacityEntry" IsCursorVisible="False" Text="{Binding Opacity}" TextChanged="OnOpacityChanged" Keyboard="Numeric" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Opacity" /> | ||
| <controls:UITestEntry x:Name="OpacityEntry" AutomationId="OpacityEntry" IsCursorVisible="False" Text="{Binding Opacity}" TextChanged="OnOpacityChanged" HorizontalOptions="Start" WidthRequest="100" Placeholder="Shadow Opacity" /> |
There was a problem hiding this comment.
Removing the numeric keyboard from these Entry fields may reduce usability for end users. These fields expect numeric values (OffsetX, OffsetY, Radius, Opacity), so the numeric keyboard provides a better user experience by showing only numeric keys.
If the numeric keyboard is causing UI test flakiness, consider investigating why that's happening rather than removing it. The flakiness could be due to:
- Appium/UI test framework issues with specific keyboard types
- Timing issues with keyboard animations
- Platform-specific keyboard behavior
If removing the numeric keyboard is the intended fix for test stability, please document this decision in the PR description explaining why this approach was chosen over addressing the root cause of the flakiness.
@PureWeen I have added the pending snapshots in the latest commit. |
This pull request makes minor adjustments to the shadow feature test UI and test logic. The main change is the removal of the numeric keyboard from several entry fields in the shadow feature test page, and a small improvement to the shadow color test to clear the color entry before entering a new value. UI adjustments in shadow feature page: * Removed the `Keyboard="Numeric"` property from the `OffsetXEntry`, `OffsetYEntry`, `RadiusEntry`, and `OpacityEntry` input fields in `ShadowFeaturePage.xaml`, so these fields will now use the default keyboard instead of the numeric keyboard. Test improvements: * Updated the `Shadow_SetColor` test to clear the `ColorEntry` field before entering a new color value, ensuring the test input is not affected by any previous value.
This pull request makes minor adjustments to the shadow feature test UI and test logic. The main change is the removal of the numeric keyboard from several entry fields in the shadow feature test page, and a small improvement to the shadow color test to clear the color entry before entering a new value.
UI adjustments in shadow feature page:
Keyboard="Numeric"property from theOffsetXEntry,OffsetYEntry,RadiusEntry, andOpacityEntryinput fields inShadowFeaturePage.xaml, so these fields will now use the default keyboard instead of the numeric keyboard.Test improvements:
Shadow_SetColortest to clear theColorEntryfield before entering a new color value, ensuring the test input is not affected by any previous value.