test(coverage): add Playwright E2E for channels page (#1297 B3)#1300
Open
Kpa-clawbot wants to merge 2 commits into
Open
test(coverage): add Playwright E2E for channels page (#1297 B3)#1300Kpa-clawbot wants to merge 2 commits into
Kpa-clawbot wants to merge 2 commits into
Conversation
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 20, 2026
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 21, 2026
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
2b37568 to
d5a31f9
Compare
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 21, 2026
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
d5a31f9 to
54621e6
Compare
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 21, 2026
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
54621e6 to
90b8601
Compare
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 21, 2026
…1300) The outside-click test invoked document.body.click() via page.evaluate, which races the popover's deferred (setTimeout 0) document-level click listener registration AND uses HTMLElement.click() rather than a real PointerEvent. Both modes can let the listener miss the synthesized click, leaving the popover open and timing out waitForFunction at 8s. Fix: wait for the popover to actually have layout (proxy for listener install), then page.mouse.click(700, 500) which dispatches a real MouseEvent at a coordinate outside the popover (anchored at 100,100). Bump close-wait timeout to 15s as belt-and-suspenders. Test-only change; channel-color-picker.js untouched.
efiten
approved these changes
May 21, 2026
Contributor
efiten
left a comment
There was a problem hiding this comment.
Five Playwright suites covering the major channels.js code paths (sidebar render, selection flow, add modal, share/color, WS batch). The color-picker outside-click fix (real page.mouse.click + layout-wait) is the right call — HTMLElement.click() races the deferred listener. Tests are solid and the deploy.yml wiring is correct. Approving.
Kpa-clawbot
added a commit
that referenced
this pull request
May 22, 2026
Master CI failing on `test-channel-color-picker-e2e.js` outside-click step. Test-only fix copied from PR #1300 branch (SHA 7f84884): real mouse click instead of `element.click()`, wait for listener install. Test-only change; no production code touched. Co-authored-by: Kpa-clawbot <bot@kpa-clawbot.local>
Contributor
|
PR is approved but the Playwright E2E CI check is failing (run ending 2026-05-22T05:32). This is a Playwright coverage PR so a failing Playwright check is a blocker. Please investigate the failure and push a fix before merge. |
Kpa-clawbot
pushed a commit
that referenced
this pull request
May 23, 2026
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
7f84884 to
b6aba52
Compare
Five new Playwright suites targeting public/channels.js (1950 LOC, was 19.9% stmt coverage) — exercises the major UI sections in init() that prior suites barely touched. New tests: - test-channels-list-render-e2e.js — sectioned sidebar (My Channels / Network / Encrypted), encrypted collapse toggle + persistence, row badges/previews, color-dot + clear, sidebar resize handle - test-channels-selection-flow-e2e.js — selectChannel header update, message rendering (avatars, sender colors, packet links), node detail panel open/close via mouse + keyboard, deep-link route restoration - test-channels-add-modal-e2e.js — Generate PSK + QR, Add PSK valid + invalid hex error path, Monitor Hashtag (with and without # prefix), empty-input no-op, Scan QR unavailable fallback, Escape close, remove channel ✕ flow - test-channels-share-color-e2e.js — share modal normal (QR + Hex + Copy), error mode (openShareModalError when no stored key), Escape close, ChannelColorPicker.show invocation, keyboard Enter on Share span - test-channels-ws-batch-e2e.js — drives processWSBatch via test hooks: explicit-sender append, "Sender: text" parsing, packetHash dedup + observer accumulation, new-channel append, scroll-button branch, region-filter exclusion code path All five wired into .github/workflows/deploy.yml after the existing channel-fluid suite. No production code changes — pure coverage. Refs #1297
Previous test step performed a hash-route bounce (/#/nodes → /#/channels) which re-rendered .ch-sidebar / .ch-sidebar-resize. The #89 init IIFE had already wired mousedown on the original handle node; the freshly-rendered handle had no listener, so the simulated drag fired no mousedown → dragging stayed false → mouseup never wrote to localStorage. Assertion failed: 'sidebar width should be persisted, got: null'. Fix the test (not channels.js): - Full reload via page.goto before the resize step so the init IIFE binds mousedown to the live handle. - Clear any stale channels-sidebar-width before dragging so the assert proves THIS drag wrote the key. - Multi-step mouse.move with 10ms gaps between segments so each event dispatches separately to the document-level mousemove listener. Refs #1300
b6aba52 to
cd7f525
Compare
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.
#1297 B3 — Playwright E2E coverage for
public/channels.jsPure-coverage PR. Adds five Playwright suites targeting the largest
under-tested branches of
public/channels.js(1950 LOC, was 19.9%statements per the live coverage refinement in #1297 — the single
biggest delta opportunity in the umbrella). No production code changes.
Coverage exemption
Per repo
AGENTS.mdTDD rule: this is the net-new test coveragecase — there is no production change to gate, so a failing-then-passing
red commit isn't applicable. All five suites exercise existing channels
init() code paths that ship today.
New test files
test-channels-list-render-e2e.jstest-channels-selection-flow-e2e.jsselectChannel()header update + URL replaceState, message row rendering (avatars, sender colors, packet links), node detail panel open via mouse + keyboard + close-with-focus-restore, deep-link route restoration, scroll button initial statetest-channels-add-modal-e2e.js#, empty-hashtag no-op, Scan QR unavailable fallback, Escape close, Remove ✕ flowtest-channels-share-color-e2e.js#chShareModalwith QR + Hex Key + Copy success label), Share modal error mode (openShareModalErrorwhen no stored key — field groups hidden), Escape close,ChannelColorPicker.showinvocation on color-dot click, keyboard Enter on a[data-share-channel]spantest-channels-ws-batch-e2e.jsprocessWSBatchvia_channelsProcessWSBatchForTest: explicit-sender append,"Sender: text"parsing branch, packetHash dedup + observer accumulation, new-channel append (channel previously unseen), scroll-button branch when user not at bottom, region-filter exclusion code pathAll five tests wired into
.github/workflows/deploy.ymlafter theexisting
test-channel-fluid-e2e.jsstep.Preflight
bash ~/.openclaw/skills/pr-preflight/scripts/run-all.sh origin/master→exit 0, all gates pass (PII, CSS vars, branch scope, etc.).
Refs #1297