-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] Migration of Compatibility.Core platform-specific unit tests into device tests - 4 #28105
[Testing] Migration of Compatibility.Core platform-specific unit tests into device tests - 4 #28105
Conversation
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.
PR Overview
This PR migrates several platform-specific unit tests for verifying the opacity consistency of various UI elements from Xamarin.Forms to .NET MAUI device tests. Key changes include:
- Addition of a GetPlatformOpacity method in each platform-specific test file (Android, iOS, Windows) for different controls.
- Introduction of new tests for BoxView, CheckBox, Button, Entry, Editor, and Image to validate that the native opacity matches the control’s Opacity property.
- Updates across multiple test files to ensure the migrated opacity verification cases run on device tests.
Reviewed Changes
File | Description |
---|---|
BoxViewTests.cs | Added VerifyBoxViewOpacityProperty test for BoxView. |
CheckBoxTests.cs | Added VerifyCheckBoxOpacityProperty test for CheckBox. |
ButtonTests.cs | Added VerifyButtonOpacityProperty test for Button. |
EntryTests.cs | Added VerifyEntryOpacityProperty test for Entry. |
EditorTests.cs | Added VerifyEditorOpacityProperty test for Editor. |
CheckBoxTests.iOS.cs | Added GetPlatformOpacity method for CheckBox on iOS. |
CheckBoxTests.Android.cs | Added GetPlatformOpacity method for CheckBox on Android. |
CheckBoxTests.Windows.cs | Added GetPlatformOpacity method for CheckBox on Windows. |
ButtonTests.Windows.cs | Added GetPlatformOpacity method for Button on Windows. |
EditorTests.Windows.cs | Added GetPlatformOpacity method for Editor on Windows. |
BoxViewTests.Windows.cs | Added GetPlatformOpacity method for BoxView on Windows. |
EntryTests.Windows.cs | Added GetPlatformOpacity method for Entry on Windows. |
BoxViewTests.Android.cs | Added GetPlatformOpacity method for BoxView on Android. |
ImageTests.Android.cs | Added GetPlatformOpacity and GetPlatformImage methods for Image on Android. |
ButtonTests.Android.cs | Added GetPlatformOpacity method for Button on Android. |
EditorTests.iOS.cs | Added GetPlatformOpacity method for Editor on iOS. |
EntryTests.iOS.cs | Added GetPlatformOpacity method for Entry on iOS. |
EntryTests.Android.cs | Added GetPlatformOpacity method for Entry on Android. |
EditorTests.Android.cs | Added GetPlatformOpacity method for Editor on Android. |
Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs:17
- The parameter name 'CheckBoxHandler' is capitalized; consider changing it to 'checkBoxHandler' for consistency with standard naming conventions.
Task<float> GetPlatformOpacity(CheckBoxHandler CheckBoxHandler)
src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 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.
The GetPlatformOpacity method is pending in the ButtonTests.iOS.cs
class.
/Users/builder/azdo/_work/1/s/src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.cs(87,36): error CS0103: The name 'GetPlatformOpacity' does not exist in the current context [/Users/builder/azdo/_work/1/s/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj::TargetFramework=net9.0-ios]
1 Error(s)
ab6dc65
to
9736ec8
Compare
@jsuarezruiz Resolved the mentioned issue and committed the changes, can you please review and trigger the CI again. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ac53409
to
63718ab
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
…s into device tests - 4 (dotnet#28105) * Enabled the Opacity property * code changes * code change * Enabled the Opacity property * code changes * code modifications * changes * Update src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ios changes * modified codes --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com> Co-authored-by: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s into device tests - 4 (#28105) * Enabled the Opacity property * code changes * code change * Enabled the Opacity property * code changes * code modifications * changes * Update src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ios changes * modified codes --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com> Co-authored-by: Anandhan Rajagopal <97146406+anandhan-rajagopal@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description of Change
Migration of Compatibility.Core platform-specific unit tests to device tests. Here the migrated cases which ensuring that the Opacity consistency of different elements matches their native counterparts. We are going to migrate tests in blocks in different PRs. This is the 4st group.
There are unit tests under:
That are not running right now. these cases from Xamarin.Forms where they could run as unit tests, but now with .NET MAUI this is not possible. So here I migrated the following cases in device tests.
This pull request introduces a series of changes across multiple test files to add functionality for verifying the opacity property of various UI elements. The most significant changes include the addition of methods to retrieve the platform-specific opacity values and new test cases to validate the opacity property consistency between the .NET MAUI controls and their native counterparts.
Additions for Opacity Verification:
src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.Android.cs
: AddedGetPlatformOpacity
method to retrieve the opacity value for BoxView on Android.src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.Windows.cs
: AddedGetPlatformOpacity
method to retrieve the opacity value for BoxView on Windows.src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.cs
: Added a new testVerifyBoxViewOpacityProperty
to check the opacity property of BoxView.Similar Additions for Other Elements:
src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.Android.cs
: AddedGetPlatformOpacity
method for Button on Android.src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.Windows.cs
: AddedGetPlatformOpacity
method for Button on Windows.src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.cs
: AddedVerifyButtonOpacityProperty
test for Button.src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs
: AddedGetPlatformOpacity
method for CheckBox on Android.src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Windows.cs
: AddedGetPlatformOpacity
method for CheckBox on Windows.src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.cs
: AddedVerifyCheckBoxOpacityProperty
test for CheckBox.src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Android.cs
: AddedGetPlatformOpacity
method for Editor on Android.src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Windows.cs
: AddedGetPlatformOpacity
method for Editor on Windows.src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.cs
: AddedVerifyEditorOpacityProperty
test for Editor.src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.Android.cs
: AddedGetPlatformOpacity
method for Entry on Android.src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.Windows.cs
: AddedGetPlatformOpacity
method for Entry on Windows.src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.cs
: AddedVerifyEntryOpacityProperty
test for Entry.src/Controls/tests/DeviceTests/Elements/Image/ImageTests.Android.cs
: AddedGetPlatformOpacity
method for Image on Android.Issues Fixed
Fixes #27303