test(e2e): cover data-driven pages with seeded local fixtures#55
Merged
Conversation
The Playwright suite previously only exercised static, dependency-free routes (/about). The homepage, /latest, and /analysis/* read from storage but do not call LLMs at render time, so they can be tested against seeded local-filesystem fixtures without S3 credentials or network. - Add fixtures under tests/e2e/fixtures/results/ mirroring the on-disk layout the storage service reads in local mode (homepage_summary.json, latest_runs_summary.json, and a run's core.json). - Seed .results/ via a Playwright globalSetup before the dev server boots and restore it in globalTeardown. Seeding is non-destructive: a pre-existing local .results/ is backed up and restored. - Add homepage.spec.ts, latest.spec.ts, analysis.spec.ts asserting the pages render real seeded content (plus a not-found case for analysis). - Update README and smoke.spec header to document the approach. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fcVfeTRvAkX43a1aHhJWC
The node-compile-cache/ directory is a local tsx/NODE_COMPILE_CACHE artifact, not a source file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fcVfeTRvAkX43a1aHhJWC
Contributor
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.
Summary
The Playwright e2e suite previously only exercised static, dependency-free routes (
/about). This PR extends it to the data-driven pages — the homepage (/),/latest, and/analysis/*— without needing S3 credentials or live LLM calls.The key insight: these pages read from storage but do not call LLMs at render time, and in dev/test mode the app's
storageServiceuses thelocalprovider, reading results from the.results/directory on disk. So we seed.results/with deterministic fixtures instead of mocking the network (which wouldn't work for the server-rendered pages anyway).Changes
tests/e2e/fixtures/results/, mirroring the on-disk layout the storage service expects):live/aggregates/homepage_summary.json— drives the homepagelive/aggregates/latest_runs_summary.json— drives/latest(via/api/runs/latest)live/blueprints/test-eval/test-run_<ts>/core.json— a fullWevalResult(2 models, 2 prompts, coverage scores) driving/analysis/*globalSetupseeds.results/before the dev server boots;globalTeardownrestores it. Seeding is non-destructive: a pre-existing local.results/has overwritten files backed up and restored, and only added files/dirs are removed. Both are skipped whenE2E_BASE_URLtargets a remote app.homepage.spec.ts,latest.spec.ts,analysis.spec.tsassert the pages render real seeded content (models by display name, coverage table, latest-runs API payload), plus a not-found case for a non-existent analysis run.tests/e2e/fixtures/constants.ts.tests/e2e/README.mdand thesmoke.spec.tsheader to document the approach.node-compile-cache/tooling artifact.Test plan
pnpm test:e2e→ 8/8 pass (4 new + existing smoke tests).globalTeardownleaves no residue in.results/./analysis, populated/latesttable, homepage featured blueprint).Risks
Low. Changes are confined to the test suite and fixtures; no application code is touched. Pages that genuinely call LLM APIs at request time (sandbox runs, story generation) remain out of scope and would still need real env vars or
page.route(...)mocks.🤖 Generated with Claude Code
https://claude.ai/code/session_019fcVfeTRvAkX43a1aHhJWC
Generated by Claude Code