super-productivity/scripts/wait-for-app.sh
Johannes Millan 40d7118e17 feat(e2e): add Docker-based E2E test isolation
Add Docker setup for running E2E tests with the Angular dev server
containerized while Playwright runs on the host. Supports multiple
instances via configurable ports.

New files:
- Dockerfile.e2e.dev: Dev server image
- docker-compose.e2e.yaml: E2E orchestration config
- scripts/wait-for-app.sh: Health check script

New npm scripts:
- e2e:docker: Run E2E with containerized app
- e2e:docker:webdav: Same but includes WebDAV for sync tests

Usage: APP_PORT=4343 npm run e2e:docker
2026-01-04 17:09:39 +01:00

21 lines
498 B
Bash
Executable file

#!/bin/bash
# Wait for the Angular dev server to be ready
PORT=${APP_PORT:-4242}
MAX_WAIT=${MAX_WAIT:-180}
INTERVAL=2
echo "Waiting for app on port $PORT (max ${MAX_WAIT}s)..."
elapsed=0
until curl -sf "http://localhost:$PORT" > /dev/null 2>&1; do
if [ $elapsed -ge $MAX_WAIT ]; then
echo "Timeout: App did not start within ${MAX_WAIT}s"
exit 1
fi
sleep $INTERVAL
elapsed=$((elapsed + INTERVAL))
echo " Still waiting... (${elapsed}s)"
done
echo "App is ready on port $PORT!"