Files
plainpages/compose.e2e.yml

39 lines
1.7 KiB
YAML

# Playwright E2E. Brings up the app + a Playwright runner, screenshots the live pages and the
# html-css-foundation mockups, and asserts the live DOM computes the same design styles.
# docker compose -f compose.yml -f compose.e2e.yml run --build --rm e2e
# docker compose -f compose.yml -f compose.e2e.yml down -v # tear down after
# --build rebuilds the runner (the image bakes in e2e/) so spec edits are picked up.
# Screenshots + HTML report land in ./e2e/artifacts/ (git-ignored).
services:
web:
# The dashboard renders mock data — no Ory needed. Drop the base file's kratos/keto
# dependency so the visual suite stays fast and doesn't boot Postgres + the Ory stack.
depends_on: !reset []
# Dev throwaways are fine for tests; cache templates for production-like rendering.
environment:
CACHE_TEMPLATES: "true"
REQUIRE_SECURE_SECRETS: "false"
SECURE_COOKIES: "false" # the suite hits web over http — Secure cookies wouldn't be stored
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:3000/"]
interval: 2s
timeout: 4s
retries: 15
e2e:
build:
context: .
dockerfile: Dockerfile.e2e
# Just the Ory-free visual suite; the full-stack auth spec runs via compose.e2e-auth.yml.
command: ["npx", "playwright", "test", "visual.spec.ts"]
depends_on:
web:
condition: service_healthy
environment:
BASE_URL: http://web:3000
volumes:
# The mockups + their stylesheet, kept as siblings so file:// ../public/css resolves.
- ./html-css-foundation:/repo/html-css-foundation:ro
- ./public:/repo/public:ro
- ./e2e/artifacts:/e2e/artifacts