You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.6 KiB
2.6 KiB
E2E Integration Tests Plan
Objective
Implement end-to-end integration tests that validate real request paths from frontend test clients to gateway, backend services, and PostgreSQL/Redis persistence.
Scope
- Validate real backend integration through gateway (
/api/v1). - Assert persistence side effects in service databases.
- Keep existing fast frontend-only Playwright tests unchanged.
- Add a dedicated full-stack Playwright suite and dedicated environment bootstrap.
Success Criteria
- A dedicated command starts full-stack dependencies and runs integration E2E tests.
- At least 3 golden scenarios are covered with API + DB assertions.
- CI-ready artifacts and deterministic reset/seed flow are in place.
- Frontend lint/unit/E2E checks still pass.
Phases
Phase 1: Dedicated Full-Stack Environment
- Create an E2E env file for compose with isolated ports.
- Reuse production compose stack with auth disabled for test mode.
- Add global setup/teardown scripts for Playwright to:
- boot required services,
- wait for health readiness,
- reset DB state before suites.
Phase 2: Data Reset + DB Assertion Tooling
- Add helper utilities to execute SQL assertions against Postgres in Docker.
- Add deterministic DB reset/truncate helpers across service databases.
- Add optional seed helpers for initial baseline data.
Phase 3: Full-Stack Test Scenarios
- Leaderboard persistence and UI rendering:
- POST update through gateway,
- assert row in
leaderboards.leaderboard_entries, - verify frontend leaderboard page renders persisted player.
- Admin question CRUD persistence:
- create/update/delete question through gateway admin endpoints,
- assert
questions.questionsrow state after each operation.
- Gateway + service health and contract checks:
- verify integration health endpoints and stable response envelopes.
Phase 4: Commands and CI Integration
- Add dedicated Playwright config for full-stack suite.
- Add
frontendscript to run full-stack E2E. - Add
makecommand wrapper for full-stack E2E. - Keep this suite separate from fast frontend-only E2E.
Phase 5: Stabilization
- Use deterministic IDs and explicit cleanup.
- Force serial execution for integration suite to avoid DB race conditions.
- Collect actionable failure outputs (HTTP body + SQL counts) in assertions.
Deliverables
infrastructure/e2e/.env.e2efrontend/apps/web/playwright.fullstack.config.tsfrontend/apps/web/e2e/full-stack/*tests + helpers + setup/teardownfrontend/package.jsonscript additionsMakefiletarget additions