First commit
This commit is contained in:
10
e2e-playwright/Dockerfile
Normal file
10
e2e-playwright/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM mcr.microsoft.com/playwright:v1.24.2-focal
|
||||
|
||||
COPY . /e2e-playwright
|
||||
|
||||
WORKDIR /e2e-playwright
|
||||
|
||||
RUN npm install
|
||||
RUN npx playwright install chrome
|
||||
|
||||
CMD [ "npx", "playwright", "test", "--reporter=list" ]
|
||||
8
e2e-playwright/package.json
Normal file
8
e2e-playwright/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "e2e-playwright-in-docker",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"playwright": "^1.24.2",
|
||||
"@playwright/test": "^1.24.2"
|
||||
}
|
||||
}
|
||||
20
e2e-playwright/playwright.config.js
Normal file
20
e2e-playwright/playwright.config.js
Normal file
@@ -0,0 +1,20 @@
|
||||
module.exports = {
|
||||
timeout: 10000,
|
||||
retries: 0,
|
||||
reporter: "list",
|
||||
workers: 5,
|
||||
use: {
|
||||
baseURL: "http://localhost:7777",
|
||||
headless: true,
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: "e2e-headless-chrome",
|
||||
use: {
|
||||
browserName: "chromium",
|
||||
channel: "chrome",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
6
e2e-playwright/tests/hello-world.spec.js
Normal file
6
e2e-playwright/tests/hello-world.spec.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const { test, expect } = require("@playwright/test");
|
||||
|
||||
test("Server responds with the text 'Hello world!'", async ({ page }) => {
|
||||
const response = await page.goto("/");
|
||||
expect(await response.text()).toBe("Hello world!");
|
||||
});
|
||||
Reference in New Issue
Block a user