Repository navigation
[Testing] Fixed Test case failure in PR 38782- Candidate - 2 - #39361
Conversation
|
Hey there @@NafeelaNazhir! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| }; | ||
|
|
||
| var collectionView = new CollectionView | ||
| var collectionView = new CollectionView2 |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Regression Prevention and Test Coverage — Switching this fixture to CollectionView2 is aligned with the iOS/Mac Catalyst Items2 path, but this PR also replaces three unrelated Android/iOS screenshot baselines without corresponding scenario changes or completed screenshot-run evidence. Accepting a new baseline can make a rendering regression the expected output; please split those updates or document and validate each changed scenario on its affected platform before merging.
… WindowInsetsAnimationCompat instance for the corresponding OnPrepare and OnEnd callbacks, ensuring consistent animation identity throughout each lifecycle and fixing the test failures.
|
/azp run maui-pr-uitests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run maui-pr-devicetests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 233efce.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@NafeelaNazhir — new AI review results are available based on commit
233efce.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ SKIPPED
No tests were detected in this PR.
Recommendation: Add tests to verify the fix using the write-tests-agent.
📋 Pre-Flight — Context & Validation
Pre-Flight Context
Scope: Evidence-only context for #39361, based on the immutable submitted diff and relevant repository source. This is not an exhaustive review, recommendation, or comparison of alternatives.
Reported problem
The PR title, description, author rationale, linked issues, base/head metadata, discussion, and reviews are unknown: the available read-only GitHub endpoints rejected the required repository headers.
Source-level evidence suggests several test concerns are bundled together:
Issue38730describes a groupedCollectionViewvertical-spacing rendering problem on “Mac 27.” Its on-page instructions expect no extra spacing on iOS or Mac Catalyst.Issue39155covers an iOS 27NavigationPage.TitleViewbecoming zero-height after navigation-bar replacement/navigation.Issue38443covers a selectedCollectionViewitem not entering its selected visual state during Shell navigation on iOS/Mac Catalyst.- Editor snapshots cover runtime horizontal alignment and explicit width/height rendering.
- Android window-inset tests cover the IME-animation gate associated in source comments with #37012.
Whether all these concerns are intentionally part of one PR, or some snapshot changes are incidental, remains unknown.
Submitted changes and mechanism
The immutable diff contains 10 files: two C# test files and eight binary screenshot baselines; no production file is changed.
| Area | Submitted change | Mechanism |
|---|---|---|
| Android IME inset device tests | MauiWindowInsetListenerTests.Android.cs now stores animation objects and passes the same instance to OnPrepare and OnEnd. Separate animations use separate instances. |
Production MauiWindowInsetListener records animations in a HashSet<WindowInsetsAnimationCompat> and releases the gate only when OnEnd removes the corresponding object. The prior tests ended a newly created object, so they did not accurately exercise the normal end/release path. |
| #38730 HostApp page | Replaces new CollectionView with new CollectionView2. |
CollectionView2 is a HostApp subclass explicitly registered with Items2.CollectionViewHandler2 on iOS/Mac Catalyst. This forces the current handler even when the test configuration selects the legacy handler for ordinary CollectionView instances. |
| Screenshot baselines | Updates six existing images and adds two iOS images. | Changes visual expectations without changing the associated test methods. The immutable binary diff does not expose the pixel-level old/new differences. |
The #38730 page exercises a grouped, vertically oriented GridItemsLayout with a phone span of 2, other-device span of 3, VerticalItemSpacing = 10, and group headers. The iOS/Mac Catalyst Items2 path builds a UICollectionViewCompositionalLayout; for grouped vertical grids it applies vertical spacing between item groups and sections, adds header-related boundary spacing, and sets ContentInsetsReference.None on iOS 26 or later. These are the platform-sensitive layout paths implicated by that screenshot.
The currently available new iOS baselines depict:
VerifyVerticalItemSpacingPageRendering: three grouped sections laid out without a conspicuous extra gap beyond the expected item/group spacing.VerifyTitleViewRenderingOnNavigation: an orange, nonzero-height TitleView visible in the navigation bar.
Screenshot inventory
- Android updates
EditorPlaceholderRuntimeTextAlignmentChanged.pngEditorRuntimeTextAlignmentChanged.png
- Mac update
VerifyEditorWhenHeightAndWidthRequestSet.png
- iOS updates
ios-26/VerifyEditorWhenHeightAndWidthRequestSet.pngios/SelectedItemSetDuringShellNavigationUpdatesVisualState.pngios/VerifyEditorWhenHeightAndWidthRequestSet.png
- New iOS baselines
ios/VerifyTitleViewRenderingOnNavigation.pngios/VerifyVerticalItemSpacingPageRendering.png
Platform-sensitive paths
- The IME-animation lifecycle changes are Android-only device-test code and exercise
src/Core/src/Platform/Android/MauiWindowInsetListener.cs. CollectionViewHandler2andHandlers/Items2/iOS/LayoutFactory2.csapply to iOS and Mac Catalyst only.- The generic
iosandios-26baseline directories imply OS-sensitive screenshot routing. The exact simulator/runtime-to-baseline selection for the intended validation environment is unknown. - #38730 is source-tagged for macOS and mentions both iOS and Mac Catalyst, but the submitted diff adds only an iOS baseline for that test.
- The required later test platform is iOS; it will not cover the Android device-test or Android/Mac screenshot changes.
Validation requirements
Gate result is
Later iOS validation should provide evidence that:
Issue38730.VerifyVerticalItemSpacingPageRenderingruns through the explicitCollectionView2/Items2 path and selects the intendediosbaseline.Issue39155.VerifyTitleViewRenderingOnNavigationdiscovers and uses its newly added baseline.Issue38443.SelectedItemSetDuringShellNavigationUpdatesVisualStatestill shows the expected selected visual state.EditorFeatureTests.VerifyEditorWhenHeightAndWidthRequestSetselects the correct generic orios-26baseline for the runtime under test.- The changed images represent intended rendering rather than environment, simulator, font, scale, or OS-version drift.
Because no production fix or new test method appears in the submitted diff, the author’s intended validation model and the reason these baseline changes are sufficient need explicit evidence. Android and Mac changes require separate platform evidence if they are intended scope.
Remaining uncertainties
- PR title/body, intended scope, linked issue relationship, comments, reviews, and commit metadata are unavailable.
- Pixel-level differences between old and new binary snapshots are unknown.
- The production change that caused or justified the baseline refresh is unknown; none is present in this submitted diff.
- The exact iOS version, device profile, scale, and screenshot fallback rules expected for validation are unknown.
- It is unknown whether the Android and unrelated Editor/Selection/TitleView snapshot changes are deliberate parts of #39361 or incidental baseline churn.
- It is unknown whether equivalent #38730 Mac Catalyst coverage already exists elsewhere or is intentionally omitted here.
🔬 Code Review — Deep Analysis
Code Review — PR #39361
Independent Assessment
What this changes: The submitted diff is test-only. It reuses each Android WindowInsetsAnimationCompat object across the matching OnPrepare/OnEnd callbacks, switches the #38730 HostApp scenario to CollectionView2 so iOS/Mac Catalyst exercise the Items2 handler, and updates eight Android, iOS, and Mac screenshot baselines.
Inferred motivation: Align the tests with the production IME-animation identity contract and with intended candidate-branch rendering on the current handler/platform versions.
Prior Review Reconciliation
No prior ❌ Error finding was available in the trusted pre-flight context, and the single expert pass produced no actionable inline finding. Prior GitHub review fidelity remains unconfirmed because the trusted context could not retrieve the review surfaces.
Blast Radius Assessment
- Runs for all instances: No production path changes; the effects are limited to the modified HostApp scenario, Android device tests, and screenshot expectations.
- Startup impact: None in production.
- Static/shared state: None added.
Gate and Validation Status
- Trusted Gate result:
⚠️ SKIPPED — no tests detected. - Required platform: iOS.
- Classification: Undetermined. No execution evidence confirms that the changed HostApp scenario selects the intended Items2 handler and iOS baseline, or that the refreshed screenshots represent intentional rendering rather than environment drift.
- Action: Gate was not rerun. Confidence is capped at low, and no merge-readiness claim is supported.
Findings
The expert reviewer wrote an empty inline-findings.json; no concrete defect was identified on an added or modified line.
The remaining concern is evidentiary rather than a verified line-level bug: eight binary expectations and the test-path adjustment have no trusted focused validation result. This does not meet the threshold for an implementation refinement.
Failure-Mode Probing
- Matching Android animation callbacks: The revised test preserves object identity across
OnPrepareandOnEnd, which matches the productionHashSetremoval contract; overlapping animations remain represented by distinct instances. - Handler selection:
CollectionView2is registered to the Items2 handler on iOS/Mac Catalyst, so the changed scenario targets the intended implementation rather than depending on the ordinaryCollectionViewtest configuration. - Baseline routing and fidelity: No trusted run establishes which generic or OS-specific baseline the requested iOS environment selects. The binary diff alone cannot disprove device, scale, font, or OS-version drift.
- Adjacent platforms: The requested iOS validation could not establish correctness of the changed Android and Mac artifacts even if it had run.
External Output Contract
Not applicable.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The submitted test code mechanisms are coherent and the single expert pass found no actionable code defect. However, the trusted Gate was skipped and there is no focused rendering evidence for the updated baselines, so the submitted candidate is not demonstrated merge-ready and cannot support approval.
🛠️ Try-Fix — Analysis & Comparison
Alternative generation: not requested
Evidence-first mode intentionally omits routine Try-Fix attempts. This is not a failed
attempt, a completed alternative search, or evidence that alternatives have no value.
The expert review may still produce one evidence-backed PR refinement.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the current title is vague, and the description inaccurately says all platforms while omitting the CollectionView2 handler-path change and the new TitleView baseline.
Recommended title
[Android/iOS/Mac Catalyst] Device tests: Align candidate baselines and IME animation lifecycle
Recommended description
### Description of Change
This test-only PR addresses device-test and rendering-baseline failures observed in the inflight/candidate PR https://github.com/dotnet/maui/pull/38782. It does not change production code.
#### Android IME animation lifecycle
Updates `src/Controls/tests/DeviceTests/Elements/Window/MauiWindowInsetListenerTests.Android.cs` so each corresponding `OnPrepare` and `OnEnd` callback receives the same `WindowInsetsAnimationCompat` instance, while overlapping animations continue to use distinct instances. This matches the production `MauiWindowInsetListener` lifecycle, which tracks and removes animation objects by identity.
#### iOS and Mac Catalyst CollectionView handler coverage
Updates the #38730 HostApp scenario to use `CollectionView2`, which is registered with `Items2.CollectionViewHandler2` on iOS and Mac Catalyst. This ensures `VerifyVerticalItemSpacingPageRendering` exercises the current Items2 handler path.
#### Screenshot baselines
Adds or updates expected baselines for the submitted Android, iOS, and Mac Catalyst rendering scenarios:
- `VerifyVerticalItemSpacingPageRendering`
- `VerifyTitleViewRenderingOnNavigation`
- `SelectedItemSetDuringShellNavigationUpdatesVisualState`
- `EditorRuntimeTextAlignmentChanged`
- `EditorPlaceholderRuntimeTextAlignmentChanged`
- `VerifyEditorWhenHeightAndWidthRequestSet`
### Issues Fixed
Addresses test failures observed in https://github.com/dotnet/maui/pull/38782.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Trusted evidence-first context captured for the immutable submitted diff |
| Code Review | NEEDS_DISCUSSION (low) | 0 errors, 0 warnings; validation evidence remains incomplete |
| Gate | No tests detected; required platform was iOS | |
| Try-Fix | ⏭️ NOT REQUESTED | Intentional evidence-first omission; no alternative search was performed |
| Refinement | ⏭️ NOT CREATED | No concrete actionable defect or unresolved mechanism met the refinement threshold |
| Report | ✅ COMPLETE |
Code Review and Candidate Comparison
| Candidate | Implementation | Validation | Assessment |
|---|---|---|---|
pr |
Submitted test-only changes: corrected Android animation identity, forced the #38730 Items2 handler path, and refreshed eight platform baselines | Gate skipped; no focused iOS rendering result and no Android/Mac evidence | Sole real candidate and therefore selected, but not demonstrated merge-ready |
Selected Fix: PR
Routine Try-Fix was not requested. No try-fix-N candidate exists, and the expert review did not identify source/test evidence for a concrete defect that would justify implementing pr-plus-reviewer.
Summary
The submitted mechanisms are internally coherent, and the single expert pass produced no actionable inline finding. Approval is nevertheless unsupported: the trusted Gate was skipped, the changed binary expectations were not exercised, and baseline selection/fidelity remains unverified. The author should provide focused platform evidence for the changed scenarios before this candidate is treated as ready.
Root Cause
The Android test previously used different WindowInsetsAnimationCompat instances for corresponding lifecycle callbacks even though production removes the same animation identity from a tracked set. Separately, the #38730 rendering scenario could exercise the legacy handler instead of the intended Items2 path. The baseline refresh appears to align candidate-branch expectations with current rendering, but the immutable diff does not establish why each pixel change is authoritative.
Fix Quality
Reusing each Android animation object and explicitly selecting CollectionView2 are targeted test-path corrections with no production blast radius. The remaining quality risk is evidentiary: eight binary baselines span Android, iOS, and Mac, while no trusted test execution confirms the expected runtime, device, handler, or baseline-routing conditions. Because Gate did not permit approval and the expert verdict remains NEEDS_DISCUSSION, the raw PR cannot be recommended for approval yet.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
✅ Deep UI tests — 415 passed, 0 failed, 8 skipped across 3 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Button |
105/106 (1 skipped) ✓ | — |
Label |
114/116 (2 skipped) ✓ | — |
Layout |
196/201 (5 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
…39408) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Follow up to #39189 after the missed related tests and silently skipped command reported on #39361. - Discover existing Shared.Tests methods from changed platform-specific screenshot baselines, including named `VerifyScreenshot` baselines, using the prepared review checkout rather than querying a moving PR head. - Associate HostApp-only issue-page changes with their existing same-named UI fixture. Preserve explicit warnings when no mapping exists, direct-test discovery, and the verifier's existing workload limits. - Support internal test classes when resolving class names and narrow baseline-only selection to matching methods instead of entire feature fixtures. - Explain lock-blocked `/review` and `/review gate` requests visibly: no new run was started and the command is not queued. Keep the existing lock and active review untouched. A publication failure leaves the original command unacknowledged and recoverable. Validation: - `git diff --check` — passed. - `actionlint .github/workflows/review-trigger.yml` — passed. - `pwsh -NoProfile -NonInteractive -Command 'Invoke-Pester -Path ".github/scripts/shared/Detect-TestsInDiff.Tests.ps1" -Output Minimal'` — passed, 22 existing tests. - `pwsh -NoProfile -NonInteractive -Command 'Invoke-Pester -Path ".github/scripts/ReviewTrigger.Tests.ps1", ".github/skills/verify-tests-fail-without-fix/scripts/Verify-TestsFail.Tests.ps1" -Output Minimal'` — passed, 135 existing tests. Re-ran the 24 trigger checks after the final acknowledgement safeguard; all passed. - Detector-only reproduction on #39361 head `233efcebeae3e08bd07904c5586de71df22649d4`, pinned to diff base `40a966c82c8aed0cf3cd41f5814b4475a3fcf59b`, with `-Platform ios` — found `EditorFeatureTests.VerifyEditorWhenHeightAndWidthRequestSet`, `Issue38443.SelectedItemSetDuringShellNavigationUpdatesVisualState`, `Issue38730`, and `Issue39155.VerifyTitleViewRenderingOnNavigation`; the Android device partial was excluded. - `gh workflow run review-trigger.yml --ref kubaflo-gate-related-tests -f pr_number=39408 -f gate_only=true -f platform=ios -f pipeline_ref=kubaflo-gate-related-tests` — final-source [hosted canary succeeded](https://github.com/dotnet/maui/actions/runs/38751849112). With a temporary fresh lock on this PR only, it posted the visible blocked-command notice and skipped Azure dispatch. The temporary canary lock was removed afterward. No new pipeline tests were added. No native/device tests or XCTest were run locally. Related UI test discovery is verified against the exact source snapshot, not by a native test run. The existing #39361 review was not cancelled, unlocked, or duplicated. Automatic platform inference remains label-based and is unchanged here. The changes are not deployed to default-branch commands until merged. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Addresses the automation defects reported at #39361 (comment). No separate issue was filed. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Platform test results and the described screenshot-baseline updates remain unverified.
0 open findings
What changed in this PR
Updates MAUI test fixtures to address failures in the .NET 10 SR12 candidate PR #38782, without changing production code.
Changes:
- Switches the vertical item-spacing sample to
CollectionView2. - Improves window lookup and original-page restoration in
Issue38619. - Reuses matching animation instances in Android inset-listener tests.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.HostApp/Issues/Issue38730.cs | Uses CollectionView2 for vertical spacing coverage. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue38619.cs | Adds fallback window lookup and captures the page for restoration. |
| src/Controls/tests/DeviceTests/Elements/Window/MauiWindowInsetListenerTests.Android.cs | Pairs animation preparation and completion using the same instance. |
🧠 Review effort: Balanced
## Description This PR addresses the test failures that occurred in the inflight/candidate branch: #38782, and includes updates to improve rendering and test stability across platforms. This PR adds and updates the expected baseline images for all platforms so the tests validate the current intended output. Fixes: #38782 #### Images - VerifyVerticalItemSpacingPageRendering - SelectedItemSetDuringShellNavigationUpdatesVisualState - EditorRuntimeTextAlignmentChanged - EditorPlaceholderRuntimeTextAlignmentChanged - VerifyEditorWhenHeightAndWidthRequestSet Updated `src/Controls/tests/DeviceTests/Elements/Window/MauiWindowInsetListenerTests.Android.cs` so the same`WindowInsetsAnimationCompat` instance is reused for each corresponding `OnPrepare` and `OnEnd` callback. This accurately simulates the Android IME animation lifecycle and validates overlapping animations without production-code changes. Updated the `Issue38619` sample to improve window resolution, remove the exception when a window is unavailable, and reliably restore the original page after changing Window.Page . --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Subhiksha Chandrasekaran <subhiksha.c@syncfusion.com> Co-authored-by: BagavathiPerumal <bagavathiperumal.a@syncfusion.com> Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com> Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Description
This PR addresses the test failures that occurred in the inflight/candidate branch: #38782, and includes updates to improve rendering and test stability across platforms.
This PR adds and updates the expected baseline images for all platforms so the tests validate the current intended output.
Fixes: #38782
Images
Updated
src/Controls/tests/DeviceTests/Elements/Window/MauiWindowInsetListenerTests.Android.csso the sameWindowInsetsAnimationCompatinstance is reused for each correspondingOnPrepareandOnEndcallback. This accurately simulates the Android IME animation lifecycle and validates overlapping animations without production-code changes.Updated the
Issue38619sample to improve window resolution, remove the exception when a window is unavailable, and reliably restore the original page after changing Window.Page .