Skip to content

feat: add Playwright e2e suite and run it in CI#5

Merged
SomaticIT merged 1 commit into
mainfrom
claude/svelte-remote-functions-lib-nhgm2b
Jul 14, 2026
Merged

feat: add Playwright e2e suite and run it in CI#5
SomaticIT merged 1 commit into
mainfrom
claude/svelte-remote-functions-lib-nhgm2b

Conversation

@SomaticIT

Copy link
Copy Markdown
Contributor

What

Turns the ad-hoc Playwright verification used in previous PRs into a real, versioned e2e suite that CI runs on every push/PR, catching in-browser regressions that jsdom unit tests can't (real event loop, real DOM/forms, real Svelte reactivity flushing).

Contents

  • e2e/playground.spec.ts — 8 tests driving the vite playground:
    • query: lazy load + render, identical-call dedup, refresh()
    • command: optimistic withOverride visible while the command is pending, then the committed value after the single-flight refresh, surviving a manual refresh
    • form: invalid submission populates issues and skips the mutation; successful submission stores result, clears issues, and the default refresh-all propagates to the query section
    • live query: streams values, reports connected
    • a no-page-errors guard (console + pageerror)
  • playwright.config.ts — starts the vite dev server itself (webServer), retries + GitHub reporter on CI, and honors PLAYWRIGHT_CHROMIUM_PATH so sandboxed sessions use a preinstalled browser instead of downloading one.
  • Playground tweaks for determinism: addLike.pending is now rendered (like-pending testid) so the optimistic-update test asserts on reactive state transitions (pending: 1 → value visible → pending: 0 → value confirmed) instead of racing timers; the like command is deliberately slow (400ms) to widen the observation window.
  • CI: new Install Playwright browser + End-to-end tests steps after the build.
  • Instructions updated: CLAUDE.md commands, the verify skill (step 4 = npm run test:e2e; behavioral changes should extend the playground + suite rather than be verified by hand), the kit-parity skill (step 6 references the suite), README dev section, and the settings allow-list. Also fixed a stale verify skill reference to the old vitest poolOptions location after the dependency upgrade.

Verification

  • Locally (preinstalled Chromium): 8/8 e2e tests pass, dev server auto-started by Playwright.
  • Full gate remains green on main's upgraded toolchain: svelte-check 0/0, vitest 103/103, svelte-package + publint clean, prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EJj9ab3v9HjudgX8L1x821


Generated by Claude Code

Ports the ad-hoc playground verification into a real @playwright/test suite
(e2e/playground.spec.ts, 8 tests): query rendering/dedup/refresh, command with
optimistic .updates() observed deterministically via an exposed pending counter,
form validation/success/refresh-all, live query streaming, and a no-page-errors
guard. CI installs Chromium and runs the suite after the build; locally
PLAYWRIGHT_CHROMIUM_PATH points at a preinstalled browser. Instructions updated
in CLAUDE.md, the verify and kit-parity skills, and the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EJj9ab3v9HjudgX8L1x821
@SomaticIT
SomaticIT merged commit 63b061b into main Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants