[Testing] Fixed UI test image failure in PR 34617 - [30/03/2026] Candidate - 1#34670
[Testing] Fixed UI test image failure in PR 34617 - [30/03/2026] Candidate - 1#34670TamilarasanSF4853 wants to merge 2 commits intodotnet:inflight/candidatefrom
Conversation
c9ce54c to
c168910
Compare
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines successfully started running 2 pipeline(s). |
🚦 Gate — Test Verification |
🤖 AI Summary📊 Expand Full Review —
|
| File | Status |
|---|---|
android-notch-36/Material3CheckBox_Click_VerifyVisualState.png |
modified |
android-notch-36/Material3CheckBox_InitialState_VerifyVisualState.png |
modified |
android-notch-36/Material3CheckBox_ResetToDefaultColor_VerifyVisualState.png |
modified |
android-notch-36/Material3CheckBox_SetColorAndUncheck_VerifyVisualState.png |
modified |
android-notch-36/Material3CheckBox_SetColorBlue_VerifyVisualState.png |
modified |
android-notch-36/Material3CheckBox_SetColorGreen_VerifyVisualState.png |
modified |
android-notch-36/Material3Entry_InitialState_VerifyVisualState.png |
modified |
android-notch-36/Material3Entry_IsEnabled_VerifyVisualState.png |
modified |
android-notch-36/Material3Entry_PlaceholderColorAndTextColor_VerifyVisualState.png |
modified |
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #34670 | Replace snapshot baseline images (Android, iOS, Mac, Windows) | ❌ FAILED (Gate) | 109 PNG files | Android Material3 snapshots don't match CI output |
🔧 Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix (claude-opus-4.6) | Investigate snapshot infrastructure mismatch | 0 files | EstablishBrokenBaseline excludes PNG files; wrong emulator (API 36 needed, API 30 available) | |
| 2 | try-fix (claude-sonnet-4.6) | Increase VerifyScreenshot tolerance from 0.5% to 3.0% for Material3 tests | 2 test files | Cannot verify without API 36 emulator; also fundamentally wrong fix (weakens regression detection) | |
| 3 | try-fix (gpt-5.3-codex) | Code-level fix in HostApp CheckBoxControlPage (ignore CheckedChanged until Loaded) | ❌ FAIL | 1 file | Build failed with pre-existing compile errors (MauiMaterialTextInputLayout not found) |
| 4 | try-fix (gpt-5.4) | Fix compile error: replace MauiMaterialTextInputLayout in EntryHandler2.Android.cs with TextInputLayout | ❌ FAIL | 1 file | Fixed EntryHandler2 blocker but more pre-existing compile errors in SliderHandler2, SearchBarHandler2, DatePickerHandler2 |
| PR | PR #34670 | Replace snapshot baseline images (Android, iOS, Mac, Windows) | ❌ FAILED (Gate) | 109 PNG files | Android Material3 snapshots don't match CI output |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | Yes | Fix all pre-existing compile errors in inflight/candidate first (EntryHandler2, SliderHandler2, SearchBarHandler2, DatePickerHandler2), then re-run PR #34670 tests — addresses root blocker |
| claude-sonnet-4.6 | 2 | Yes | Extract snapshots from CI artifacts (ui-tests-collect-snapshot-diffs.yml pipeline) instead of rebuilding locally — bypasses local build requirement entirely |
Exhausted: Yes — no additional actionable code fixes proposed in Round 2; both new ideas require CI infrastructure or broader inflight/candidate fixes outside scope of this PR
Selected Fix: None viable — this PR cannot be fixed locally. The correct approach requires either: (1) fixing pre-existing compile errors in inflight/candidate (#34617), or (2) running on CI API 36 emulator and extracting correct baseline images from artifacts.
📋 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Snapshot-only PR (109 PNGs), targets inflight/candidate, Android gate focus |
| Gate | ❌ FAILED | android — Android Material3 snapshot images don't match CI output |
| Try-Fix | ✅ COMPLETE | 4 attempts, 0 passing; all BLOCKED or FAIL due to infrastructure constraints |
| Report | ✅ COMPLETE |
Summary
PR #34670 provides updated snapshot baseline images (109 PNGs) to address test failures from the inflight/candidate PR #34617. The gate failed on Android because the 9 Android Material3CheckBox/Material3Entry images submitted do not match what the CI's API 36 Android emulator actually renders. All 4 try-fix attempts were unable to produce a passing fix locally due to two compounding issues: (1) EstablishBrokenBaseline.ps1 explicitly excludes PNG files and snapshot paths, making it unable to manage snapshot PRs; and (2) the inflight/candidate branch has pre-existing compile errors in multiple Android Material3 Handler2 files (EntryHandler2, SliderHandler2, SearchBarHandler2, DatePickerHandler2) that prevent building the HostApp locally.
Root Cause
The Android snapshot images in this PR were captured from a different environment than the CI emulator. The CI uses an Android API 36 notch-36 emulator (1440×2960 resolution, 560dpi), while the images in this PR appear to have been captured on a different emulator configuration. The 9 Android PNGs show pixel-level differences from what the CI infrastructure renders for Material3CheckBox and Material3Entry controls, causing snapshot comparison failures.
Additionally, the inflight/candidate branch itself has pre-existing build failures in Android Material3 Handler2 files (a MauiMaterialTextInputLayout type missing across EntryHandler2, SliderHandler2, SearchBarHandler2, DatePickerHandler2). This means any attempt to regenerate snapshots locally is blocked by build errors that are unrelated to this PR but are present in its base branch.
Fix Quality
The approach is correct in principle — updating snapshot baselines to match the current rendering output is the right way to fix snapshot test failures. However, the quality is insufficient because:
- Wrong capture environment: The Android images don't match what CI produces. Baseline images must be captured using the exact same emulator/device configuration that CI uses (API 36, notch-36 spec).
- Incomplete coverage: CI run showed failures across many test categories beyond Material3 (Border, BoxView, CollectionView, Shell, SearchBar, Slider — across Android, iOS, Mac, Windows). The PR only addresses a subset.
- Draft status appropriate: The PR is correctly marked as draft, indicating the author is aware it is incomplete.
Recommended Next Steps for Author
- Fix the base branch first: The inflight/candidate branch has compile errors in Android Material3 Handler2 files. These must be resolved before snapshot regeneration is possible.
- Use CI to generate baselines: Once the branch builds cleanly, trigger the CI pipeline and use the snapshot diff artifacts (via
ui-tests-collect-snapshot-diffs.yml) to extract correct baseline images rather than capturing locally. - Cover all failing tests: The CI run showed failures on many more tests than just Material3. All failing snapshot comparisons need updated baselines.
- Match CI emulator spec exactly: Android baselines must be captured on API 36,
notch-36(1440×2960, 560dpi).
I have addressed the UI test image failures in this PR (#34617) by adding base images and re-saving the necessary UI test images.