#!/usr/bin/env bash # devbox run e2e: the headless-browser gate (TESTING 10.3). Separate from `devbox run test` so the # fast server gate stays fast (TESTING 11.1 note in #66). Requires the root devbox's `chromium` and # the e2e/ npm dependency (`playwright-core`); the client build test in T4+ extends this script. set -euo pipefail cd "$(dirname "$0")/.." || exit 1 mkdir -p results export CHROMIUM="${CHROMIUM:-$(command -v chromium || true)}" if [ -z "$CHROMIUM" ]; then echo "e2e: chromium not found; it is a root devbox package (devbox.json) - run inside devbox" >&2 exit 1 fi # npm deps stay out of tools/ (TESTING 10.4) and out of git; install once per checkout. ( cd e2e && { [ -d node_modules ] || npm ci --no-audit --no-fund; } ) node --test --test-concurrency=1 --test-reporter=spec e2e/*.test.mjs > results/e2e.log 2>&1 rc=$? cat results/e2e.log exit $rc