Set up Playwright for browser testing
- Playwright config for local browsers (Firefox by default) and Docker Chrome - docker-compose.chrome.yml for browserless/chrome container (arm64) - 4 connectivity smoke tests (home, contact, blog pages) - 3 auth tests (redirect, login, logout) with auth helpers - Custom fixtures with remote CDP connect support - Shell scripts for start/stop/full Docker Chrome workflow - Makefile targets: playwright, playwright-docker, playwright-full
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Helper script to start the Playwright Chrome container via Docker
|
||||
# Usage: ./bin/e2e-start.sh
|
||||
#
|
||||
# Starts a browserless/chrome container that Playwright connects to remotely.
|
||||
# The container runs Chrome with DevTools Protocol on port 9222.
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
echo "Starting Chrome container for Playwright e2e tests..."
|
||||
echo "Using docker-compose.chrome.yml"
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
|
||||
# Check if colima is needed (no Docker Desktop)
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "Docker daemon not accessible. Have you started colima or Docker Desktop?"
|
||||
echo " colima start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker compose -f docker-compose.chrome.yml up -d
|
||||
|
||||
echo ""
|
||||
echo "Chrome container started! Check status:"
|
||||
echo " docker compose -f docker-compose.chrome.yml ps"
|
||||
echo ""
|
||||
echo "Run tests:"
|
||||
echo " make playwright"
|
||||
Reference in New Issue
Block a user