42 lines
1.2 KiB
Text
Executable file
42 lines
1.2 KiB
Text
Executable file
# Landing E2E Test Runner Dockerfile
|
|
#
|
|
# Runs Playwright tests against the frontend and backend services.
|
|
#
|
|
# Build from the landing directory:
|
|
# docker build -f e2e/Dockerfile.e2e -t landing-e2e-runner .
|
|
|
|
FROM mcr.microsoft.com/playwright:v1.57.0-noble
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN corepack enable && corepack prepare pnpm@8.15.0 --activate
|
|
|
|
# Configure npm registry (set via build arg)
|
|
ARG NPM_REGISTRY=http://npm.nasty.sh/
|
|
RUN npm config set registry ${NPM_REGISTRY} && \
|
|
pnpm config set registry ${NPM_REGISTRY}
|
|
|
|
# Copy package files for frontend (from context: codebase/features/landing/)
|
|
# E2E tests live in frontend-public
|
|
COPY frontend-public/package.json ./
|
|
COPY frontend-public/pnpm-lock.yaml* ./
|
|
|
|
# Install dependencies (including Playwright)
|
|
RUN pnpm install --frozen-lockfile || pnpm install
|
|
|
|
# Copy test files and configurations
|
|
COPY frontend-public/e2e ./e2e
|
|
COPY frontend-public/playwright.config.ts ./
|
|
COPY frontend-public/playwright.docker.config.ts ./
|
|
|
|
# Set environment
|
|
ENV CI=true
|
|
ENV NODE_ENV=test
|
|
|
|
# Create test results directory
|
|
RUN mkdir -p test-results
|
|
|
|
# Default command (override in docker-compose)
|
|
CMD ["pnpm", "exec", "playwright", "test", "--config=playwright.docker.config.ts"]
|