test(e2e): full Playwright/WebKit suite over a mocked Tauri bridge#7
Merged
Conversation
Adds an end-to-end suite that walks every primary flow on every PR without any real network, auth, SSO, or platform calls. Playwright drives the real prod bundle (vite build --mode e2e -> preview) on WebKit (the engine the Tauri webview ships). A stateful in-memory fake intercepts the two backend seams — window.__TAURI_INTERNALS__.invoke (Simplicate, Gemini, keychain, plugin:fs/path) and fetch (GitHub, Linear, Google Calendar, OAuth) — so booking adds an entry a later read returns, submitting locks the week, etc. Coverage: restore/existing-hours, verwerk day + week, timeline edit + delete, boeken (+ real-error regression guard), leftover dismiss/book, indienen (+ submitted read-only), clear day/week, settings, no-history warning, entry edit/delete, week nav + connection banner. 20 specs, all green. - Auth is always seeded (no UI login); the store is exposed only in the e2e build (import.meta.env.MODE === 'e2e'), inert in dev/prod. - Determinism via a frozen clock + fixtures keyed to it; WebKit only. - New required-able `e2e` job in ci.yml; data-testids added to dynamic UI. See docs/adr/0005-e2e-playwright-mocked-tauri-bridge.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
A full end-to-end suite that walks every primary user flow on every PR — without any network, auth, SSO, or platform calls. This directly targets the recurring problem of features breaking when new ones land.
Playwright drives the real production bundle (
vite build --mode e2e→vite preview) on WebKit (the engine the Tauri webview actually ships). The store, hooks, usecases, deterministic packer, timeline and leftover sidebar all run for real — only the backend is faked.How it works
The whole backend reduces to two seams, both intercepted in the browser by a stateful in-memory fake (
tests/e2e/bridge/fakeBridge.ts):window.__TAURI_INTERNALS__.invoke— Simplicate (simplicate_request), Gemini, keychain, and theplugin:fs|*/plugin:path|*IPC the storage layer rides on.window.fetch— GitHub, Linear, Google Calendar, Google OAuth.State is mutable: booking adds an hour entry a later week-read returns (blue), submitting locks the week read-only, delete/edit mutate. So flows are tested by cause→effect, not by asserting a call was made.
import.meta.env.MODE === 'e2e') and is inert in dev/prod.page.clock) + fixtures keyed to it; timezone pinned toEurope/Amsterdam.data-testidadded only to dynamic items.See
docs/adr/0005-e2e-playwright-mocked-tauri-bridge.mdfor the full rationale and the alternatives considered (tauri-driver, vitest browser mode, Chromium).Flows covered (20 specs, all green locally)
restore → existing hours · verwerk day · verwerk week · timeline edit + delete-from-timeline · boeken (+ a regression guard that a failed booking surfaces the real Simplicate error, not "Boeken mislukt") · leftover dismiss/book · indienen (+ submitted week is read-only on load) · clear day/week · settings · no-history warning · entry edit/delete · week navigation + connection banner.
CI
New
e2ejob inci.yml(parallel to the unit/coverage job): installs WebKit + system deps, builds the prod bundle, runs the suite, uploads the Playwright report/trace on failure.E2E (Playwright / WebKit)check as required in branch protection so a red e2e blocks merge — that's a GitHub setting, not code.Notes
v8 ignore'd).vitestnow excludestests/e2e/**.🤖 Generated with Claude Code