You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Testing] Add Material3 test category and separate pipeline stage for android material3 UI tests (dotnet#33409)
This pull request adds support for running UI tests specifically
targeting Material3 components on Android. It introduces new pipeline
parameters and stages to enable Material3 builds and tests, updates
artifact publishing logic to handle Material3-specific outputs, and adds
a sample test case for a Material3 CheckBox. The changes ensure that
Material3 tests are built, executed, and their results published
separately from standard tests.
**Pipeline and Build Enhancements:**
* Added a new `useMaterial3` parameter to `ui-tests-build-sample.yml`
and updated the build script to enable Material3 builds for Android when
this parameter is set.
[[1]](diffhunk://#diff-5d0763fa79fb5e8f8d535acf38d8796d9450d36e0e320f41f99c38f686641840R14)
[[2]](diffhunk://#diff-5d0763fa79fb5e8f8d535acf38d8796d9450d36e0e320f41f99c38f686641840L58-R69)
* Modified artifact publishing logic in `ui-tests-build-sample.yml` to
handle Material3-specific build and failure artifacts, ensuring
separation from standard artifacts.
**Pipeline Stage and Test Execution Updates:**
* Added dedicated build and test stages for Material3 in `ui-tests.yml`,
including a new build stage (`build_ui_tests_material3`) for Android and
a new test stage (`android_ui_tests_material3`) that downloads and runs
Material3-specific tests.
[[1]](diffhunk://#diff-8f76930e2126f6e5f60cae836de1df54dd41263baac4d4baf04789be312b257aR119-R137)
[[2]](diffhunk://#diff-8f76930e2126f6e5f60cae836de1df54dd41263baac4d4baf04789be312b257aR228-R271)
* Updated comments and category handling to clarify that Material3 has
its own dedicated build and test stages.
**Test Infrastructure and Sample Test:**
* Added a new `Material3` test category to `UITestCategories.cs` for
organizing Material3-specific tests.
* Introduced a new sample XAML page (`IssueMaterial3CheckBox.xaml` and
code-behind) and a corresponding UI test
(`IssueMaterial3CheckBoxTest.cs`) to validate the default appearance of
a Material3 CheckBox on Android.
[[1]](diffhunk://#diff-dc0d79ae720ef99010bc997a04bb1fcf0deb3ee6655a2ce26deca504a9de3cb1R1-R22)
[[2]](diffhunk://#diff-9edaec9a356096db6815ea7942b3ffba9c4ffe149d9ad953a05502d8e4ff072aR1-R13)
[[3]](diffhunk://#diff-de155ddb12dcb2baa0d2f946517dfe0ad6fb19ff6832d0beadbff290421046bdR1-R25)
**Pipeline stage:**
<img width="668" height="121" alt="image"
src="https://github.com/user-attachments/assets/a222fcdf-5c4b-46eb-bcb5-f3c623a084df"
/>
<img width="553" height="258" alt="image"
src="https://github.com/user-attachments/assets/d5cb48ea-7cb0-4da0-99df-f24e085dc490"
/>
**Test execution result:**
<img width="910" height="463" alt="image"
src="https://github.com/user-attachments/assets/d5362e1a-b24d-4482-98d5-1730b1ee42ba"
/>
Assert.Fail($"Android visual tests should be run on an API30 emulator image with 1080x1920 420dpi screen or API36 emulator image with 1080x2424 420dpi screen, but the current device is API {deviceApiLevel} with a {deviceScreenSize}{deviceScreenDensity}dpi screen. Follow the steps on the MAUI UI testing wiki to launch the Android emulator with the right image.");
344
+
Assert.Fail($"Android visual tests should be run on an API30 emulator image with 1080x1920 420dpi screen or API36 emulator image with 1440x2960 560dpi screen, but the current device is API {deviceApiLevel} with a {deviceScreenSize}{deviceScreenDensity}dpi screen. Follow the steps on the MAUI UI testing wiki to launch the Android emulator with the right image.");
345
345
}
346
346
break;
347
347
@@ -412,7 +412,7 @@ but both can happen.
412
412
// bar at the top as it varies slightly based on OS theme and is also not part of the app.
0 commit comments