test: add authenticated staging smoke helper
This commit is contained in:
@@ -9,3 +9,20 @@ Usage:
|
||||
```bash
|
||||
./scripts/staging-smoke.sh https://rmcp.itexp.me
|
||||
```
|
||||
|
||||
## authenticated-staging-smoke.sh
|
||||
|
||||
Browser-authenticated smoke helper for staging/production-like environments.
|
||||
|
||||
Required environment variables:
|
||||
|
||||
- `CRANK_STAGING_ADMIN_EMAIL`
|
||||
- `CRANK_STAGING_ADMIN_PASSWORD`
|
||||
|
||||
Usage:
|
||||
|
||||
```bash
|
||||
CRANK_STAGING_ADMIN_EMAIL=owner@example.com \
|
||||
CRANK_STAGING_ADMIN_PASSWORD=secret \
|
||||
./scripts/authenticated-staging-smoke.sh https://rmcp.itexp.me
|
||||
```
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "usage: $0 <base-url>" >&2
|
||||
echo "example: $0 https://rmcp.itexp.me" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
if [[ -z "${CRANK_STAGING_ADMIN_EMAIL:-}" ]]; then
|
||||
echo "CRANK_STAGING_ADMIN_EMAIL is required" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
if [[ -z "${CRANK_STAGING_ADMIN_PASSWORD:-}" ]]; then
|
||||
echo "CRANK_STAGING_ADMIN_PASSWORD is required" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
BASE_URL="${1%/}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
|
||||
echo "authenticated staging smoke: ${BASE_URL}"
|
||||
|
||||
cd "${REPO_ROOT}/apps/ui"
|
||||
PLAYWRIGHT_BASE_URL="${BASE_URL}" \
|
||||
PLAYWRIGHT_SKIP_WEB_SERVER=1 \
|
||||
CRANK_E2E_ADMIN_EMAIL="${CRANK_STAGING_ADMIN_EMAIL}" \
|
||||
CRANK_E2E_ADMIN_PASSWORD="${CRANK_STAGING_ADMIN_PASSWORD}" \
|
||||
npx playwright test tests/e2e/staging-authenticated.spec.js
|
||||
Reference in New Issue
Block a user