The 11-admin spec walked links that terminate on FrankBook-Pro (192.168.0.112), which sleeps when idle — every deploy gate timed out there (measured 2026-10-05, two deploy windows). Split: the frankbook links move to tests/e2e/specs/19-frankbook.spec.ts under a frankbook project that run.sh excludes by default and deploy.sh triggers ONLY when a frankbook blast-radius path changed (the spec, frankbook-pro/, the homepage registry, the Caddyfile arr vhosts). deploy.sh computes the trigger from the same BASE..HEAD revision range the plan uses.
54 lines
1.8 KiB
Bash
Executable File
54 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Playwright e2e for the homepage and the Anubis -> Authentik guard chain.
|
|
# Drives the LIVE fleet, so it needs real credentials and is deliberately NOT
|
|
# part of ./tests/run.sh. Credentials live in tests/e2e/.env.local
|
|
# (git-ignored; see .env.local.example). Usage:
|
|
#
|
|
# tests/e2e/run.sh # full suite (frankbook project excluded)
|
|
# tests/e2e/run.sh --project guest # any playwright args pass through
|
|
#
|
|
# The frankbook project (19-frankbook.spec.ts — the *arr/qBittorrent walk)
|
|
# is NOT in the default project set: its links terminate on FrankBook-Pro,
|
|
# which sleeps when idle, so it must not gate unrelated deploys. deploy.sh
|
|
# sets E2E_INCLUDE_FRANKBOOK=1 when a frankbook trigger path changed. An
|
|
# explicit --project argument in "$@" bypasses the default set entirely.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
if [ ! -f .env.local ]; then
|
|
echo "tests/e2e/.env.local missing — copy .env.local.example and fill in the IdP credentials" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d node_modules ]; then
|
|
if [ -f package-lock.json ]; then
|
|
npm ci --no-audit --no-fund
|
|
else
|
|
npm install --no-audit --no-fund
|
|
fi
|
|
fi
|
|
|
|
npx playwright install chromium
|
|
|
|
# Default project set; the frankbook project joins only when deploy.sh saw a
|
|
# frankbook trigger path (E2E_INCLUDE_FRANKBOOK=1). An explicit --project in
|
|
# "$@" takes over untouched.
|
|
DEFAULT_PROJECTS=(setup standard admin guest)
|
|
if [[ "${E2E_INCLUDE_FRANKBOOK:-0}" == "1" ]]; then
|
|
DEFAULT_PROJECTS+=(frankbook)
|
|
fi
|
|
has_project=0
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--project|--project=*) has_project=1 ;;
|
|
esac
|
|
done
|
|
if [[ "$has_project" -eq 1 ]]; then
|
|
exec npx playwright test "$@"
|
|
fi
|
|
PROJECT_ARGS=()
|
|
for project in "${DEFAULT_PROJECTS[@]}"; do
|
|
PROJECT_ARGS+=(--project "$project")
|
|
done
|
|
exec npx playwright test "${PROJECT_ARGS[@]}"
|