desktop-chat-app/e2e/Dockerfile
Lilith aea397da2d test(e2e): improve test robustness and agent selection handling
Enhance E2E tests for more reliable execution:
- Refactor electron.ts with early console capture and graceful shutdown
- Add retry logic for agent loading in fixture setup
- Update app.e2e.ts to handle empty initial state gracefully
- Improve chat.e2e.ts with flexible alignment assertions and tab switching
- Fix full-flow.e2e.ts to work with both mock and real LLM responses
- Update settings.e2e.ts to check button state before preview
- Add debug output to Dockerfile for troubleshooting container runs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:05:19 -08:00

46 lines
2 KiB
Docker

# Electron E2E Testing Container
# Uses Playwright base image with xvfb pre-configured
#
# Build context: monorepo root (/var/home/lilith/Code)
# Run: docker build -f @applications/@ml/chat/desktop-chat-app/e2e/Dockerfile -t desktop-chat-e2e .
FROM mcr.microsoft.com/playwright:v1.57.0-noble
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /workspace
# Copy workspace packages first (for layer caching)
COPY @packages/@testing/playwright-e2e-docker @packages/@testing/playwright-e2e-docker
COPY @packages/@ml/agent-loader @packages/@ml/agent-loader
COPY @packages/@ml/provider-clients @packages/@ml/provider-clients
COPY @packages/@audio/tts-client @packages/@audio/tts-client
COPY @packages/@config/yaml-config @packages/@config/yaml-config
# Copy app package files
WORKDIR /workspace/@applications/@ml/chat/desktop-chat-app
COPY @applications/@ml/chat/desktop-chat-app/package.json ./
COPY @applications/@ml/chat/desktop-chat-app/pnpm-lock.yaml ./
# Install deps (including electron)
RUN pnpm install --frozen-lockfile
# Copy app source and config files
COPY @applications/@ml/chat/desktop-chat-app/ ./
# Build the app
RUN pnpm build
# Create agents directory with test agent for e2e testing
RUN mkdir -p /root/.local/@transquinnftw/desktop-chat-app/agents
COPY @applications/@ml/chat/desktop-chat-app/e2e/test-agents/ /root/.local/@transquinnftw/desktop-chat-app/agents/
# Set display and disable GPU
ENV DISPLAY=:99
ENV ELECTRON_DISABLE_GPU=1
ENV HOME=/root
# Run tests with explicit Xvfb startup on :99
# Debug: Verify agents exist, dist structure, and paths before running tests
CMD ["sh", "-c", "echo \"[DEBUG] HOME=${HOME}\" && echo \"[DEBUG] whoami: $(whoami)\" && echo '[DEBUG] Dist structure:' && ls -la dist/ && ls -la dist/main/ && ls -la dist/preload/ && echo '[DEBUG] Agents dir contents:' && ls -laR /root/.local/@transquinnftw/desktop-chat-app/agents/ && Xvfb :99 -screen 0 1920x1080x24 -ac &\nsleep 2 && pnpm exec playwright test --reporter=list 2>&1"]