playwright-e2e-docker/templates/Dockerfile
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

31 lines
850 B
Docker

# Electron E2E Testing Container
# Uses Playwright base image with Xvfb pre-configured
#
# Usage: Copy to your project's e2e/ directory and customize as needed
FROM mcr.microsoft.com/playwright:v1.57.0-noble
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
# Copy package files first for layer caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies (including electron)
RUN pnpm install --frozen-lockfile
# Copy source and config files
COPY . .
# Build the app
RUN pnpm build
# Set display and disable GPU for headless Electron
ENV DISPLAY=:99
ENV ELECTRON_DISABLE_GPU=1
# Run tests with Xvfb virtual display
# Override CMD in docker-compose.yml for specific test files
CMD ["sh", "-c", "Xvfb :99 -screen 0 1920x1080x24 -ac &\nsleep 2 && pnpm exec playwright test --reporter=list 2>&1"]