Download this file
| 1 | #!/usr/bin/env bash |
| 2 | # Runs the shared behaviour suite against one app, with JavaScript on and off. |
| 3 | # Usage: scripts/test-app.sh <base-url> [results.json] |
| 4 | set -euo pipefail |
| 5 | [ $# -ge 1 ] || { echo "usage: $0 <base-url> [results.json]" >&2; exit 2; } |
| 6 | here=$(cd "$(dirname "$0")/../tests/behaviour" && pwd) |
| 7 | results=${2:-} |
| 8 | [ -z "$results" ] || results=$(cd "$(dirname "$results")" && pwd)/$(basename "$results") |
| 9 | cd "$here" |
| 10 | if [ ! -d node_modules/@playwright/test ]; then |
| 11 | npm ci --cache "${TMPDIR:-/tmp}/npm-cache" --no-audit --no-fund >/dev/null |
| 12 | fi |
| 13 | BASE_URL="$1" RESULTS_FILE="$results" exec npx playwright test --project js-on --project js-off |
| 14 | |