pediatric-ai-scribe-v3/docker-compose.e2e.yml
Daniel 29f37b331e test(e2e): stage 2 — auth-gated pages (11 tabs × 2 viewports, 22 tests)
Adds a second containerized instance of the app with Turnstile + SMTP
disabled so Playwright can log in without a bot challenge.

- docker-compose.e2e.yml: pediatric-ai-scribe-e2e on port 3553. Shares
  postgres + pgdata with main so seeded test users (*@ped-ai.test) persist.
- Test user: e2e-user@ped-ai.test (created once via /api/auth/register
  against the e2e container — SMTP is off so register auto-verifies).
- Tests log in once per worker via /api/auth/login (module-scoped token
  cache) then inject the ped_auth cookie into each test's browser context.
  This avoids the 10-per-15-min login rate-limit.
- Mobile viewport opens the sidebar via #btn-menu-toggle before clicking
  tab buttons (which are hidden behind the hamburger <=768px).

Coverage: encounter, wellvisit, chart, vaxschedule, catchup, learning,
dictation, settings, calculators, faq + landing-page-after-login. Each
test clicks the tab, waits for the lazy component to render (>100 chars),
and asserts a known anchor string is present.

Total suite: 128 tests passing (53 desktop + 53 mobile Bedside/top-calcs +
11 desktop + 11 mobile auth-gated).
2026-04-21 01:48:17 +02:00

40 lines
1.3 KiB
YAML

# E2E test environment — runs a second instance of the app on port 3553 with
# Turnstile disabled so Playwright can log in without the bot challenge.
# Shares the postgres + pgdata volume with production so seeded e2e test users
# (email pattern *@ped-ai.test) persist across test runs.
#
# Bring up with:
# docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d pediatric-scribe-e2e
#
# Tear down with:
# docker compose -f docker-compose.yml -f docker-compose.e2e.yml down pediatric-scribe-e2e
services:
pediatric-scribe-e2e:
build: .
image: ped-ai-local:latest
ports:
- "127.0.0.1:3553:3000"
env_file:
- .env
environment:
# Disable Turnstile bot-check so tests can log in without a challenge
TURNSTILE_SECRET_KEY: ""
# Disable SMTP so register auto-verifies the user and returns a session
SMTP_HOST: ""
volumes:
- scribe-logs-e2e:/app/data/logs
depends_on:
postgres:
condition: service_healthy
container_name: pediatric-ai-scribe-e2e
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 20s
volumes:
scribe-logs-e2e: