Use as a checklist.
.auth/storageState.json).
Classification: API 401/403 = environment/credentials/endpoint contract. Do not treat as flaky.
Each test must pass when run alone. Each test must not require another test to run first.
| INPUT |
Authenticated user (API + UI) Clean or irrelevant prior state Unique test data generator |
| OUTPUT |
Deterministic records created via API UI reflects created state immediately |
| DETERMINISM |
Unique identifiers per run No shared state between tests No ordering dependency |
| FAILURE SIGNAL |
UI cannot find seeded data → state propagation or API issue API 401/403 → auth/environment contract failure Duplicate/collision → test data generator failure |
| Unique data | All created entities use a unique suffix (timestamp + random). |
| No ordering | No “A then B” dependencies. Any test can run first. |
| API seeds | Setup performed via API unless the UI flow is the subject under test. |
| Auth centralized | Auth created once (global setup) and reused (storage state + API context). |
| Config explicit | WEB_BASE_URL and API_BASE_URL are required (no implicit defaults). |
Unique data generator: helpers/testData.js (timestamp + random suffix).
API_BASE_URL missing.WEB_BASE_URL (or legacy BASE_URL) missing.fixtures/global-setup.js performs API auth preflight and writes storage state..auth/emptyState.json.helpers/apiClient.js).export WEB_BASE_URL="http://sut.testlab:3000"
export API_BASE_URL="http://sut.testlab:3001/api"
export RW_USER_EMAIL="YOUR_USER_EMAIL"
export RW_USER_PASSWORD="YOUR_USER_PASSWORD" npx playwright test specs/sprint5 --project=auth-chromium --workers=1 --reporter=line npx playwright test specs/sprint5 --project=auth-chromium -g "S5.003" --workers=1 --reporter=line Re-run is expected to create new records. If the app enforces uniqueness constraints, update test data generator to avoid collisions.
test-results/ (per-test artifacts)playwright-report/ (HTML report)API_BASE_URL or WEB_BASE_URL.
Action: print env and correct file load.
RW_USER_EMAIL/RW_USER_PASSWORD and API_BASE_URL includes /api.
echo "WEB_BASE_URL=$WEB_BASE_URL"
echo "API_BASE_URL=$API_BASE_URL"
echo "RW_USER_EMAIL=$RW_USER_EMAIL"
# Optional reachability
curl -sS -I "$WEB_BASE_URL/" | head -n 3
curl -sS -I "$API_BASE_URL/tags" | head -n 3 | UPSTREAM | Sprint 4 — Flake control and environment discipline |
| DOWNSTREAM |
Sprint 6 — Time-to-signal (fast failure visibility) Sprint 14 — Structured failure artifacts Sprint 15 — Failure triage classification Sprint 17 — Release gate decision |
If state is not deterministic here, all downstream signals become unreliable. This runbook ensures failures are attributable to the system under test—not test design.