Skip to content

Commit 108421a

Browse files
committed
Added docker compose
- docker compose file - updated docker image to 1.49
1 parent 2ad61d8 commit 108421a

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Get the latest version of Playwright
2-
FROM mcr.microsoft.com/playwright:v1.29.0-focal
2+
FROM mcr.microsoft.com/playwright:v1.49.1-noble
33

44
RUN mkdir /tests
55
COPY . /tests
66
WORKDIR /tests
77

8-
RUN npm install
9-
RUN npx @playwright/test install
8+
RUN npm install && \
9+
npx @playwright/test install
10+
11+
CMD ["npm", "test"]

base_fwk/fixtures/baseTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ test.beforeEach(async ({ browser }) => {
6262
// console.log('beforeEach tests');
6363
});
6464

65-
test.afterEach(async ({ }) => {
66-
// console.log('afterEach tests');
65+
test.afterEach(async ({ page}) => {
66+
await page.close();
6767
});
6868

6969
// export default and name export so spec files can use it

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3'
2+
services:
3+
playwright-test:
4+
image: playwright
5+
build: .
6+
container_name: playwright_docker
7+
volumes:
8+
- ${PWD}:/tests
9+
command: npm run test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "npx playwright test",
7+
"test": "npx playwright test tests/fwkTesting.spec.ts ",
88
"test:reporter": "npx playwright test tests/fwkTesting.spec.ts --headed --reporter=allure-playwright",
99
"open:allure-report": "npx ./allure generate ./allure-results && allure open"
1010
},

0 commit comments

Comments
 (0)