test(e2e): wait for visible chat-panel instead of fixed 10s sleep (core#2699) #2702
Reference in New Issue
Block a user
Delete Branch "fix/chat-mobile-flake-2699"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flake: The mobile chat E2E used a fixed
waitForSelector("[data-testid='chat-panel']", { timeout: 10_000 })inbeforeEachand after reload. That selector only requires the element to exist in the DOM, so it could resolve before the mobile shell had finished hydrating/rendering the chat panel as visible. The subsequent assertions then raced hydration and flaked (the same commit often greens on retry).Fix: Replace the fixed sleep-style wait with a proper wait-for-condition on the actual readiness signal: the chat panel must be
:visibleinside the mobile shell. This mirrors the desktop chat suite's pattern (#panel-chat [data-testid='chat-panel']:visible) and ensures we don't proceed until the panel is actually rendered. The timeout is raised to 15s to cover slower cold-start hydration.Readiness condition waited on:
[data-testid='chat-panel']:visible(chat-panel mounted and visible in the mobile shell).Testing:
npx tsc --noEmitover the canvas E2E spec passes.canvas/e2e/chat-mobile.spec.ts; no runtime code changed.SOP checklist
Fixes #2699
APPROVED on head
d10fdbfa79. Reviewed the mobile chat E2E flake fix: both waits now use[data-testid='chat-panel']:visible, matching the desktop suite's visible chat-panel readiness pattern rather than proceeding on DOM presence alone. The diff is limited tocanvas/e2e/chat-mobile.spec.ts; no app/runtime logic changed. E2E Chat and Canvas CI are green; PR is mergeable./sop-ack comprehensive-testing E2E Chat and Canvas CI are green; reviewed both changed waits in chat-mobile.spec.ts
/sop-ack local-postgres-e2e N/A for test-only canvas E2E wait change; no Go/DB path touched
/sop-ack staging-smoke CI/E2E coverage on PR is green for the affected chat path
/sop-ack root-cause root cause is waiting for DOM presence instead of visible hydrated chat panel, causing mobile hydration race
/sop-ack five-axis-review correctness, robustness, security, performance, readability reviewed; scoped test-only change
/sop-ack no-backwards-compat no runtime compatibility shim or app behavior change; test wait condition only
/sop-ack memory-consulted reviewed PR context and desktop chat selector pattern before approval
MECHANISM: The red cluster on the #2699 follow-up PR is governance state, not a residual E2E Chat failure. Runs
356564/356562invoke the qa/securityreview-check.shjobs for PR #2702, and both fail because the reviews API has no non-author approval candidate yet. Run356561isgate-check-v3reflecting those required contexts plus SOP state; it is not running Playwright or the mobile chat spec.EVIDENCE: PR #2702 head
d10fdbfa79f26272d4e5fa71ac752de015d10de1is the fix for core#2699. Job483936logsqa-review awaiting non-author APPROVE; job483938logssecurity-review awaiting non-author APPROVE. Job483935lists required checksqa-review / approved,security-review / approved, andsop-checklist / all-items-acked, with qa failing and security/SOP pending. NoE2E Chatjob failure appears in this red cluster.RECOMMENDED FIX SHAPE: No additional chat-code or Playwright-readiness fix is indicated by these logs. If the PR is still active in another branch, provide the required genuine non-author approval and SOP ack/refire; if approvals exist but the gate stays red, investigate
.gitea/scripts/review-check.shcandidate filtering andtools/gate-check-v3/gate_check.pystatus aggregation rather thancanvas/e2e/chat-mobile.spec.ts.