playwright-e2e-docker/templates/docker-compose.yml
Lilith 49b9884089 feat: release v2.0.0 - comprehensive E2E testing infrastructure
Features:
- Device presets (desktop, mobile, tablet, obs-overlay, all, electron)
- Auth setup projects with storage state management
- Cluster mode for Docker nginx multi-app routing
- Multiple reporters (list, html, junit, github)
- WebServer configuration for dev server management
- Enhanced helpers: file upload, platform, performance, accessibility, storage
- GitLab CI templates for package and consumers
- Docker templates: Electron, web-only, cluster compose

Breaking changes from 1.0:
- Enhanced PlaywrightConfigOptions interface with new options
- Exported commonDevices for device configuration access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:33:08 -08:00

48 lines
1.5 KiB
YAML

# E2E Testing Docker Compose Template
#
# Runs mock backend service + Electron app with Playwright tests.
# Copy this to your project's e2e/ directory and customize.
#
# Usage:
# docker compose -f e2e/docker-compose.yml up --build --abort-on-container-exit --exit-code-from e2e-tests
services:
# Mock backend service (customize for your app's dependencies)
# Example: mock-api, mock-llm, mock-database, etc.
mock-service:
build:
context: ..
dockerfile: e2e/mock-service.Dockerfile
# No host port mapping needed - e2e-tests uses internal Docker network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 5s
timeout: 3s
retries: 5
start_period: 2s
# Electron app with Playwright tests
e2e-tests:
build:
context: ..
dockerfile: e2e/Dockerfile
depends_on:
mock-service:
condition: service_healthy
environment:
# Point to mock-service container (customize endpoint name)
- API_ENDPOINT=http://mock-service:8000
# Electron display and GPU settings
- DISPLAY=:99
- ELECTRON_DISABLE_GPU=1
volumes:
# Mount test results for access after container exits
- ../test-results:/app/test-results
# Override to run specific tests
command: >
sh -c "Xvfb :99 -screen 0 1920x1080x24 -ac &
sleep 2 && pnpm exec playwright test --reporter=list 2>&1"
networks:
default:
name: e2e-test-network