Repository navigation
fix(tests): Automations fixture tests time out selecting the app theme when Settings opens slowly - #2152
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe PR waits for usable theme controls and dropdown states, reuses the existing theme-selection helper, and lowers the timing-pattern baseline. Example: An Automations fixture test selects Dark while Settings opens slowly.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-authored test repair that remains absent from main, and no introduced correctness defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherAutomations fixture tests drive the real Companion app through navigation commands and Windows UI Automation; the changed helper prepares the theme before existing rendering and interaction assertions. flowchart LR
A[Automations fixture tests] --> B[Existing theme helper]
B --> C[Settings navigation]
C --> D[UI Automation readiness]
D --> E[Theme list selection]
E --> F[Existing Automations assertions]
Technical reviewBest possible solution: Keep theme preparation in the existing helper with observable readiness checks and unchanged downstream assertions. Do we have a high-confidence way to reproduce the issue? The old helper demonstrably waits only for selector existence and matching text before a one-shot selection; the author reports an intermittent timeout, but no deterministic before-and-after reproduction is supplied. Is this the best way to solve the issue? This is a proportionate repair: it reuses existing owners and UI Automation patterns, removes duplicated steps, and preserves the rendering assertions and timeout budgets. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 85c8ffa61872. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 1:35 AM ET / 06:35 UTC. |
…e when Settings opens slowly SelectAppThemeAsync called Expand() on the App theme ComboBox as soon as it existed in UI Automation, while the Settings page was still arriving, and the expand could be ignored. It now waits for the selector to be on screen and enabled, waits for the dropdown to report Expanded, selects the dropdown's own ListItem (the closed selector already displays the current theme's name), then collapses it and waits for Collapsed, matching the Usage and pinned-Connection theme selections. The responsive-widths test reuses the helper instead of an inline copy, and the timing baseline is lowered for the removed one-shot lookups. Co-authored-by: Copilot App <[email protected]>
6436667 to
bbcf4ee
Compare
What Problem This Solves
Fixes: Automations mock Gateway UI tests that switch the app theme can time out when Settings opens slowly ("Timed out waiting for theme choice").
User Impact
User impact: there is no product change. Contributors get fewer false CI failures in the "Mock Gateway application and compatibility tests" job.
Why This Change Was Made
SelectAppThemeAsyncnavigated to Settings, waited only until the App theme ComboBox existed in UI Automation, and calledExpand()once. While the page is still arriving, that earlyExpand()can be ignored. In the failing run, the dropdown was still closed 20 seconds later (failure screenshot), so the wait for the theme option timed out. When the requested theme was already selected, the old wait could also pass too early: the closed ComboBox already shows that theme's name, and the one-shot lookup that followed could then throw.The helper now:
Expand();ListItemwith the theme name and a selection pattern) before selecting it.This matches how the Usage and pinned-Connection tests already select a theme.
Automations_ResponsiveShellWidthsHaveDistinctMeasuredFrameshad an inline copy of the old steps and now calls the helper. As suggested byvalidate-test-timing-patterns.ps1, the timing baseline is lowered for the two removed one-shot lookups (72 to 70). The changes add no retries of actions, sleeps, fixed settle counts, skips, or weaker assertions.Evidence
Automations_HeroWashScrollsWhileTheBackplateStaysAnchored(Dark)failed with "Timed out waiting for theme choice". The failure screenshot shows the App theme ComboBox collapsed at the timeout.ValuePattern. The open LOW note is that the option search covers all app windows, the same as the existing theme selections.Change Type
Scope
winnodeRequired proof pools
none: test-only change to the mock Gateway fixture UI tests. CI runs these tests directly.Validation
All runs were local on Windows x64 at 175% DPI, with isolated app and test profiles. Metadata for the real
%APPDATA%/%LOCALAPPDATA%\OpenClawTraywas unchanged after every run. Fixture runs usedOPENCLAW_RUN_KEYBOARD_PROOF=1and screenshots, matching CI.SelectAppThemeAsync)Automations_HeroWashScrollsWhileTheBackplateStaysAnchored(Light + Dark)Automations_ResponsiveShellWidthsHaveDistinctMeasuredFramesAutomations_ScopesToAgentsAndCoversMainStates(Light + Dark)BoundingRectangleSizeReasonableviolation on a transient button (it also occurs locally without this change).\scripts\validate-test-timing-patterns.ps1: passed after-LowerBaseline../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5849 passed, 0 failed, 29 skipped.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6410 passed, 0 failed, includingTestDeterminismGuardTests, onmainc7b75de.main85c8ffa: HeroWash 3/3, ResponsiveShellWidths 2/2, Automations_ScopesToAgentsAndCoversMainStates 1/1. After rebasing ontomainc7b75de (test(setup): fast-validation fails on main because setup tests look up the companion without waiting #2153, guard fix):.\scripts\validate-test-timing-patterns.ps1passed; HeroWash 3/3, ResponsiveShellWidths 2/2.Real Behavior Proof
dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-x64 -p:DevBuild=false --no-build --filter <test>, with the fixture environment fromscripts/test-gateway-fixture.ps1.Yes/No/N/A): N/A (local artifacts only).Automations_PinnedHostToggleHitTabAndBanner(keyboard-proof lane) also calls this helper. Locally it fails both with and without this change, at a later step: the Automations inventory row is below the fold at 1000×900 DIP on a 175% DPI display. It is not verified here.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations