name: js8-test description: Run an end-to-end JS8 message round-trip between two virtual wfweb rigs. Boots the testrig bench, drives both browsers via Playwright MCP, has each station send a directed JS8 message via the compose box while the other decodes it into its feed, verifies the copy, screenshots both, and tears down. Use when the user asks to test JS8, run a JS8 QSO, verify the JS8 codec/panel, or validate the JS8 messenger TX/RX path. (wfweb-vs-wfweb on the bench — not interop against real JS8Call.)
Run an end-to-end JS8 message round-trip between two virtual rigs: each station sends a directed message from the compose box, and the other must decode it into its feed. Drive both browsers via Playwright MCP, screenshot both sides, tear down. Bench-only (virtual rigs, no hardware, no real RF) — this tests wfweb's JS8 codec against itself, not interop with real JS8Call.
Sibling of packet-test / ft8-test / cw-test; reuses the same bench (scripts/testrig.sh) and Playwright lifecycle. JS8 is browser-side WASM like FT8, so it shares FT8's RX-audio gate and slot timing. Read "Pitfalls" before debugging.
Prerequisites (verify before starting; fix and stop if missing)
./wfweband./tools/virtualrig/virtualrigare built. If not:qmake wfweb.pro && make -j$(nproc)andcd tools/virtualrig && qmake && make -j$(nproc).- Repo
.mcp.jsonincludes--ignore-https-errorsfor the playwright MCP. Verify:pgrep -af @playwright/mcpmust show--ignore-https-errors. If.mcp.jsonwas just edited, the user must restart Claude Code (a/mcpreconnect re-uses cached args). Stop and tell them. - Load the playwright tools via ToolSearch:
select:mcp__playwright__browser_navigate,mcp__playwright__browser_snapshot,mcp__playwright__browser_click,mcp__playwright__browser_type,mcp__playwright__browser_take_screenshot,mcp__playwright__browser_wait_for,mcp__playwright__browser_evaluate,mcp__playwright__browser_close,mcp__playwright__browser_tabs,mcp__playwright__browser_select_option.
Boot the bench
./scripts/testrig.sh up 2
Both rigs come up on 14.074.000. Opening the JS8 panel auto-retunes each rig to the JS8 dial frequency for the band (14.078.000 on 20 m) and forces USB — both move together, so they stay matched and audio gates.
- A → https://127.0.0.1:9080 (virtual-IC7300-A)
- B → https://127.0.0.1:9090 (virtual-IC7300-B)
Per-tab UI bring-up (do for both A and B)
The JS8 panel is an overlay (#js8Bar), opened from the MODE overlay's JS8 button — it's a peer of the FT8 DIGI bar (opening one closes the other).
browser_navigateto the rig URL.- Wipe stale browser state:
browser_evaluate() => { localStorage.clear(); sessionStorage.clear(); }, thenbrowser_navigateto the same URL again. (Note: JS8 persistsjs8Open=1, so without the wipe a reload reopens the panel mid-init.) - Click the CLICK TO START splash (gesture needed for
AudioContext). - Wait for RX audio. JS8's decoder is fed by
window._js8ProcessAudioChunk, which the host audio path only calls when audio is flowing. The splash enables it ~1 s asynchronously — poll untilwindow.audioEnabled === truebefore continuing. - Open the JS8 panel:
window.toggleJs8Bar()(equivalently MODE → JS8). This forces USB, retunes to the JS8 dial freq, creates the decoder, and enables RX. Confirmwindow.js8MessengerVisible() === trueandwindow.js8Diag().rxEnabled === true. - Set MY CALL: open settings (
#js8SettingsBtn), set#js8SettingMycall, then close (#js8SettingsCloseBtn). The callsign is committed to the shared station call (window.App.callsign) on close, not on input — so you must click close. Verifywindow.App.callsign.get()returns it.- A:
W1AAA. B:W1BBB. (Shared station call — same field feeds CW/FT8/FreeDV/APRS.) - Submode is also read on close; the default JS8 Normal · 15 s (
submode 0) is fine. RX decodes all submodes regardless, so the TX submode only affects the sender's frame timing.
- A:
When refs go stale across snapshots, drive directly via browser_evaluate with stable IDs (the normal path, not a fallback):
- Buttons:
js8SettingsBtn,js8SettingsCloseBtn,js8SendBtn,js8RxToggle,js8TuneBtn,js8CloseBtn - Fields:
js8DxCall(the TO target — authoritative),js8Compose(message text),js8SettingMycall,js8SubmodeSel - Feed (decoded + sent messages):
#js8Feed.textContent← assert on this. Rows read<ts><from>→<target>│<msg><snr>dB; your own sent rows showSENT n/n. - Functions (global):
toggleJs8Bar(),js8MessengerVisible(),js8Diag()(returns{rxEnabled, txBusy, submode, decodes, audioChunks, …}),js8ClearFeed() - Note: the internal state object
Sis not onwindow(unlikewindow.Packet.state). Usejs8Diag()for status and read#js8Feedfor messages.
QSO sequence (single bidirectional run)
- A → send directed message: on tab A, set
#js8DxCalltoW1BBB(dispatchinput), set#js8ComposetoHELLO(dispatchinput), click#js8SendBtn. This routes throughenqueueTx, which slot-aligns the transmission. Use the compose+send path — do NOT usewindow.txJs8()(a raw 12-char test hook that streams un-slot-aligned audio and won't reliably decode). - Confirm A transmits: poll
window.js8Diag().txBusy— it goes true on the next slot boundary, then false when done. A's own feed row showsW1AAA→W1BBB │ HELLO SENT 2/2. A short message is ~2 frames; with the wait-for-slot + TX time this takes ~25–35 s at Normal. - Read B's copy: on tab B, poll
#js8Feed.textContent until it contains bothW1AAAandHELLO(allow ~30 s after A finishes). On the clean virtual channel the decode is solid (SNR ~+20 dB). Assert tolerantly — require the sender call and a recognizable chunk of the message, not byte-exact. - B → reply: on tab B, set
#js8DxCalltoW1AAA,#js8ComposetoGE TNX, click#js8SendBtn. - Read A's copy: on tab A, poll
#js8Feeduntil it containsW1BBBandGE. - Screenshot both with
browser_take_screenshot,fullPage: true. Save as.playwright-mcp/wfweb-js8-A.pngand...-B.png. (Bare names land in the project root;/tmpis rejected — the MCP roots are the project dir and.playwright-mcp/.)
Teardown and report
browser_close(both tabs), then./scripts/testrig.sh down.- Report PASS/FAIL and the two screenshot paths. PASS = each side decoded the other's directed message (sender call + message text appear in its
#js8Feed).
Pitfalls — read before debugging
- RX-audio gate (same as FT8). The decoder only runs while
window.audioEnabled === true(enabled ~1 s after CLICK TO START). Gate on it.js8Diag().audioChunksshould be climbing; if it's stuck at 0, audio isn't flowing. - Callsign commits on settings CLOSE. Typing into
#js8SettingMycalldoes nothing until you click#js8SettingsCloseBtn— that's whereApp.callsign.set()runs. Verify viawindow.App.callsign.get(). - Use compose +
#js8SendBtn, notwindow.txJs8().txJs8requires an exact-12-char message and streams immediately without slot alignment — JS8's per-slot decoder usually won't catch it. The compose path slot-aligns viaenqueueTx, which is what actually works. - JS8 is slot-timed (Normal = 15 s). The send waits for the next slot boundary, then transmits over one or more 15 s frames. Budget ~30 s per direction; poll, don't expect instant.
js8Diag().submodeconfirms the TX submode; a faster submode (Fast 10 s / JS8 60 4 s) speeds the run but RX decodes all modes either way. - TO field (
#js8DxCall→S.dxCall) is the authoritative target, not the active QSO tab. Set it before each send. Empty defaults to@ALLCALL(a broadcast, which B still decodes — fine if you prefer the simpler broadcast assert). Sis not onwindow. Read message state from#js8Feed.textContent and status fromwindow.js8Diag(). Don't look forwindow.js8.stateor similar.- The feed mixes sent and received rows. Your own sent message shows with
SENT n/n; the received copy on the other tab shows an…dBSNR. Assert the receiver's feed has the sender's call — don't accidentally match the sender's ownSENTrow. - Don't skip
localStorage.clear()— JS8 persistsjs8Openand the last callsign; a clean slate avoids reopening the panel mid-init and stale calls. - Stale Playwright
ref=handles re-render constantly; drive viabrowser_evaluate+ the stable IDs above. - Screenshots are sandboxed to the project dir /
.playwright-mcp/;/tmpis rejected. - Never transmit on a physically-connected rig — virtual-bench only (no real RF).