kunai-runner 6.10.101 → 6.10.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/playwright.config.js +194 -0
- package/tsconfig.build.json +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kunai-runner",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.104",
|
|
4
4
|
"description": "High-performance Dataverse Playwright frontend testing framework and E2E automation scaffolding.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"doc": "docs",
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
"tests/",
|
|
13
13
|
"scripts/",
|
|
14
14
|
"docs/",
|
|
15
|
+
"playwright.config.js",
|
|
15
16
|
"playwright.config.ts",
|
|
16
17
|
"tsconfig.json",
|
|
18
|
+
"tsconfig.build.json",
|
|
17
19
|
".env.example",
|
|
18
20
|
"README.md"
|
|
19
21
|
],
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const test_1 = require("@playwright/test");
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const process = globalThis.process;
|
|
10
|
+
// Derive the auth file path at config-load time so both the setup project
|
|
11
|
+
// and the suite project reference the same per-endpoint, per-browser file.
|
|
12
|
+
// We inline the slug logic here (rather than importing lib/auth-file.ts)
|
|
13
|
+
// because playwright.config.ts is evaluated before TypeScript compilation.
|
|
14
|
+
function authFilePath(browser) {
|
|
15
|
+
const url = (process.env.BASE_URL ?? "default").trim();
|
|
16
|
+
const slug = url
|
|
17
|
+
.replace(/^https?:\/\//, "")
|
|
18
|
+
.replace(/\/$/, "")
|
|
19
|
+
.replace(/[^a-z0-9]/gi, "-")
|
|
20
|
+
.toLowerCase();
|
|
21
|
+
return `playwright/.auth/${slug}-${browser}.json`;
|
|
22
|
+
}
|
|
23
|
+
const AUTH_CHROMIUM = authFilePath("chromium");
|
|
24
|
+
const AUTH_FIREFOX = authFilePath("firefox");
|
|
25
|
+
const AUTH_WEBKIT = authFilePath("webkit");
|
|
26
|
+
/**
|
|
27
|
+
* Load environment variables from .env at the repository root.
|
|
28
|
+
* dotenv is a transitive dependency of @playwright/test — no extra install needed.
|
|
29
|
+
*/
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
31
|
+
require("dotenv").config({ path: path_1.default.resolve(__dirname, ".env") });
|
|
32
|
+
/**
|
|
33
|
+
* See https://playwright.dev/docs/test-configuration.
|
|
34
|
+
*/
|
|
35
|
+
exports.default = (0, test_1.defineConfig)({
|
|
36
|
+
testDir: "./tests/suite",
|
|
37
|
+
timeout: 90000,
|
|
38
|
+
/* All tests within a project run in strict sequence; projects themselves
|
|
39
|
+
run one at a time because workers is 1. */
|
|
40
|
+
workers: 1,
|
|
41
|
+
fullyParallel: false,
|
|
42
|
+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
43
|
+
reporter: "html",
|
|
44
|
+
/* Shared settings for all projects. See https://playwright.dev/docs/api/class-testoptions. */
|
|
45
|
+
use: {
|
|
46
|
+
headless: true,
|
|
47
|
+
launchOptions: {
|
|
48
|
+
slowMo: 2000,
|
|
49
|
+
},
|
|
50
|
+
// Sets the default viewport size for all tests
|
|
51
|
+
viewport: { width: 1920, height: 1080 },
|
|
52
|
+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
53
|
+
trace: "on",
|
|
54
|
+
/* Always collect video and screenshots, even when tests pass. See https://playwright.dev/docs/video-and-screenshots */
|
|
55
|
+
video: {
|
|
56
|
+
mode: "on",
|
|
57
|
+
size: { width: 1920, height: 1080 },
|
|
58
|
+
},
|
|
59
|
+
screenshot: {
|
|
60
|
+
mode: "on",
|
|
61
|
+
fullPage: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
/* Configure the output directory for test artifacts such as screenshots, videos, traces, etc. */
|
|
65
|
+
outputDir: "test-results/",
|
|
66
|
+
/* Configure projects
|
|
67
|
+
*
|
|
68
|
+
* Execution order (workers: 1 → strictly sequential):
|
|
69
|
+
*
|
|
70
|
+
* preflight
|
|
71
|
+
* → setup-chromium → suite-chromium
|
|
72
|
+
* → setup-firefox → suite-firefox
|
|
73
|
+
* → setup-webkit → suite-webkit
|
|
74
|
+
*
|
|
75
|
+
* "suite-firefox" declares a dependency on "suite-chromium" and
|
|
76
|
+
* "suite-webkit" declares a dependency on "suite-firefox", which
|
|
77
|
+
* enforces the Chromium → Firefox → WebKit ordering even if workers
|
|
78
|
+
* is ever increased.
|
|
79
|
+
*/
|
|
80
|
+
projects: [
|
|
81
|
+
/* =========================================================
|
|
82
|
+
1. Preflight — Chromium, no auth required, @standard only.
|
|
83
|
+
The test itself returns immediately when SKIP_PREFLIGHT=true.
|
|
84
|
+
========================================================= */
|
|
85
|
+
{
|
|
86
|
+
name: "preflight",
|
|
87
|
+
testMatch: /suite\/01-preflight\.spec\.ts/,
|
|
88
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
89
|
+
use: {
|
|
90
|
+
browserName: "chromium",
|
|
91
|
+
baseURL: process.env.BASE_URL,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
/* =========================================================
|
|
95
|
+
2a. Auth setup — Chromium
|
|
96
|
+
========================================================= */
|
|
97
|
+
{
|
|
98
|
+
name: "setup-chromium",
|
|
99
|
+
testMatch: /suite\/auth\.setup\.ts/,
|
|
100
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
101
|
+
use: {
|
|
102
|
+
browserName: "chromium",
|
|
103
|
+
baseURL: process.env.BASE_URL,
|
|
104
|
+
...(fs_1.default.existsSync(AUTH_CHROMIUM) && {
|
|
105
|
+
storageState: AUTH_CHROMIUM,
|
|
106
|
+
}),
|
|
107
|
+
},
|
|
108
|
+
dependencies: [],
|
|
109
|
+
},
|
|
110
|
+
/* =========================================================
|
|
111
|
+
2b. Auth setup — Firefox
|
|
112
|
+
========================================================= */
|
|
113
|
+
{
|
|
114
|
+
name: "setup-firefox",
|
|
115
|
+
testMatch: /suite\/auth\.setup\.ts/,
|
|
116
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
117
|
+
use: {
|
|
118
|
+
browserName: "firefox",
|
|
119
|
+
baseURL: process.env.BASE_URL,
|
|
120
|
+
...(fs_1.default.existsSync(AUTH_FIREFOX) && {
|
|
121
|
+
storageState: AUTH_FIREFOX,
|
|
122
|
+
}),
|
|
123
|
+
},
|
|
124
|
+
dependencies: [],
|
|
125
|
+
},
|
|
126
|
+
/* =========================================================
|
|
127
|
+
2c. Auth setup — WebKit (Safari)
|
|
128
|
+
========================================================= */
|
|
129
|
+
{
|
|
130
|
+
name: "setup-webkit",
|
|
131
|
+
testMatch: /suite\/auth\.setup\.ts/,
|
|
132
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
133
|
+
use: {
|
|
134
|
+
browserName: "webkit",
|
|
135
|
+
baseURL: process.env.BASE_URL,
|
|
136
|
+
...(fs_1.default.existsSync(AUTH_WEBKIT) && {
|
|
137
|
+
storageState: AUTH_WEBKIT,
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
dependencies: [],
|
|
141
|
+
},
|
|
142
|
+
/* =========================================================
|
|
143
|
+
3a. Main test suite — Chromium
|
|
144
|
+
Runs first. Firefox suite depends on this completing.
|
|
145
|
+
========================================================= */
|
|
146
|
+
{
|
|
147
|
+
name: "suite-chromium",
|
|
148
|
+
testMatch: /suite\/(?!auth\.setup|01-preflight)\d+.*\.spec\.ts/,
|
|
149
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
150
|
+
use: {
|
|
151
|
+
browserName: "chromium",
|
|
152
|
+
baseURL: process.env.BASE_URL,
|
|
153
|
+
...(fs_1.default.existsSync(AUTH_CHROMIUM) && {
|
|
154
|
+
storageState: AUTH_CHROMIUM,
|
|
155
|
+
}),
|
|
156
|
+
},
|
|
157
|
+
dependencies: ["setup-chromium"],
|
|
158
|
+
},
|
|
159
|
+
/* =========================================================
|
|
160
|
+
3b. Main test suite — Firefox
|
|
161
|
+
Runs after Chromium suite completes.
|
|
162
|
+
========================================================= */
|
|
163
|
+
{
|
|
164
|
+
name: "suite-firefox",
|
|
165
|
+
testMatch: /suite\/(?!auth\.setup|01-preflight)\d+.*\.spec\.ts/,
|
|
166
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
167
|
+
use: {
|
|
168
|
+
browserName: "firefox",
|
|
169
|
+
baseURL: process.env.BASE_URL,
|
|
170
|
+
...(fs_1.default.existsSync(AUTH_FIREFOX) && {
|
|
171
|
+
storageState: AUTH_FIREFOX,
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
dependencies: ["setup-firefox", "suite-chromium"],
|
|
175
|
+
},
|
|
176
|
+
/* =========================================================
|
|
177
|
+
3c. Main test suite — WebKit (Safari)
|
|
178
|
+
Runs after Firefox suite completes.
|
|
179
|
+
========================================================= */
|
|
180
|
+
{
|
|
181
|
+
name: "suite-webkit",
|
|
182
|
+
testMatch: /suite\/(?!auth\.setup|01-preflight)\d+.*\.spec\.ts/,
|
|
183
|
+
tsconfig: "./tests/suite/tsconfig.json",
|
|
184
|
+
use: {
|
|
185
|
+
browserName: "webkit",
|
|
186
|
+
baseURL: process.env.BASE_URL,
|
|
187
|
+
...(fs_1.default.existsSync(AUTH_WEBKIT) && {
|
|
188
|
+
storageState: AUTH_WEBKIT,
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
dependencies: ["setup-webkit", "suite-firefox"],
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"outDir": ".",
|
|
11
|
+
"ignoreDeprecations": "6.0",
|
|
12
|
+
"types": ["node"],
|
|
13
|
+
"noEmitOnError": false
|
|
14
|
+
},
|
|
15
|
+
"files": ["playwright.config.ts"]
|
|
16
|
+
}
|