Repository navigation
Stabilize CollectionView header and Shell flyout UI tests - #39056
Conversation
Reacquire header and footer geometry after focus changes and keep the CollectionView fixture outside system bars. Wait for restored Shell flyout items and destination controls before interacting with them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39056Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39056" |
|
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 |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Cross-platform validation and required CI status are unavailable, with iOS, Windows, and MacCatalyst coverage still pending.
Review effort: Balanced
Findings: None
What changed in this PR
Stabilizes existing CollectionView and Shell UI tests without relaxing assertions.
Changes:
- Reacquires element geometry after focus changes.
- Waits for Shell flyout reconstruction and navigation.
- Keeps the CollectionView fixture within container safe areas.
| File | Description |
|---|---|
ShellFlyoutContent.cs |
Adds synchronization waits around flyout transitions. |
Issue10947.cs |
Uses stale-element-aware geometry queries. |
Issue10947.xaml |
Applies container safe-area handling. |
|
@dalexsoto stamp |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
No actionable code issues found at 4f4bcaabaaab6e6000c82436df4110472e4a9ed7. Each independent reviewer found that the updated geometry lookups and Shell readiness waits preserve the existing assertions while targeting the next interaction's rebuilt element.
Methodology: 3 independent reviewers with adversarial consensus.
Test coverage: The PR updates existing CollectionView and Shell UI-test scenarios without weakening assertions or adding delays.
Prior review status: One existing comment-only review at this head reported no findings; no duplicate concerns identified.
Scope: code review only. CI/check status and merge readiness were not evaluated; use the repository's CI-analysis workflow for that assessment.
[!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 from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Remove two source-identified causes of intermittent UI-test failures without weakening regression coverage:
Issue10947.CollectionViewHeaderShouldNotScrollreacquires native header/footer geometry after focus changes using the existing stale-element-aware helper. Its fixture explicitly respects container safe areas: local Android execution demonstrated that the header could otherwise be completely hidden underneath the status bar and absent from the accessibility tree. Both exact rectangle comparisons are unchanged.ShellFlyoutContent.FlyoutContentTestswaits for restored default flyout items after custom content/template reset, and for destination page controls after selection, instead of tapping during native flyout reconstruction.There are no test skips, new blanket retries, arbitrary sleeps, snapshot changes, or relaxed assertions. This complements #38822 rather than duplicating its null-content ScrollView and Android photo-picker fixes.
Issues Fixed
CI-observed stale-element/lookup failures in the CollectionView header/footer regression and the Shell flyout-content restoration test. This is test/fixture-only; it does not claim to fix persistent CollectionView scrolling, lifecycle crashes, XAML constructor failures, or build errors found during the cross-branch investigation.
Validation
All runs used
.github/scripts/BuildAndRunHostApp.ps1with method-name filters and explicit checks that the intended tests actually executed.Nine genuine passing executions in total. Failed-test retry recoveries and zero-test runner success are explicitly excluded from the validation count. Formatting and patch whitespace checks passed.
maui-prwas queued for commit4f4bcaabaa. Cross-platform UI CI was requested with/azp run maui-pr-uitests; its results are pending. Finite runs do not establish absolute reliability.