Skip to content

Commit 512e9ef

Browse files
committed
chore: setup playwright
WIP: will refactors tests one by one and rename the e2e-playwright folder to e2e after its done
1 parent f371ae6 commit 512e9ef

File tree

4 files changed

+91
-77
lines changed

4 files changed

+91
-77
lines changed

package-lock.json

+60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"test:coverage": "npm run test:only -- --coverage",
4242
"test:watch": "npm run test:coverage --watch",
4343
"test": "npm run test:coverage",
44+
"test:playwright": "npx playwright test",
4445
"pretest": "npm run lint",
4546
"prepare": "husky && npm run build",
4647
"release": "standard-version"
@@ -86,6 +87,7 @@
8687
"@babel/runtime": "^7.22.5",
8788
"@commitlint/cli": "^19.0.3",
8889
"@commitlint/config-conventional": "^19.0.3",
90+
"@playwright/test": "^1.42.0",
8991
"@types/compression": "^1.7.2",
9092
"@types/default-gateway": "^3.0.1",
9193
"@types/node": "^20.11.16",

playwright.config.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"use strict";
2+
3+
const CI = false;
4+
5+
module.exports = {
6+
testDir: "./test/e2e-playwright",
7+
// however this can have benefits, in tests I couldn't start a server on multiple ports
8+
// for tests "stats-refactored.test.js" the port is read from "ports-map.js" file somehow
9+
// I should manage to handle it if I want to run the tests in parallel mode
10+
fullyParallel: false,
11+
forbidOnly: !!CI,
12+
retries: CI ? 2 : 0,
13+
workers: 1,
14+
reporter: "html",
15+
use: {
16+
trace: "on-first-retry",
17+
},
18+
projects: [
19+
{
20+
name: "chromium",
21+
use: {
22+
browserName: "chromium",
23+
launchOptions: {
24+
args: ["--ignore-certificate-errors"],
25+
},
26+
},
27+
},
28+
],
29+
};

playwright.config.ts

-77
This file was deleted.

0 commit comments

Comments
 (0)