Skip to content

test(e2e): cover data-driven pages with seeded local fixtures#55

Merged
nojibe merged 2 commits into
mainfrom
claude/e2e-test-coverage-u43qyf
Jul 2, 2026
Merged

test(e2e): cover data-driven pages with seeded local fixtures#55
nojibe merged 2 commits into
mainfrom
claude/e2e-test-coverage-u43qyf

Conversation

@nojibe

@nojibe nojibe commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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 storageService uses the local provider, 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

  • Fixtures (tests/e2e/fixtures/results/, mirroring the on-disk layout the storage service expects):
    • live/aggregates/homepage_summary.json — drives the homepage
    • live/aggregates/latest_runs_summary.json — drives /latest (via /api/runs/latest)
    • live/blueprints/test-eval/test-run_<ts>/core.json — a full WevalResult (2 models, 2 prompts, coverage scores) driving /analysis/*
  • Seeding harnessglobalSetup seeds .results/ before the dev server boots; globalTeardown restores 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 when E2E_BASE_URL targets a remote app.
  • New specs: homepage.spec.ts, latest.spec.ts, analysis.spec.ts assert 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.
  • Fixture identifiers are centralized in tests/e2e/fixtures/constants.ts.
  • Updated tests/e2e/README.md and the smoke.spec.ts header to document the approach.
  • Gitignore the local node-compile-cache/ tooling artifact.

Test plan

  • pnpm test:e2e8/8 pass (4 new + existing smoke tests).
  • Verified globalTeardown leaves no residue in .results/.
  • Captured screenshots of all three pages rendering from the seeded fixtures (full macro coverage table + leaderboard on /analysis, populated /latest table, 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

claude added 2 commits July 1, 2026 19:18
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
@railway-app railway-app Bot temporarily deployed to weval / app-pr-55 July 1, 2026 22:07 Destroyed
@railway-app

railway-app Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚅 Deployed to the app-pr-55 environment in weval

Service Status Web Updated (UTC)
weval-app ✅ Success (View Logs) Web Jul 1, 2026 at 10:16 pm

@nojibe nojibe merged commit d74e832 into main Jul 2, 2026
2 checks 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