First commit

This commit is contained in:
AndrewTrieu
2022-12-27 19:38:34 +02:00
commit 08128374c1
25 changed files with 523 additions and 0 deletions

10
e2e-playwright/Dockerfile Normal file
View 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" ]

View File

@@ -0,0 +1,8 @@
{
"name": "e2e-playwright-in-docker",
"version": "1.0.0",
"dependencies": {
"playwright": "^1.24.2",
"@playwright/test": "^1.24.2"
}
}

View 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",
},
},
],
};

View 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!");
});