-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (38 loc) · 1.63 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (38 loc) · 1.63 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
52
53
# Use the official Playwright image as a base
FROM mcr.microsoft.com/playwright:v1.39.0-focal
# Set the working directory inside the container
WORKDIR /app
# Install OpenJDK (Java) and other necessary packages
RUN apt-get update && apt-get install -y openjdk-11-jdk && apt-get clean
# Check Java installation location during build
RUN java -XshowSettings:properties -version
# Set JAVA_HOME environment variable
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64
ENV PATH=$JAVA_HOME/bin:$PATH
# Verify Java installation
RUN java -version
# Copy package.json and package-lock.json to install dependencies
COPY package.json package-lock.json ./
# Install npm dependencies
RUN npm install
# Install Allure command-line tool globally
RUN npm install -g allure-commandline --save-dev
# Install a simple HTTP server to serve the Allure report
RUN npm install -g http-server
# Copy all files from the host machine into the container
COPY tests /app/tests
COPY support /app/support
COPY resources /app/resources
COPY package.json /app/
COPY playwright.config.ts /app/playwright.config.ts
# Ensure all necessary Playwright dependencies are installed
RUN npx playwright install --with-deps
# Make sure the allure-results and allure-report directories exist for report generation
RUN mkdir -p /app/allure-results /app/allure-report
# Expose Allure report port (optional if you want to access the report from Docker)
EXPOSE 5252
# Run the custom npm script to execute tests, generate and open Allure reports
CMD ["npm", "run", "test:allure-report"]
# Output the contents of allure-results to verify if they exist
RUN ls -l /app/allure-results
RUN ls -l /app/allure-report