User: «Enlève également le workflow d'un test, quand on saisit des
informations côtés redteam cela signifie qu'il a été exécuté et donc
en attente d'une review blueteam.»
Backend (update_mission_test_fields)
- At the end of every PUT, inspect the touched-field set:
- any red write on state in {pending, skipped, blocked} → state=executed
+ auto-stamp executed_at=now() if absent
- any blue write on state=executed → state=reviewed_by_blue
- /transition endpoint kept for back-fill/admin use, not called from UI.
Frontend MissionTestPage
- Removed the transition-buttons header block and the `transition`
mutation. State pill stays as a passive indicator.
- New labels: "Not started" / "Awaiting review" / "Reviewed" describe
the implicit lifecycle, no longer exposing the state-machine concept.
E2E
- The SPA test that clicked `transition-executed` now verifies the
implicit promotion: typing red fields and saving flips the pill from
"Not started" → "Awaiting review", no button click required.
Spec
- §4 reword: "Cycle de vie implicite, piloté par les écritures" replaces
the old "Workflow par test instance" bullet.
Tests
- 3 new pytest: red_command-alone implicit execute + auto-stamp,
blue write promotes executed→reviewed, blue write on pending no-op.
- 142 pytest + 49 Playwright green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Metamorph e2e
End-to-end tests powered by Playwright. Each milestone in tasks/todo.md should add at least one spec file (tests/m<N>-*.spec.ts).
One-time setup
cd e2e
npm install
npm run install-browsers # downloads chromium (uses sudo for system deps)
Running against a live stack
# 1. Bring the stack up from the repo root:
cd .. && make up
# 2. Run the tests:
cd e2e && npm test
# 3. Open the HTML report:
npm run report # opens playwright-report/index.html in your browser
Or from the repo root:
make e2e # runs against the already-up stack
make e2e-report # opens the HTML report
make e2e-up # one-shot: make up + wait healthy + run tests
Auto-spawn mode
Set PW_AUTOSTART=1 to let Playwright spawn make up itself before the run:
PW_AUTOSTART=1 npm test
Configuration
| Env var | Default | Purpose |
|---|---|---|
BASE_URL |
http://localhost:8080 |
The front nginx URL (which proxies /api/*) |
PW_AUTOSTART |
0 |
If 1, spawn make up before the tests |
CI |
unset | When set, retries=2 and parallel workers=2 |
Reports
- HTML :
e2e/playwright-report/index.html - JUnit :
e2e/playwright-report/junit.xml(CI ingestion) - Trace : kept on first retry, opened with
npx playwright show-trace …
Layout
e2e/
├── tests/
│ └── m0-smoke.spec.ts # bootstrap milestone (current)
│ └── m<N>-*.spec.ts # one spec per milestone, added as features land
├── playwright.config.ts
├── tsconfig.json
└── package.json