Skip to content

Commit 4c2a720

Browse files
committed
DockerFileNodeImage
1 parent f17271a commit 4c2a720

File tree

6 files changed

+579
-627
lines changed

6 files changed

+579
-627
lines changed

Dockerfile

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
FROM mcr.microsoft.com/playwright:v1.35.0-jammy
1+
# Use the node:20.5.1-bookworm-slim image as the base image
2+
FROM node:20.5.1-bookworm-slim
23

4+
# Set the working directory inside the container to /app
35
WORKDIR /app
46

7+
# Copy package.json and package-lock.json from the host to the container's working directory
58
COPY package.json package-lock.json ./
69

10+
# Install Node.js dependencies using npm ci (clean install)
711
RUN npm ci
812

9-
#Install chrome on Docker container
10-
RUN npx playwright install chrome
11-
13+
# Copy the application code from the host to the container's working directory
1214
COPY . .
1315

14-
#Adding a non root User named "turing"
15-
RUN useradd -m turing
16-
17-
#Giving Read/Write Access to non-root user to main project folder "/app"
18-
RUN chown -R turing /app
16+
# Install Chrome browser for use with Playwright
17+
RUN npx playwright install chrome
1918

20-
#Switching from root user to non-root user(turing)
21-
USER turing
19+
# Instead of passing --ENV="qa" in the command line (CMD parameter),
20+
# we are setting the environment variable here itself
21+
ENV npm_config_ENV=qa
2222

23-
CMD npm run test:serial --ENV="qa"
23+
# Here, we run the test script defined in package.json (npm run test:serial)
24+
CMD ["npm", "run", "test:serial"]

html-report.zip

182 KB
Binary file not shown.

logs/info.log

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{"level":"info","message":"Test Case Started : @Smoke Verify Book Store Login"}
2+
{"level":"info","message":"Executing Step : Navigate to Application"}
3+
{"level":"info","message":"Executing Step : Click on Book Store Application Icon"}
4+
{"level":"info","message":"Executing Step : Click on Login button in Main page"}
5+
{"level":"info","message":"Executing Step : Login to Book Store application"}
6+
{"level":"info","message":"Executing Step : Verify User is logged in and navigated to Profile page"}
7+
{"level":"info","message":"Test Case Completed : @Smoke Verify Book Store Login Status : passed"}
8+
{"level":"error","message":"Error: File not found: C:\\playwright-typescript-playwright-test\\html-report"}
9+
{"level":"info","message":"Test Case Started : @Smoke Verify Book Store Login"}
10+
{"level":"info","message":"Executing Step : Navigate to Application"}
11+
{"level":"info","message":"Executing Step : Click on Book Store Application Icon"}
12+
{"level":"info","message":"Executing Step : Click on Login button in Main page"}
13+
{"level":"info","message":"Executing Step : Login to Book Store application"}
14+
{"level":"info","message":"Executing Step : Verify User is logged in and navigated to Profile page"}
15+
{"level":"info","message":"Test Case Completed : @Smoke Verify Book Store Login Status : passed"}
16+
{"level":"info","message":"Test Case Started : @Smoke Verify Alerts, Frame & Windows Page"}
17+
{"level":"info","message":"Test Case Completed : @Smoke Verify Alerts, Frame & Windows Page Status : passed"}
18+
{"level":"info","message":"Test Case Started : @Smoke Verify Elements Page"}
19+
{"level":"info","message":"Test Case Completed : @Smoke Verify Elements Page Status : passed"}
20+
{"level":"info","message":"Test Case Started : @Smoke Verify Interactions Page"}
21+
{"level":"info","message":"Test Case Completed : @Smoke Verify Interactions Page Status : passed"}
22+
{"level":"info","message":"Test Case Started : @Smoke Verify Book Store Login"}
23+
{"level":"info","message":"Executing Step : Navigate to Application"}
24+
{"level":"info","message":"Executing Step : Click on Book Store Application Icon"}
25+
{"level":"info","message":"Executing Step : Click on Login button in Main page"}
26+
{"level":"info","message":"Executing Step : Login to Book Store application"}
27+
{"level":"info","message":"Executing Step : Verify User is logged in and navigated to Profile page"}
28+
{"level":"info","message":"Test Case Completed : @Smoke Verify Book Store Login Status : passed"}
29+
{"level":"info","message":"Test Case Started : @Smoke Verify the text contents of PDF file."}
30+
{"level":"info","message":"Test Case Completed : @Smoke Verify the text contents of PDF file. Status : passed"}
31+
{"level":"info","message":"Test Case Started : @Smoke Verify Widgets Page"}
32+
{"level":"info","message":"Test Case Completed : @Smoke Verify Widgets Page Status : passed"}

0 commit comments

Comments
 (0)