test(e2e): fix broken Playwright tests on main (#1235 example)#1236
Open
JMBattista wants to merge 1 commit into
Open
test(e2e): fix broken Playwright tests on main (#1235 example)#1236JMBattista wants to merge 1 commit into
JMBattista wants to merge 1 commit into
Conversation
…scovery) Stabilizes 8 pre-existing Playwright e2e failures surfaced (not caused) by PR asheshgoplani#1235's `playwright (e2e + screenshots)` job. Mix of one product regression, one test-fixture bug, and stale test/baseline expectations. Product bug — Skills tab wired to a stub (skills.spec.js UI tests): PR asheshgoplani#1124 (c709400), while wiring McpPane in place of the MCP stub, also clobbered the SkillsPane wiring that asheshgoplani#1122 had added, reverting the Skills tab to a StubPane. The fully-functional SkillsPane component was orphaned. Restored its import + mount in AppShell.js. This was a real user-facing regression (web Skills tab showed a placeholder instead of the working pane). Fixture bug — MCP state leaked across tests (mcps.spec.js asheshgoplani#38, asheshgoplani#123): /__fixture/reset reseeded the session store but never reset the in-memory fixtureMCPManager, whose Reset() method was dead code. Attachments leaked across the serially-run MCP cases (and across Playwright retries, which re-run the whole serial block), so "fresh fixture → empty arrays" and "un-attached → 404" saw stale attachments. Wired Reset() into the handler. Stale tests — Stop→Close rename (keyboard-parity.spec.js asheshgoplani#49, asheshgoplani#140): asheshgoplani#1129 (5b0dae2) reworked Shift+D into a non-destructive "Close session" (kill process, keep metadata) and reworded the overlay label + confirm dialog accordingly. The specs still asserted the old "Stop" copy. Updated the two assertions to match, with comments citing the commit. Stale baseline — shortcuts overlay screenshot (keyboard-parity.spec.js asheshgoplani#191): The committed baseline predated asheshgoplani#1129: it shows "Stop focused session" and lacks the "Ctrl+Z Undo last delete" row. Refreshed desktop + tablet baselines only after confirming the overlay renders correctly (the `?` test passes with current labels). Tablet baseline was stale for the same reason. Verified locally (chromium desktop + tablet): all 8 target tests pass; full suite 380 passed. (9 chromium-phone failures are pre-existing on clean main, absent from the CI asheshgoplani#1235 desktop-only failure set, and untouched here.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR replaces a SkillsPane placeholder in the app shell, introduces persistent MCP manager state in the test fixture with reset support, and updates keyboard-parity test assertions to match new session close-action wording. ChangesUI component, fixture state management, and test assertion updates
🎯 2 (Simple) | ⏱️ ~10 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
playwright (e2e + screenshots)job has been failing for a while onmain. It surfaces on #1235 (run), but the failures are pre-existing — not introduced by #1235; #1235 was just the discovery vector. Reproduced against cleanmain(f6bc0f5) before touching anything.8 failing tests, four distinct root causes — one product bug, one test-fixture bug, and two stale test/baseline expectations. No test was skipped/
.fixme'd; no assertion was weakened.Failures, root causes & fixes
Product bug — Skills tab wired to a stub (3 tests)
skills.spec.js:79UI: Skills tab lists the seeded attachment and catalogskills.spec.js:92UI: clicking Attach moves a skill from catalog to attachedskills.spec.js:102UI: clicking Detach removes a skill from the attached listRoot cause: PR #1124 (
c709400a), while wiringMcpPanein place of the MCP stub, also clobbered theSkillsPanewiring that #1122 had added — reverting the Skills tab to aStubPane. The fully-functionalSkillsPanecomponent (panes/SkillsPane.js, with all thedata-testidhooks the tests expect) was left orphaned and never mounted.gotoSkills()timed out waiting for[data-testid="skills-pane"], which the stub never renders. This is a real user-facing regression — the web Skills tab showed a "managed in the TUI today" placeholder instead of the working pane.Fix (product,
AppShell.js):(plus restoring the
import { SkillsPane }.)Test-fixture bug — MCP state leaked across tests (2 tests)
mcps.spec.js:38GET /api/sessions/:id/mcps returns empty arrays for fresh fixturemcps.spec.js:123PATCH on un-attached MCP returns 404Root cause:
/__fixture/resetreseeded the session store but never reset the in-memoryfixtureMCPManager— itsReset()method was dead code. The MCP describe runsmode: serial, so attachments from earlier cases leaked into later ones (and, on Playwright retries, the whole serial block re-runs against already-polluted state). By the timePATCH on un-attached MCPran,exawas still attached from thepooled:truecase → got200, not404. On retry,empty arrays for fresh fixturethen saw the leaked attachments too. Directly reproduced:mcps.spec.js:123fails on a clean first pass.Fix (fixture,
web-fixture/main.go): hold the MCP manager on the store and call its existingReset()from the reset handler.Stale tests —
Stop→Closerename (2 tests)keyboard-parity.spec.js:49?opens the keyboard shortcuts overlaykeyboard-parity.spec.js:140Shift+D opens the stop-session confirm dialogRoot cause: PR #1129 (
5b0dae2a, "non-destructive Close + Undo Delete") reworked Shift+D from "Stop" into a non-destructive "Close session" (kills the process, keeps metadata) and reworded both the overlay binding label and the confirm-dialog copy. The specs still asserted the old "Stop" wording, so the assertions timed out (~6s) even though the overlay/dialog opened fine. Test bug — handler is correct; specs were stale.Stale baseline — shortcuts overlay screenshot (1 test)
keyboard-parity.spec.js:191shortcuts overlay renders consistentlyRoot cause: the committed baseline predated #1129 — it shows
Shift+D → "Stop focused session"and lacks theCtrl+Z → Undo last deleterow that #1129 added. The diff was a clean structural shift (unchanged rows aligned as exact offset copies — i.e. font rendering matches the baseline's environment, not an env drift). Refreshed the desktop + tablet baselines only after confirming the overlay renders correctly (the?test passes with the current labels). The tablet baseline was stale for the same reason.Verification
Reproduced all failures on clean
main, then verified the fixes locally (Linux chromium, desktop + tablet):keyboard-parity+mcps+skillson desktop+tablet: 66 passed.Non-goals respected
No new tests/coverage; no skips/
.fixme; no baseline refreshed on broken UI; no other CI gate widened; the perf-suite untouched. The only Go touched is the test fixture (tests/web/fixtures/…), and the only product change is the one-lineSkillsPanere-wire fixing a real regression.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
UI/UX Updates