Skip to content

test(e2e): Playwright suite — happy path + 2 bug regression guards#9

Closed
abk1969 wants to merge 1 commit into
fix/parcours-ux-bugsfrom
test/e2e-playwright
Closed

test(e2e): Playwright suite — happy path + 2 bug regression guards#9
abk1969 wants to merge 1 commit into
fix/parcours-ux-bugsfrom
test/e2e-playwright

Conversation

@abk1969
Copy link
Copy Markdown
Owner

@abk1969 abk1969 commented May 15, 2026

Summary

Closes the last TDD audit recommendation: end-to-end coverage of the 7-step parcours in a real browser. Stacks on PR #8 (the parcours bug fixes).

This is the final layer of the test pyramid for ai_act_compass:

  • Unit tests (classify.test.js, deliverables.test.js) — 102 tests on pure logic + data invariants
  • Component tests (app.dom.test.jsx) — 4 jsdom smoke tests on React tree mount + state-driven UI
  • E2E tests (this PR) — 4 Playwright tests on real-browser parcours flows

Tests added

# Test Catches
1 Happy path: provider with no triggers → RISQUE_MINIMAL Full-flow rendering, basic verdict
2 Public-body deployer + Annex III §3 → HAUT_RISQUE_ANNEXE_III + FRIA visible PR #3 Item C FRIA gating wiring
3 Integrator + substantialModification + systemic risk → GPAI_RS Regression guard for PR #8 Bug #1 (Step 7 art. 25 flip visibility)
4 Prohibition (h) + carve-out claim → advances to Step 4, NOT verdict Regression guard for PR #8 Bug #2 (short-circuit respecting carve-outs)

Infrastructure

  • New devDep: `@playwright/test`
  • `playwright.config.js` — auto-spawns `npm run dev` on :5173, single Chromium project, retain trace + screenshot on failure (in `test-results/`)
  • `.gitignore` — excludes `test-results/` and `playwright-report/`

Selector strategy

OptionCard renders as `` (single-select) or `` (multi-select). The accessible name composes `<title> — — `. Tests anchor on unique `sub` fragments (`art. 3(3)`, `art. 5(1)(h)`, `art. 5(2)-(3)`, etc.) which are regulatory citations — stable across copy edits.

Not in scope

  • Not wired into `npm test` (Vitest scope only). Run manually: `npx playwright test`
  • CI integration is left to a follow-up (would need a Github Action job that runs `npx playwright install --with-deps` + `npx playwright test`)
  • French-language flows — currently only EN is exercised; a parametrised version covering FR could be added

Test plan

🤖 Generated with Claude Code

Closes the last TDD audit recommendation: end-to-end coverage of the 7-step
parcours in a real browser. Catches the class of bug where the React tree
renders successfully and unit/component tests pass, but the user flow lands
on the wrong screen — exactly what happened pre-PR #8 with the art. 25 flip
unreachable Step 7 and the prohibition short-circuit ignoring carve-outs.

Infrastructure:
- devDep: @playwright/test
- playwright.config.js — auto-spawns `npm run dev` on :5173, single Chromium
  project, retain trace + screenshot on failure
- .gitignore — exclude test-results/ + playwright-report/

Tests (e2e/parcours.spec.js):
1. happy path — provider with no triggers → RISQUE_MINIMAL
2. high-risk deployer Annex III §3 → HAUT_RISQUE_ANNEXE_III + FRIA visible
3. art. 25 flip — integrator + substantialModification + systemic risk →
   GPAI_RS (regression guard for Bug #1 from the parcours audit)
4. art. 5 carve-out claim does NOT short-circuit — user advances to Step 4
   instead of jumping to verdict (regression guard for Bug #2)

Selectors anchor on the OptionCard aria-label, which composes
`<title> — <sub> — <desc>`. Matching unique sub fragments (e.g. "art. 3(3)",
"art. 5(1)(h)", "art. 5(2)-(3)") keeps selectors stable across copy edits.

Run: `npx playwright test` — 4 tests pass in ~25 s. Not wired into
`npm test` (Vitest scope); future CI could add a separate e2e job.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai_act_compass Ready Ready Preview, Comment May 15, 2026 4:01pm

@abk1969
Copy link
Copy Markdown
Owner Author

abk1969 commented May 16, 2026

Merged into main via rebase fast-forward (commits applied via stack rebase, see main's history). Branch deleted.

@abk1969 abk1969 closed this May 16, 2026
@abk1969 abk1969 deleted the test/e2e-playwright branch May 16, 2026 12:45
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.

1 participant