test: add authenticated staging smoke helper

This commit is contained in:
a.tolmachev
2026-04-07 13:08:32 +03:00
parent e3cd02aa7e
commit 09e6260e32
9 changed files with 136 additions and 12 deletions
+17
View File
@@ -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
```
+32
View File
@@ -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