8 new spec files covering sections previously only smoke-tested:
- ai-endpoints-contract.spec.js — hits 8 real AI endpoints via request
context and fails if the response leaks TypeError / ReferenceError /
'Cannot read properties of undefined' / 'is not defined' / 'is not a
function'. This is the class of bug that shipped the PE-narrative
regression to prod because every page-level mock prevented the real
handler from running.
- encounter-workflow.spec.js — generate HPI, refine, clear transcript.
- encounter-save-load.spec.js — save draft, load popover, repopulate.
- wellvisit-workflow.spec.js — byvisit, milestones, SSHADESS (12+
reveal), visit note.
- vaxschedule-content.spec.js — schedule + catch-up panels populate
beyond "Loading".
- chart-review-workflow.spec.js — generate + load popover.
- learning-tab.spec.js — search filter, category pills, feed.
- settings-faq-dictation.spec.js — voice/password/2FA/Nextcloud
sections, FAQ expand/collapse, dictation generate flow.
Baseline fixes:
- Added CORS_ORIGINS + API_RATE_LIMIT_MAX env overrides so the e2e
container accepts the browser's Origin header and can absorb the
full suite's API traffic without tripping the 200/min guard.
- Server's /api/ rate limit is now configurable via
API_RATE_LIMIT_MAX (default stays 200).
- extensions-crud: replaced native page.on('dialog') listeners with
#confirm-modal-ok clicks (we moved off native confirm()).
- pe-guide-smoke + extensions-crud: mobile viewport opens the hamburger
before clicking sidebar tabs.
- fixtures.js: /api/refine mock uses 'refined' (real API shape), not
'content'. /api/chart-review replaced with /api/generate-chart-review.
Suite: 230 passed / 0 failed in 4m36s.
56 lines
2.3 KiB
YAML
56 lines
2.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 entirely — both server-side verification AND the
|
|
# client-side widget. Without clearing the SITE_KEY the frontend tries
|
|
# to initialise the Turnstile iframe against the prod domain and
|
|
# throws error 110200, which Playwright's pageerror guard correctly
|
|
# flags as an uncaught exception.
|
|
TURNSTILE_SECRET_KEY: ""
|
|
TURNSTILE_SITE_KEY: ""
|
|
# Disable SMTP so register auto-verifies the user and returns a session
|
|
SMTP_HOST: ""
|
|
# Raise the login rate-limit so Playwright multi-worker runs don't
|
|
# trip the production 10/15min cap. Only affects this e2e container.
|
|
LOGIN_RATE_LIMIT_MAX: "500"
|
|
# Also raise the global /api/ limit so multi-spec Playwright runs
|
|
# that make hundreds of API calls don't burn through the 200/min cap.
|
|
API_RATE_LIMIT_MAX: "5000"
|
|
# Allow fetches from the two origins Playwright serves tests from —
|
|
# the in-network hostname and the host-port loopback. Without this
|
|
# the CORS middleware (scoped to /api) rejects any non-GET request
|
|
# because .env's APP_URL points at the production domain.
|
|
CORS_ORIGINS: "http://pediatric-ai-scribe-e2e:3000,http://host.docker.internal:3553,http://localhost:3553"
|
|
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:
|