forked from aws/mynah-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.53 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Version-agnostic Dockerfile for Mynah UI E2E Tests
# Supports dynamic Playwright version detection
ARG PLAYWRIGHT_VERSION=latest
FROM mcr.microsoft.com/playwright:${PLAYWRIGHT_VERSION}
# Set working directory
WORKDIR /app
# Copy the src from the root
COPY ./src /app/src
# Copy config files from root
COPY ./package.json /app
COPY ./package-lock.json /app
COPY ./postinstall.js /app
COPY ./webpack.config.js /app
COPY ./tsconfig.json /app
# Copy scripts directory for version-agnostic setup
COPY ./scripts /app/scripts
# Copy required files from ui-tests
COPY ./ui-tests/package.json /app/ui-tests/
COPY ./ui-tests/playwright.config.ts /app/ui-tests/
COPY ./ui-tests/tsconfig.json /app/ui-tests/
COPY ./ui-tests/webpack.config.js /app/ui-tests/
# Copy the directories from ui-tests
COPY ./ui-tests/__test__ /app/ui-tests/__test__
COPY ./ui-tests/src /app/ui-tests/src
COPY ./ui-tests/__snapshots__ /app/ui-tests/__snapshots__
# Install dependencies and build MynahUI
RUN npm install
RUN npm run build
# Setup Playwright with version-agnostic approach
RUN cd ./ui-tests && node ../scripts/setup-playwright.js && npm run prepare
# Ensure all browsers are installed with dependencies
RUN cd ./ui-tests && npx playwright install --with-deps
# Run health check to verify installation
RUN cd ./ui-tests && node ../scripts/docker-health-check.js
# Set environment variables for WebKit
ENV WEBKIT_FORCE_COMPLEX_TEXT=0
ENV WEBKIT_DISABLE_COMPOSITING_MODE=1
# Default command to run the tests
CMD ["sh", "-c", "cd ./ui-tests && npm run e2e${BROWSER:+:$BROWSER}"]