feat: add Playwright E2E tests for Fast and Agent search#5
Merged
doodlewind merged 1 commit intomainfrom Mar 27, 2026
Merged
Conversation
c4cc701 to
045996d
Compare
- Add fixture JSONL sessions with canary keywords for deterministic testing
- Add ACP mock agents (success + error) speaking JSON-RPC 2.0 over stdio
- Add SPOOL_DATA_DIR/SPOOL_CLAUDE_DIR/SPOOL_CODEX_DIR env var overrides
in core so tests use isolated temp DB and fixture data
- Add SPOOL_ACP_AGENT_BIN env var to override ACP extension resolution
- Add data-testid attributes to SearchBar, FragmentResults, AiAnswerCard,
StatusBar for reliable test selectors
- Add @playwright/test dependency and test:e2e script
- Add GitHub Actions workflow (macos-latest, no Xvfb needed)
Tests (11):
Fast mode: home view, FTS search, snippet highlighting, metadata,
cross-session search, empty results, mode toggle
Agent mode: ACP streaming + trust label + tool calls + sources,
second query replacement, error handling
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
045996d to
14bdcd8
Compare
graydawnc
added a commit
that referenced
this pull request
Apr 28, 2026
One-time notice for users upgrading from a pre-M5 Spool, plus the cross-cutting documentation cleanup that PR2-#5 deferred. ## Upgrade notice Built as a React modal (not a native dialog) so it matches Spool's design system — warm card, Geist Sans, accent CTA — and shows the real Spool Daemon app icon (copied from spool-lab/spool-daemon). Trigger logic (in main, exposed via IPC): - shouldShow = !shown && !wasNewDb && initialUserVersion < 5 - New users with no prior DB → don't show (no captures to mourn) - Existing users at v0-v4 → show on first launch after upgrade - After dismiss/install click → flag persists, never shown again - User who quits without dismissing → loses the notice (acceptable for an informational nudge; not critical state) The "wasNewDb" + "getInitialUserVersion" helpers are added to packages/core/src/db/db.ts. Both are captured before runMigrations runs so the post-state can't muddy the upgrade detection. uiPreferences now respects SPOOL_DATA_DIR (was hardcoded to ~/.spool/ui.json regardless of env override) — this surfaced during sandbox smoke testing and would have leaked dialog-shown state out of test sandboxes. The "Get Spool Daemon" button uses shell.openExternal to https://spool.pro/daemon (was earlier mistakenly written as spool.dev/daemon in three places — fixed across the dialog, README, and positioning doc). ## Doc cleanup (cross-cutting) - README.md — drop stars/bookmarks/likes from tagline, drop the Connectors bullet, replace with a forward to Spool Daemon, drop the fieldtheory-cli acknowledgement (Twitter bookmarks gone) - DESIGN.md — drop bookmarks/capture from Product Context, rewrite Source Chips + Sources Panel sections to be session-only, drop "Capture / add" icon, fix Status Bar dot color guidance - docs/spool-positioning.md — strip bookmark/star marketing, end with a forward to Spool Daemon - packages/core/README.md — drop "connected sources", "connector sync engine", "connector loader", "connector registry" — replaced with watcher + stars - Deleted docs/connector-developer-guide.md (607 lines) and docs/connector-sync-architecture.md (924 lines) — both exclusively about the removed subsystem docs/superpowers/* historical plans + specs left intact (they're dated git-log-style records, not current docs). ## Tests - Extended migration-v5.test.ts with assertions for the new wasNewDb / getInitialUserVersion helpers on both the upgrade path (wasNewDb=false, initialVersion=4) and the fresh-install path (wasNewDb=true, initialVersion=0). - Smoke verified locally: launching dev against a downgraded v4 sandbox shows the modal with the right icon and copy; clicking either button persists the flag and the modal does not return on re-launch. Net -1466 / +103. Co-authored-by: Chen <99816898+donteatfriedrice@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
Playwright E2E tests that verify both search modes end-to-end: fixture JSONL → sync → SQLite FTS → UI rendering (Fast mode), and ACP mock agent → JSON-RPC streaming → answer card rendering (Agent mode).
Why
Zero automated tests existed. Manual testing can't catch regressions in the sync→index→search→render pipeline or the ACP streaming protocol. These tests run the real Electron app against fixture data and mock agents, catching integration bugs that unit tests would miss.
Changes
Test infrastructure
e2e/helpers/launch.ts— shared Electron launcher with temp dir isolation,waitForSync/searchhelperse2e/mocks/acp-base.mjs— shared ACP JSON-RPC 2.0 transport (NDJSON/stdio)e2e/mocks/acp-mock-agent.mjs— success mock: streams text chunks + tool calle2e/mocks/acp-mock-agent-error.mjs— error mock: returns JSON-RPC error on prompte2e/fixtures/— two JSONL sessions with canary keywords for deterministic searchCore: env var overrides for test isolation
SPOOL_DATA_DIR— override DB location (db.ts)SPOOL_CLAUDE_DIR/SPOOL_CODEX_DIR— override sync directories (syncer.ts, watcher.ts)SPOOL_ACP_AGENT_BIN— override ACP extension resolution (acp.ts)UI: data-testid attributes
search-input,mode-agent,fragment-row,ai-answer-card,ai-answer-text,ai-error,status-textCI
.github/workflows/e2e.yml— matrix on ubuntu-latest + macos-latest, xvfb-run on Linux, electron-rebuild for native modulesTest coverage (11 tests, ~4s)
Submitter: @graydawnc