Skip to content

[Testing] Refactoring Feature Matrix UITest Cases for Entry Control#34632

Open
LogishaSelvarajSF4525 wants to merge 7 commits intodotnet:mainfrom
LogishaSelvarajSF4525:refactoring-entry-feature
Open

[Testing] Refactoring Feature Matrix UITest Cases for Entry Control#34632
LogishaSelvarajSF4525 wants to merge 7 commits intodotnet:mainfrom
LogishaSelvarajSF4525:refactoring-entry-feature

Conversation

@LogishaSelvarajSF4525
Copy link
Contributor

@LogishaSelvarajSF4525 LogishaSelvarajSF4525 commented Mar 25, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

This pull request updates the EntryControlPage and its code-behind to improve testability and maintainability of the Entry control's feature matrix. The main changes include adding new bindable properties, improving event handling, and simplifying the options navigation logic.

Enhancements to Entry control testability and UI:

  • Added bindings for WidthRequest, BackgroundColor, and Opacity to the Entry control in EntryControlPage.xaml to allow more comprehensive property testing.
  • Changed the AutomationId of the options button from "OptionsButton" to "Options" for consistency with test automation.
  • Added the TextChanged event handler (CursorPositionButton_Clicked) to the CursorPositionEntry control, enabling dynamic updates to cursor position via UI interaction.

Code simplification and maintainability:

  • Replaced manual property resets in NavigateToOptionsPage_Clicked with a call to the new _viewModel.Reset() method, making the reset logic more maintainable and centralized.
  • Minor cleanup in the code-behind by removing unnecessary whitespace.

Issue Identified:

@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34632

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34632"

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

Hey there @@LogishaSelvarajSF4525! 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 25, 2026
@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests area-controls-entry Entry labels Mar 25, 2026
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests

@sheiksyedm sheiksyedm marked this pull request as ready for review March 26, 2026 10:54
Copilot AI review requested due to automatic review settings March 26, 2026 10:54
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 refactors the Entry Feature Matrix page and options UI to be more testable and easier to reset between scenarios, while updating platform snapshot baselines to reflect the UI/test behavior changes.

Changes:

  • Add new bindable properties to the Entry feature matrix (WidthRequest, BackgroundColor, Opacity) and centralize state reset via EntryViewModel.Reset().
  • Simplify the options UI event handling (e.g., using AutomationId to select colors; new handlers for width/opacity/height inputs; updated font attributes handling).
  • Update WinUI/macOS/iOS snapshot images to match the updated UI/test baselines.

Reviewed changes

Copilot reviewed 6 out of 148 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryViewModel.cs Adds new properties (BackgroundColor/Opacity/WidthRequest) and a Reset() method to restore defaults for test runs.
src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryOptionsPage.xaml.cs Refactors option handlers (color selection by AutomationId, numeric input handlers, font-attributes checkbox aggregation).
src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryControlPage.xaml.cs Uses _viewModel.Reset() instead of re-instantiating the view model when navigating to options.
src/Controls/tests/TestCases.HostApp/FeatureMatrix/EntryControl/EntryControlPage.xaml Binds new properties to the Entry, updates Options AutomationId, and wires CursorPositionEntry TextChanged for better interactivity.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyClearButtonVisiblityWhenTextAlignedVertically.png Updated iOS snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyClearButtonVisiblityWhenTextAlignedHorizontally.png Updated iOS snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ClearButtonVisiblityButton_TextPresent.png Updated iOS snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ClearButtonVisiblityButton_TextEmpty.png Updated iOS snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/VerifyTextWhenAlingnedVertically.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/VerifyTextWhenAlingnedHorizontally.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/VerifyClearVisiblityButtonWhenTextColorChanged.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/VerifyClearButtonVisiblityWhenTextAlignedVertically.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/VerifyClearButtonVisiblityWhenTextAlignedHorizontally.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/ClearButtonVisiblityButton_TextPresent.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/ClearButtonVisiblityButton_TextEmpty.png Updated iOS 26 snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenAlignedVertically.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenAlignedHorizontally.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordWhenMaxLengthSetValue.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyClearVisibilityButtonWhenTextColorChanged.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyClearButtonVisibilityWhenTextAlignedVertically.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyClearButtonVisibilityWhenTextAlignedHorizontally.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyClearButtonVisibilityWhenIsPasswordTrueOrFalse.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/ClearButtonVisibilityButton_TextPresent.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/ClearButtonVisibilityButton_TextEmpty.png Updated WinUI snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyTextWhenAlignedVertically.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyTextWhenAlignedHorizontally.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyIsPasswordWhenMaxLengthSetValue.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyClearVisibilityButtonWhenTextColorChanged.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyClearButtonVisibilityWhenTextAlignedHorizontally.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyClearButtonVisibilityWhenIsPasswordTrueOrFalse.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/ClearButtonVisibilityButton_TextPresent.png Updated macOS snapshot baseline.
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/ClearButtonVisibilityButton_TextEmpty.png Updated macOS snapshot baseline.

Comment on lines +299 to 305
private void HeightRequestEntry_TextChanged(object sender, TextChangedEventArgs e)
{
if (double.TryParse(e.NewTextValue, out double heightRequest))
{
_viewModel.FontAttributes = FontAttributes.Italic;
_viewModel.HeightRequest = heightRequest;
}
}
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

HeightRequestEntry_TextChanged sets HeightRequest directly from user input without validating range. Given HeightRequest uses “-1 = unset, otherwise non-negative”, consider coercing values < 0 to -1 (or ignoring them) to avoid applying invalid heights via the options UI.

Copilot uses AI. Check for mistakes.
Comment on lines 89 to 93
<local:UITestEntry x:Name="CursorPositionEntry"
Text="{Binding CursorPosition}"
AutomationId="CursorPositionEntry"
TextChanged="CursorPositionButton_Clicked"
IsCursorVisible="False"
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

CursorPositionEntry is wired to TextChanged but the handler is named CursorPositionButton_Clicked (and takes EventArgs). Renaming the handler (and parameter type) to reflect it’s a TextChanged handler would make the intent clearer and reduce confusion when navigating the code.

Copilot uses AI. Check for mistakes.
Comment on lines +282 to +288
private void WidthRequestEntry_TextChanged(object sender, TextChangedEventArgs e)
{
if (sender == FontAttributesBold)
if (double.TryParse(e.NewTextValue, out double widthRequest))
{
_viewModel.FontAttributes = FontAttributes.Bold;
_viewModel.WidthRequest = widthRequest;
}
else if (sender == FontAttributesNone)
}
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

WidthRequestEntry_TextChanged currently accepts any parsed double (including negative values other than -1). Since WidthRequest semantics are “-1 = unset, otherwise non-negative”, consider coercing values < 0 to -1 (or ignoring them) so invalid widths can’t be applied via the options UI.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-entry Entry 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.

5 participants