# Journey E2E Coverage Design

Audience: AI coding agents first.

## Goal

Derive executable Playwright coverage for UJ-001 through UJ-020 and make `docs/ui_matrix/matrix.js` authoritative for every supported admin page × actor row.

## Decisions

- Preserve existing generated specs; repair valid UI paths and shared helpers in place.
- Keep one spec and one manifest per journey. Each spec contains H1, A1, and P1 tests.
- Use WordPress REST/UI factories for users, posts, languages, jobs, and plugin fixtures. Never mutate business state with SQL.
- Use immutable shared fixtures only for deterministic plugin/WPML/cache/downstream prerequisites. Use unique test-owned state for mutable entities.
- Use exact request method/path, exact response status/body fields, visible business values, authoritative state projections, fresh reads, and forbidden-effect assertions.
- Use `createLowerCapability` for authenticated editor boundaries; use anonymous contexts only where contract setup says no authenticated session.
- Attach runtime failure capture to every browser journey and reject unexpected page errors, console errors/warnings, and journey-owned request failures.
- Keep execution tags and manifests synchronized with discovered branches.

## Source conflicts

- UJ-017 documents `/wp-json/international-press-zone/v1/mpz/v1/migration/*`; `MigrationRestController` registers `/wp-json/mpz/v1/migration/*`. Record as source conflict; test real registered route.
- UJ-010 through UJ-020 permission branches document `401` for authenticated lower-capability actors. WordPress permission callbacks and controller guards return `403` for logged-in users. Record source conflicts; do not hide them with anonymous sessions.

## Verification

1. Journey validator: all UJ files and catalog are `VALID`.
2. Playwright `--list`: 60 journey cases plus matrix cases are discovered; no skipped/fixme tests.
3. JavaScript syntax/lint/type checks cover support, journey specs, manifests, matrix authority, and matrix spec.
4. Targeted Chromium execution runs through `/home/user/.claude/bin/e2e-remote` and proves available local fixtures; missing external fixtures fail loudly.
