-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Feature Matrix UITest Cases for Switch Control #29950
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] Feature Matrix UITest Cases for Switch Control #29950
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.
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 introduces a comprehensive set of UI test cases and supporting UI pages for validating the Switch control’s behavior and appearance. Key changes include:
- New UI tests in SwitchFeatureTests to verify various Switch states (toggled, colors, enabled, visible, shadow, and flow direction).
- Addition of SwitchViewModel implementing property notifications for Switch behavior.
- Implementation of SwitchOptionsPage and SwitchControlMainPage for an interactive configuration of Switch properties.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
TestCases.Shared.Tests/Tests/FeatureMatrix/SwitchFeatureTests.cs | Introduces UI tests for multiple Switch scenarios |
TestCases.HostApp/FeatureMatrix/Switch/SwitchViewModel.cs | Implements the view model with property change notifications for the Switch control |
TestCases.HostApp/FeatureMatrix/Switch/SwitchOptionsPage.xaml(.cs) | Provides an options page for adjusting Switch properties interactively |
TestCases.HostApp/FeatureMatrix/Switch/SwitchControlPage.xaml(.cs) | Hosts the Switch control and integrates with the options page for state reinitialization |
TestCases.HostApp/CoreViews/CorePageView.cs | Adds a new gallery entry for accessing the Switch control pages |
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.HostApp/FeatureMatrix/Switch/SwitchOptionsPage.xaml.cs:37
- The AutomationId 'IsEnabledFalseCheckBox' paired with inverted logic in this event handler could be confusing. Consider renaming the checkbox (and similarly for the visible checkbox) to better reflect that checking it disables the control (e.g., 'DisableSwitchCheckBox').
if (e.Value)
src/Controls/tests/TestCases.HostApp/FeatureMatrix/Switch/SwitchControlPage.xaml.cs:26
- Reinitializing the view model in the NavigateToOptionsPage_Clicked event resets the current state; please confirm this behavior is intended for the interactive configuration flow.
BindingContext = _viewModel = new SwitchViewModel();
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jsuarezruiz I have added the pending snapshots in the latest commit. |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's a bug here based on the snapshot. The shadow appears to reflect the off state and doesn't update when the Switch state changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you verify? If is a bug, could you create a new bug and add the link to it in the test with a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz I have added the failing condition to the test case, created a bug issue, and included the bug link in the test case as a comment.
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
* added test cases * added new test cases * added new test cases * added android and iOS snapshots * modified test case and added snapshots * added failing condition
This PR includes a comprehensive set of UI test cases for the Switch control. The tests validate the Switch control, including properties such as IsToggled, OnColor, ThumbColor, IsEnabled, IsVisible, FlowDirection, and Shadow.
Switch Control Implementation:
Added SwitchControlMainPage to host the Switch control, with bindings for properties like IsToggled, OnColor, ThumbColor, IsEnabled, IsVisible, FlowDirection, and Shadow, and event handlers for the Toggled event.
Created SwitchOptionsPage to allow users to configure Switch properties interactively, including IsToggled, OnColor, ThumbColor, IsEnabled, IsVisible, FlowDirection, and Shadow.
Added event handlers for property changes in SwitchOptionsPage.xaml.cs to update the Switch control dynamically through a ViewModel pattern.
Implemented a suite of UI tests in SwitchFeatureTests to validate property updates, event handling (Toggled), disabled and visibility states, color configurations (OnColor, ThumbColor), flow direction, and shadow behavior. Used VerifyScreenshot() for visual verification across property configurations and platforms.
Screen.Recording.2025-06-12.at.11.31.26.AM.mov