@ohos-ports/playwright 1.52.0-beta.0
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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +168 -0
- package/ThirdPartyNotices.txt +4011 -0
- package/cli.js +19 -0
- package/index.d.ts +17 -0
- package/index.js +17 -0
- package/index.mjs +18 -0
- package/jsx-runtime.js +42 -0
- package/jsx-runtime.mjs +21 -0
- package/lib/common/config.js +272 -0
- package/lib/common/configLoader.js +373 -0
- package/lib/common/esmLoaderHost.js +100 -0
- package/lib/common/expectBundle.js +49 -0
- package/lib/common/expectBundleImpl.js +389 -0
- package/lib/common/fixtures.js +302 -0
- package/lib/common/globals.js +58 -0
- package/lib/common/ipc.js +60 -0
- package/lib/common/poolBuilder.js +85 -0
- package/lib/common/process.js +109 -0
- package/lib/common/suiteUtils.js +149 -0
- package/lib/common/test.js +313 -0
- package/lib/common/testLoader.js +100 -0
- package/lib/common/testType.js +306 -0
- package/lib/errorContext.js +149 -0
- package/lib/fsWatcher.js +67 -0
- package/lib/index.js +692 -0
- package/lib/internalsForTest.js +42 -0
- package/lib/isomorphic/events.js +77 -0
- package/lib/isomorphic/folders.js +30 -0
- package/lib/isomorphic/stringInternPool.js +69 -0
- package/lib/isomorphic/teleReceiver.js +484 -0
- package/lib/isomorphic/teleSuiteUpdater.js +137 -0
- package/lib/isomorphic/testServerConnection.js +211 -0
- package/lib/isomorphic/testServerInterface.js +16 -0
- package/lib/isomorphic/testTree.js +307 -0
- package/lib/isomorphic/types.d.js +16 -0
- package/lib/isomorphic/util.js +28 -0
- package/lib/loader/loaderMain.js +59 -0
- package/lib/matchers/expect.js +322 -0
- package/lib/matchers/matcherHint.js +59 -0
- package/lib/matchers/matchers.js +362 -0
- package/lib/matchers/toBeTruthy.js +71 -0
- package/lib/matchers/toEqual.js +94 -0
- package/lib/matchers/toHaveURL.js +117 -0
- package/lib/matchers/toMatchAriaSnapshot.js +180 -0
- package/lib/matchers/toMatchSnapshot.js +365 -0
- package/lib/matchers/toMatchText.js +105 -0
- package/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/lib/plugins/index.js +28 -0
- package/lib/plugins/webServerPlugin.js +207 -0
- package/lib/program.js +407 -0
- package/lib/reporters/base.js +540 -0
- package/lib/reporters/blob.js +135 -0
- package/lib/reporters/dot.js +82 -0
- package/lib/reporters/empty.js +32 -0
- package/lib/reporters/github.js +127 -0
- package/lib/reporters/html.js +579 -0
- package/lib/reporters/internalReporter.js +129 -0
- package/lib/reporters/json.js +254 -0
- package/lib/reporters/junit.js +230 -0
- package/lib/reporters/line.js +113 -0
- package/lib/reporters/list.js +228 -0
- package/lib/reporters/merge.js +511 -0
- package/lib/reporters/multiplexer.js +104 -0
- package/lib/reporters/reporterV2.js +102 -0
- package/lib/reporters/teleEmitter.js +269 -0
- package/lib/reporters/versions/blobV1.js +16 -0
- package/lib/runner/dispatcher.js +484 -0
- package/lib/runner/failureTracker.js +62 -0
- package/lib/runner/lastRun.js +74 -0
- package/lib/runner/loadUtils.js +299 -0
- package/lib/runner/loaderHost.js +89 -0
- package/lib/runner/processHost.js +165 -0
- package/lib/runner/projectUtils.js +235 -0
- package/lib/runner/rebase.js +189 -0
- package/lib/runner/reporters.js +162 -0
- package/lib/runner/runner.js +110 -0
- package/lib/runner/sigIntWatcher.js +96 -0
- package/lib/runner/taskRunner.js +127 -0
- package/lib/runner/tasks.js +400 -0
- package/lib/runner/testGroups.js +117 -0
- package/lib/runner/testServer.js +477 -0
- package/lib/runner/uiModeReporter.js +30 -0
- package/lib/runner/vcs.js +72 -0
- package/lib/runner/watchMode.js +394 -0
- package/lib/runner/workerHost.js +93 -0
- package/lib/third_party/tsconfig-loader.js +103 -0
- package/lib/transform/babelBundle.js +43 -0
- package/lib/transform/babelBundleImpl.js +477 -0
- package/lib/transform/compilationCache.js +255 -0
- package/lib/transform/esmLoader.js +104 -0
- package/lib/transform/esmUtils.js +53 -0
- package/lib/transform/portTransport.js +66 -0
- package/lib/transform/transform.js +291 -0
- package/lib/util.js +407 -0
- package/lib/utilsBundle.js +46 -0
- package/lib/utilsBundleImpl.js +102 -0
- package/lib/worker/fixtureRunner.js +253 -0
- package/lib/worker/testInfo.js +422 -0
- package/lib/worker/testTracing.js +351 -0
- package/lib/worker/timeoutManager.js +174 -0
- package/lib/worker/util.js +31 -0
- package/lib/worker/workerMain.js +511 -0
- package/package.json +64 -0
- package/test.d.ts +18 -0
- package/test.js +24 -0
- package/test.mjs +33 -0
- package/types/test.d.ts +10061 -0
- package/types/testReporter.d.ts +799 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
|
+
_baseTest: () => _baseTest,
|
|
32
|
+
defineConfig: () => import_configLoader.defineConfig,
|
|
33
|
+
expect: () => import_expect.expect,
|
|
34
|
+
mergeExpects: () => import_expect2.mergeExpects,
|
|
35
|
+
mergeTests: () => import_testType2.mergeTests,
|
|
36
|
+
test: () => test
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(index_exports);
|
|
39
|
+
var import_fs = __toESM(require("fs"));
|
|
40
|
+
var import_path = __toESM(require("path"));
|
|
41
|
+
var playwrightLibrary = __toESM(require("@ohos-ports/playwright-core"));
|
|
42
|
+
var import_utils = require("@ohos-ports/playwright-core/lib/utils");
|
|
43
|
+
var import_globals = require("./common/globals");
|
|
44
|
+
var import_testType = require("./common/testType");
|
|
45
|
+
var import_errorContext = require("./errorContext");
|
|
46
|
+
var import_expect = require("./matchers/expect");
|
|
47
|
+
var import_configLoader = require("./common/configLoader");
|
|
48
|
+
var import_testType2 = require("./common/testType");
|
|
49
|
+
var import_expect2 = require("./matchers/expect");
|
|
50
|
+
const _baseTest = import_testType.rootTestType.test;
|
|
51
|
+
(0, import_utils.setBoxedStackPrefixes)([import_path.default.dirname(require.resolve("../package.json"))]);
|
|
52
|
+
if (process["__pw_initiator__"]) {
|
|
53
|
+
const originalStackTraceLimit = Error.stackTraceLimit;
|
|
54
|
+
Error.stackTraceLimit = 200;
|
|
55
|
+
try {
|
|
56
|
+
throw new Error("Requiring @playwright/test second time, \nFirst:\n" + process["__pw_initiator__"] + "\n\nSecond: ");
|
|
57
|
+
} finally {
|
|
58
|
+
Error.stackTraceLimit = originalStackTraceLimit;
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
process["__pw_initiator__"] = new Error().stack;
|
|
62
|
+
}
|
|
63
|
+
const playwrightFixtures = {
|
|
64
|
+
defaultBrowserType: ["chromium", { scope: "worker", option: true }],
|
|
65
|
+
browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: "worker", option: true }],
|
|
66
|
+
playwright: [async ({}, use) => {
|
|
67
|
+
await use(require("@ohos-ports/playwright-core"));
|
|
68
|
+
}, { scope: "worker", box: true }],
|
|
69
|
+
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: "worker", option: true }],
|
|
70
|
+
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: "worker", option: true }],
|
|
71
|
+
launchOptions: [{}, { scope: "worker", option: true }],
|
|
72
|
+
connectOptions: [async ({ _optionConnectOptions }, use) => {
|
|
73
|
+
await use(connectOptionsFromEnv() || _optionConnectOptions);
|
|
74
|
+
}, { scope: "worker", option: true }],
|
|
75
|
+
screenshot: ["off", { scope: "worker", option: true }],
|
|
76
|
+
video: ["off", { scope: "worker", option: true }],
|
|
77
|
+
trace: ["off", { scope: "worker", option: true }],
|
|
78
|
+
_browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
|
|
79
|
+
const options = {
|
|
80
|
+
handleSIGINT: false,
|
|
81
|
+
...launchOptions,
|
|
82
|
+
tracesDir: tracing().tracesDir()
|
|
83
|
+
};
|
|
84
|
+
if (headless !== void 0)
|
|
85
|
+
options.headless = headless;
|
|
86
|
+
if (channel !== void 0)
|
|
87
|
+
options.channel = channel;
|
|
88
|
+
playwright._defaultLaunchOptions = options;
|
|
89
|
+
await use(options);
|
|
90
|
+
playwright._defaultLaunchOptions = void 0;
|
|
91
|
+
}, { scope: "worker", auto: true, box: true }],
|
|
92
|
+
browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use, testInfo) => {
|
|
93
|
+
if (!["chromium", "firefox", "webkit", "_bidiChromium", "_bidiFirefox"].includes(browserName))
|
|
94
|
+
throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
|
|
95
|
+
if (connectOptions) {
|
|
96
|
+
const browser2 = await playwright[browserName].connect({
|
|
97
|
+
...connectOptions,
|
|
98
|
+
exposeNetwork: connectOptions.exposeNetwork ?? connectOptions._exposeNetwork,
|
|
99
|
+
headers: {
|
|
100
|
+
// HTTP headers are ASCII only (not UTF-8).
|
|
101
|
+
"x-playwright-launch-options": (0, import_utils.jsonStringifyForceASCII)(_browserOptions),
|
|
102
|
+
...connectOptions.headers
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
await use(browser2);
|
|
106
|
+
await browser2._wrapApiCall(async () => {
|
|
107
|
+
await browser2.close({ reason: "Test ended." });
|
|
108
|
+
}, true);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const browser = await playwright[browserName].launch();
|
|
112
|
+
await use(browser);
|
|
113
|
+
await browser._wrapApiCall(async () => {
|
|
114
|
+
await browser.close({ reason: "Test ended." });
|
|
115
|
+
}, true);
|
|
116
|
+
}, { scope: "worker", timeout: 0 }],
|
|
117
|
+
acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true }],
|
|
118
|
+
bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true }],
|
|
119
|
+
colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === void 0 ? "light" : contextOptions.colorScheme), { option: true }],
|
|
120
|
+
deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true }],
|
|
121
|
+
extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true }],
|
|
122
|
+
geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true }],
|
|
123
|
+
hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true }],
|
|
124
|
+
httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true }],
|
|
125
|
+
ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true }],
|
|
126
|
+
isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true }],
|
|
127
|
+
javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true }],
|
|
128
|
+
locale: [({ contextOptions }, use) => use(contextOptions.locale ?? "en-US"), { option: true }],
|
|
129
|
+
offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true }],
|
|
130
|
+
permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true }],
|
|
131
|
+
proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true }],
|
|
132
|
+
storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true }],
|
|
133
|
+
clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true }],
|
|
134
|
+
timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true }],
|
|
135
|
+
userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true }],
|
|
136
|
+
viewport: [({ contextOptions }, use) => use(contextOptions.viewport === void 0 ? { width: 1280, height: 720 } : contextOptions.viewport), { option: true }],
|
|
137
|
+
actionTimeout: [0, { option: true }],
|
|
138
|
+
testIdAttribute: ["data-testid", { option: true }],
|
|
139
|
+
navigationTimeout: [0, { option: true }],
|
|
140
|
+
baseURL: [async ({}, use) => {
|
|
141
|
+
await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
|
|
142
|
+
}, { option: true }],
|
|
143
|
+
serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true }],
|
|
144
|
+
contextOptions: [{}, { option: true }],
|
|
145
|
+
_combinedContextOptions: [async ({
|
|
146
|
+
acceptDownloads,
|
|
147
|
+
bypassCSP,
|
|
148
|
+
clientCertificates,
|
|
149
|
+
colorScheme,
|
|
150
|
+
deviceScaleFactor,
|
|
151
|
+
extraHTTPHeaders,
|
|
152
|
+
hasTouch,
|
|
153
|
+
geolocation,
|
|
154
|
+
httpCredentials,
|
|
155
|
+
ignoreHTTPSErrors,
|
|
156
|
+
isMobile,
|
|
157
|
+
javaScriptEnabled,
|
|
158
|
+
locale,
|
|
159
|
+
offline,
|
|
160
|
+
permissions,
|
|
161
|
+
proxy,
|
|
162
|
+
storageState,
|
|
163
|
+
viewport,
|
|
164
|
+
timezoneId,
|
|
165
|
+
userAgent,
|
|
166
|
+
baseURL,
|
|
167
|
+
contextOptions,
|
|
168
|
+
serviceWorkers
|
|
169
|
+
}, use) => {
|
|
170
|
+
const options = {};
|
|
171
|
+
if (acceptDownloads !== void 0)
|
|
172
|
+
options.acceptDownloads = acceptDownloads;
|
|
173
|
+
if (bypassCSP !== void 0)
|
|
174
|
+
options.bypassCSP = bypassCSP;
|
|
175
|
+
if (colorScheme !== void 0)
|
|
176
|
+
options.colorScheme = colorScheme;
|
|
177
|
+
if (deviceScaleFactor !== void 0)
|
|
178
|
+
options.deviceScaleFactor = deviceScaleFactor;
|
|
179
|
+
if (extraHTTPHeaders !== void 0)
|
|
180
|
+
options.extraHTTPHeaders = extraHTTPHeaders;
|
|
181
|
+
if (geolocation !== void 0)
|
|
182
|
+
options.geolocation = geolocation;
|
|
183
|
+
if (hasTouch !== void 0)
|
|
184
|
+
options.hasTouch = hasTouch;
|
|
185
|
+
if (httpCredentials !== void 0)
|
|
186
|
+
options.httpCredentials = httpCredentials;
|
|
187
|
+
if (ignoreHTTPSErrors !== void 0)
|
|
188
|
+
options.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
189
|
+
if (isMobile !== void 0)
|
|
190
|
+
options.isMobile = isMobile;
|
|
191
|
+
if (javaScriptEnabled !== void 0)
|
|
192
|
+
options.javaScriptEnabled = javaScriptEnabled;
|
|
193
|
+
if (locale !== void 0)
|
|
194
|
+
options.locale = locale;
|
|
195
|
+
if (offline !== void 0)
|
|
196
|
+
options.offline = offline;
|
|
197
|
+
if (permissions !== void 0)
|
|
198
|
+
options.permissions = permissions;
|
|
199
|
+
if (proxy !== void 0)
|
|
200
|
+
options.proxy = proxy;
|
|
201
|
+
if (storageState !== void 0)
|
|
202
|
+
options.storageState = storageState;
|
|
203
|
+
if (clientCertificates?.length)
|
|
204
|
+
options.clientCertificates = resolveClientCerticates(clientCertificates);
|
|
205
|
+
if (timezoneId !== void 0)
|
|
206
|
+
options.timezoneId = timezoneId;
|
|
207
|
+
if (userAgent !== void 0)
|
|
208
|
+
options.userAgent = userAgent;
|
|
209
|
+
if (viewport !== void 0)
|
|
210
|
+
options.viewport = viewport;
|
|
211
|
+
if (baseURL !== void 0)
|
|
212
|
+
options.baseURL = baseURL;
|
|
213
|
+
if (serviceWorkers !== void 0)
|
|
214
|
+
options.serviceWorkers = serviceWorkers;
|
|
215
|
+
await use({
|
|
216
|
+
...contextOptions,
|
|
217
|
+
...options
|
|
218
|
+
});
|
|
219
|
+
}, { box: true }],
|
|
220
|
+
_setupContextOptions: [async ({ playwright, _combinedContextOptions, actionTimeout, navigationTimeout, testIdAttribute }, use, testInfo) => {
|
|
221
|
+
if (testIdAttribute)
|
|
222
|
+
playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
|
|
223
|
+
testInfo.snapshotSuffix = process.platform;
|
|
224
|
+
if ((0, import_utils.debugMode)())
|
|
225
|
+
testInfo._setDebugMode();
|
|
226
|
+
playwright._defaultContextOptions = _combinedContextOptions;
|
|
227
|
+
playwright._defaultContextTimeout = actionTimeout || 0;
|
|
228
|
+
playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
|
|
229
|
+
await use();
|
|
230
|
+
playwright._defaultContextOptions = void 0;
|
|
231
|
+
playwright._defaultContextTimeout = void 0;
|
|
232
|
+
playwright._defaultContextNavigationTimeout = void 0;
|
|
233
|
+
}, { auto: "all-hooks-included", title: "context configuration", box: true }],
|
|
234
|
+
_setupArtifacts: [async ({ playwright, screenshot, _optionErrorContext }, use, testInfo) => {
|
|
235
|
+
testInfo.setTimeout(testInfo.project.timeout);
|
|
236
|
+
const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot, _optionErrorContext);
|
|
237
|
+
await artifactsRecorder.willStartTest(testInfo);
|
|
238
|
+
const tracingGroupSteps = [];
|
|
239
|
+
const csiListener = {
|
|
240
|
+
onApiCallBegin: (data) => {
|
|
241
|
+
const testInfo2 = (0, import_globals.currentTestInfo)();
|
|
242
|
+
if (!testInfo2 || data.apiName.includes("setTestIdAttribute") || data.apiName === "tracing.groupEnd")
|
|
243
|
+
return;
|
|
244
|
+
const zone = (0, import_utils.currentZone)().data("stepZone");
|
|
245
|
+
if (zone && zone.category === "expect") {
|
|
246
|
+
data.apiName = zone.title;
|
|
247
|
+
data.stepId = zone.stepId;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const step = testInfo2._addStep({
|
|
251
|
+
location: data.frames[0],
|
|
252
|
+
category: "pw:api",
|
|
253
|
+
title: renderApiCall(data.apiName, data.params),
|
|
254
|
+
apiName: data.apiName,
|
|
255
|
+
params: data.params
|
|
256
|
+
}, tracingGroupSteps[tracingGroupSteps.length - 1]);
|
|
257
|
+
data.userData = step;
|
|
258
|
+
data.stepId = step.stepId;
|
|
259
|
+
if (data.apiName === "tracing.group")
|
|
260
|
+
tracingGroupSteps.push(step);
|
|
261
|
+
},
|
|
262
|
+
onApiCallEnd: (data) => {
|
|
263
|
+
if (data.apiName === "tracing.group")
|
|
264
|
+
return;
|
|
265
|
+
if (data.apiName === "tracing.groupEnd") {
|
|
266
|
+
const step2 = tracingGroupSteps.pop();
|
|
267
|
+
step2?.complete({ error: data.error });
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const step = data.userData;
|
|
271
|
+
step?.complete({ error: data.error });
|
|
272
|
+
},
|
|
273
|
+
onWillPause: ({ keepTestTimeout }) => {
|
|
274
|
+
if (!keepTestTimeout)
|
|
275
|
+
(0, import_globals.currentTestInfo)()?._setDebugMode();
|
|
276
|
+
},
|
|
277
|
+
runAfterCreateBrowserContext: async (context) => {
|
|
278
|
+
await artifactsRecorder?.didCreateBrowserContext(context);
|
|
279
|
+
const testInfo2 = (0, import_globals.currentTestInfo)();
|
|
280
|
+
if (testInfo2)
|
|
281
|
+
attachConnectedHeaderIfNeeded(testInfo2, context.browser());
|
|
282
|
+
},
|
|
283
|
+
runAfterCreateRequestContext: async (context) => {
|
|
284
|
+
await artifactsRecorder?.didCreateRequestContext(context);
|
|
285
|
+
},
|
|
286
|
+
runBeforeCloseBrowserContext: async (context) => {
|
|
287
|
+
await artifactsRecorder?.willCloseBrowserContext(context);
|
|
288
|
+
},
|
|
289
|
+
runBeforeCloseRequestContext: async (context) => {
|
|
290
|
+
await artifactsRecorder?.willCloseRequestContext(context);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const clientInstrumentation = playwright._instrumentation;
|
|
294
|
+
clientInstrumentation.addListener(csiListener);
|
|
295
|
+
await use();
|
|
296
|
+
clientInstrumentation.removeListener(csiListener);
|
|
297
|
+
await artifactsRecorder.didFinishTest();
|
|
298
|
+
}, { auto: "all-hooks-included", title: "trace recording", box: true, timeout: 0 }],
|
|
299
|
+
_contextFactory: [async ({
|
|
300
|
+
browser,
|
|
301
|
+
video,
|
|
302
|
+
_reuseContext,
|
|
303
|
+
_combinedContextOptions
|
|
304
|
+
/** mitigate dep-via-auto lack of traceability */
|
|
305
|
+
}, use, testInfo) => {
|
|
306
|
+
const testInfoImpl = testInfo;
|
|
307
|
+
const videoMode = normalizeVideoMode(video);
|
|
308
|
+
const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;
|
|
309
|
+
const contexts = /* @__PURE__ */ new Map();
|
|
310
|
+
await use(async (options) => {
|
|
311
|
+
const hook = testInfoImpl._currentHookType();
|
|
312
|
+
if (hook === "beforeAll" || hook === "afterAll") {
|
|
313
|
+
throw new Error([
|
|
314
|
+
`"context" and "page" fixtures are not supported in "${hook}" since they are created on a per-test basis.`,
|
|
315
|
+
`If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details.`,
|
|
316
|
+
`If you would like to configure your page before each test, do that in beforeEach hook instead.`
|
|
317
|
+
].join("\n"));
|
|
318
|
+
}
|
|
319
|
+
const videoOptions = captureVideo ? {
|
|
320
|
+
recordVideo: {
|
|
321
|
+
dir: tracing().artifactsDir(),
|
|
322
|
+
size: typeof video === "string" ? void 0 : video.size
|
|
323
|
+
}
|
|
324
|
+
} : {};
|
|
325
|
+
const context = await browser.newContext({ ...videoOptions, ...options });
|
|
326
|
+
const contextData = { pagesWithVideo: [] };
|
|
327
|
+
contexts.set(context, contextData);
|
|
328
|
+
if (captureVideo)
|
|
329
|
+
context.on("page", (page) => contextData.pagesWithVideo.push(page));
|
|
330
|
+
if (process.env.PW_CLOCK === "frozen") {
|
|
331
|
+
await context._wrapApiCall(async () => {
|
|
332
|
+
await context.clock.install({ time: 0 });
|
|
333
|
+
await context.clock.pauseAt(1e3);
|
|
334
|
+
}, true);
|
|
335
|
+
} else if (process.env.PW_CLOCK === "realtime") {
|
|
336
|
+
await context._wrapApiCall(async () => {
|
|
337
|
+
await context.clock.install({ time: 0 });
|
|
338
|
+
}, true);
|
|
339
|
+
}
|
|
340
|
+
return context;
|
|
341
|
+
});
|
|
342
|
+
let counter = 0;
|
|
343
|
+
const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
|
|
344
|
+
await Promise.all([...contexts.keys()].map(async (context) => {
|
|
345
|
+
await context._wrapApiCall(async () => {
|
|
346
|
+
await context.close({ reason: closeReason });
|
|
347
|
+
}, true);
|
|
348
|
+
const testFailed = testInfo.status !== testInfo.expectedStatus;
|
|
349
|
+
const preserveVideo = captureVideo && (videoMode === "on" || testFailed && videoMode === "retain-on-failure" || videoMode === "on-first-retry" && testInfo.retry === 1);
|
|
350
|
+
if (preserveVideo) {
|
|
351
|
+
const { pagesWithVideo: pagesForVideo } = contexts.get(context);
|
|
352
|
+
const videos = pagesForVideo.map((p) => p.video()).filter(Boolean);
|
|
353
|
+
await Promise.all(videos.map(async (v) => {
|
|
354
|
+
try {
|
|
355
|
+
const savedPath = testInfo.outputPath(`video${counter ? "-" + counter : ""}.webm`);
|
|
356
|
+
++counter;
|
|
357
|
+
await v.saveAs(savedPath);
|
|
358
|
+
testInfo.attachments.push({ name: "video", path: savedPath, contentType: "video/webm" });
|
|
359
|
+
} catch (e) {
|
|
360
|
+
}
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
}));
|
|
364
|
+
}, { scope: "test", title: "context", box: true }],
|
|
365
|
+
_optionContextReuseMode: ["none", { scope: "worker", option: true }],
|
|
366
|
+
_optionConnectOptions: [void 0, { scope: "worker", option: true }],
|
|
367
|
+
_optionErrorContext: [process.env.PLAYWRIGHT_NO_COPY_PROMPT ? void 0 : { format: "markdown" }, { scope: "worker", option: true }],
|
|
368
|
+
_reuseContext: [async ({ video, _optionContextReuseMode }, use) => {
|
|
369
|
+
let mode = _optionContextReuseMode;
|
|
370
|
+
if (process.env.PW_TEST_REUSE_CONTEXT)
|
|
371
|
+
mode = "when-possible";
|
|
372
|
+
const reuse = mode === "when-possible" && normalizeVideoMode(video) === "off";
|
|
373
|
+
await use(reuse);
|
|
374
|
+
}, { scope: "worker", title: "context", box: true }],
|
|
375
|
+
context: async ({ playwright, browser, _reuseContext, _contextFactory }, use, testInfo) => {
|
|
376
|
+
attachConnectedHeaderIfNeeded(testInfo, browser);
|
|
377
|
+
if (!_reuseContext) {
|
|
378
|
+
await use(await _contextFactory());
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const defaultContextOptions = playwright.chromium._defaultContextOptions;
|
|
382
|
+
const context = await browser._newContextForReuse(defaultContextOptions);
|
|
383
|
+
context[kIsReusedContext] = true;
|
|
384
|
+
await use(context);
|
|
385
|
+
const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
|
|
386
|
+
await browser._stopPendingOperations(closeReason);
|
|
387
|
+
},
|
|
388
|
+
page: async ({ context, _reuseContext }, use) => {
|
|
389
|
+
if (!_reuseContext) {
|
|
390
|
+
await use(await context.newPage());
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
let [page] = context.pages();
|
|
394
|
+
if (!page)
|
|
395
|
+
page = await context.newPage();
|
|
396
|
+
await use(page);
|
|
397
|
+
},
|
|
398
|
+
request: async ({ playwright }, use) => {
|
|
399
|
+
const request = await playwright.request.newContext();
|
|
400
|
+
await use(request);
|
|
401
|
+
const hook = test.info()._currentHookType();
|
|
402
|
+
if (hook === "beforeAll") {
|
|
403
|
+
await request.dispose({ reason: [
|
|
404
|
+
`Fixture { request } from beforeAll cannot be reused in a test.`,
|
|
405
|
+
` - Recommended fix: use a separate { request } in the test.`,
|
|
406
|
+
` - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,
|
|
407
|
+
`See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`
|
|
408
|
+
].join("\n") });
|
|
409
|
+
} else {
|
|
410
|
+
await request.dispose();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
function normalizeVideoMode(video) {
|
|
415
|
+
if (!video)
|
|
416
|
+
return "off";
|
|
417
|
+
let videoMode = typeof video === "string" ? video : video.mode;
|
|
418
|
+
if (videoMode === "retry-with-video")
|
|
419
|
+
videoMode = "on-first-retry";
|
|
420
|
+
return videoMode;
|
|
421
|
+
}
|
|
422
|
+
function shouldCaptureVideo(videoMode, testInfo) {
|
|
423
|
+
return videoMode === "on" || videoMode === "retain-on-failure" || videoMode === "on-first-retry" && testInfo.retry === 1;
|
|
424
|
+
}
|
|
425
|
+
function normalizeScreenshotMode(screenshot) {
|
|
426
|
+
if (!screenshot)
|
|
427
|
+
return "off";
|
|
428
|
+
return typeof screenshot === "string" ? screenshot : screenshot.mode;
|
|
429
|
+
}
|
|
430
|
+
function attachConnectedHeaderIfNeeded(testInfo, browser) {
|
|
431
|
+
const connectHeaders = browser?._connection.headers;
|
|
432
|
+
if (!connectHeaders)
|
|
433
|
+
return;
|
|
434
|
+
for (const header of connectHeaders) {
|
|
435
|
+
if (header.name !== "x-playwright-attachment")
|
|
436
|
+
continue;
|
|
437
|
+
const [name, value] = header.value.split("=");
|
|
438
|
+
if (!name || !value)
|
|
439
|
+
continue;
|
|
440
|
+
if (testInfo.attachments.some((attachment) => attachment.name === name))
|
|
441
|
+
continue;
|
|
442
|
+
testInfo.attachments.push({ name, contentType: "text/plain", body: Buffer.from(value) });
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function resolveFileToConfig(file) {
|
|
446
|
+
const config = test.info().config.configFile;
|
|
447
|
+
if (!config || !file)
|
|
448
|
+
return file;
|
|
449
|
+
if (import_path.default.isAbsolute(file))
|
|
450
|
+
return file;
|
|
451
|
+
return import_path.default.resolve(import_path.default.dirname(config), file);
|
|
452
|
+
}
|
|
453
|
+
function resolveClientCerticates(clientCertificates) {
|
|
454
|
+
for (const cert of clientCertificates) {
|
|
455
|
+
cert.certPath = resolveFileToConfig(cert.certPath);
|
|
456
|
+
cert.keyPath = resolveFileToConfig(cert.keyPath);
|
|
457
|
+
cert.pfxPath = resolveFileToConfig(cert.pfxPath);
|
|
458
|
+
}
|
|
459
|
+
return clientCertificates;
|
|
460
|
+
}
|
|
461
|
+
const kTracingStarted = Symbol("kTracingStarted");
|
|
462
|
+
const kIsReusedContext = Symbol("kReusedContext");
|
|
463
|
+
function connectOptionsFromEnv() {
|
|
464
|
+
const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
|
|
465
|
+
if (!wsEndpoint)
|
|
466
|
+
return void 0;
|
|
467
|
+
const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : void 0;
|
|
468
|
+
return {
|
|
469
|
+
wsEndpoint,
|
|
470
|
+
headers,
|
|
471
|
+
exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
class SnapshotRecorder {
|
|
475
|
+
constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
|
|
476
|
+
this._artifactsRecorder = _artifactsRecorder;
|
|
477
|
+
this._mode = _mode;
|
|
478
|
+
this._name = _name;
|
|
479
|
+
this._contentType = _contentType;
|
|
480
|
+
this._extension = _extension;
|
|
481
|
+
this._doSnapshot = _doSnapshot;
|
|
482
|
+
this._ordinal = 0;
|
|
483
|
+
this._temporary = [];
|
|
484
|
+
}
|
|
485
|
+
fixOrdinal() {
|
|
486
|
+
this._ordinal = this.testInfo.attachments.filter((a) => a.name === this._name).length;
|
|
487
|
+
}
|
|
488
|
+
shouldCaptureUponFinish() {
|
|
489
|
+
return this._mode === "on" || this._mode === "only-on-failure" && this.testInfo._isFailure() || this._mode === "on-first-failure" && this.testInfo._isFailure() && this.testInfo.retry === 0;
|
|
490
|
+
}
|
|
491
|
+
async maybeCapture() {
|
|
492
|
+
if (!this.shouldCaptureUponFinish())
|
|
493
|
+
return;
|
|
494
|
+
await Promise.all(this._artifactsRecorder._playwright._allPages().map((page) => this._snapshotPage(page, false)));
|
|
495
|
+
}
|
|
496
|
+
async persistTemporary() {
|
|
497
|
+
if (this.shouldCaptureUponFinish()) {
|
|
498
|
+
await Promise.all(this._temporary.map(async (file) => {
|
|
499
|
+
try {
|
|
500
|
+
const path2 = this._createAttachmentPath();
|
|
501
|
+
await import_fs.default.promises.rename(file, path2);
|
|
502
|
+
this._attach(path2);
|
|
503
|
+
} catch {
|
|
504
|
+
}
|
|
505
|
+
}));
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
async captureTemporary(context) {
|
|
509
|
+
if (this._mode === "on" || this._mode === "only-on-failure" || this._mode === "on-first-failure" && this.testInfo.retry === 0)
|
|
510
|
+
await Promise.all(context.pages().map((page) => this._snapshotPage(page, true)));
|
|
511
|
+
}
|
|
512
|
+
_attach(screenshotPath) {
|
|
513
|
+
this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });
|
|
514
|
+
}
|
|
515
|
+
_createAttachmentPath() {
|
|
516
|
+
const testFailed = this.testInfo._isFailure();
|
|
517
|
+
const index = this._ordinal + 1;
|
|
518
|
+
++this._ordinal;
|
|
519
|
+
const path2 = this.testInfo.outputPath(`test-${testFailed ? "failed" : "finished"}-${index}${this._extension}`);
|
|
520
|
+
return path2;
|
|
521
|
+
}
|
|
522
|
+
_createTemporaryArtifact(...name) {
|
|
523
|
+
const file = import_path.default.join(this._artifactsRecorder._artifactsDir, ...name);
|
|
524
|
+
return file;
|
|
525
|
+
}
|
|
526
|
+
async _snapshotPage(page, temporary) {
|
|
527
|
+
if (page[this.testInfo._uniqueSymbol])
|
|
528
|
+
return;
|
|
529
|
+
page[this.testInfo._uniqueSymbol] = true;
|
|
530
|
+
try {
|
|
531
|
+
const path2 = temporary ? this._createTemporaryArtifact((0, import_utils.createGuid)() + this._extension) : this._createAttachmentPath();
|
|
532
|
+
await this._doSnapshot(page, path2);
|
|
533
|
+
if (temporary)
|
|
534
|
+
this._temporary.push(path2);
|
|
535
|
+
else
|
|
536
|
+
this._attach(path2);
|
|
537
|
+
} catch {
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
get testInfo() {
|
|
541
|
+
return this._artifactsRecorder._testInfo;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
class ArtifactsRecorder {
|
|
545
|
+
constructor(playwright, artifactsDir, screenshot, errorContext) {
|
|
546
|
+
this._reusedContexts = /* @__PURE__ */ new Set();
|
|
547
|
+
this._sourceCache = /* @__PURE__ */ new Map();
|
|
548
|
+
this._playwright = playwright;
|
|
549
|
+
this._artifactsDir = artifactsDir;
|
|
550
|
+
this._errorContext = errorContext;
|
|
551
|
+
const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
|
|
552
|
+
this._startedCollectingArtifacts = Symbol("startedCollectingArtifacts");
|
|
553
|
+
this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), "screenshot", "image/png", ".png", async (page, path2) => {
|
|
554
|
+
await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
async willStartTest(testInfo) {
|
|
558
|
+
this._testInfo = testInfo;
|
|
559
|
+
testInfo._onDidFinishTestFunction = () => this.didFinishTestFunction();
|
|
560
|
+
this._screenshotRecorder.fixOrdinal();
|
|
561
|
+
await Promise.all(this._playwright._allContexts().map(async (context) => {
|
|
562
|
+
if (context[kIsReusedContext])
|
|
563
|
+
this._reusedContexts.add(context);
|
|
564
|
+
else
|
|
565
|
+
await this.didCreateBrowserContext(context);
|
|
566
|
+
}));
|
|
567
|
+
{
|
|
568
|
+
const existingApiRequests = Array.from(this._playwright.request._contexts);
|
|
569
|
+
await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
async didCreateBrowserContext(context) {
|
|
573
|
+
await this._startTraceChunkOnContextCreation(context.tracing);
|
|
574
|
+
}
|
|
575
|
+
async willCloseBrowserContext(context) {
|
|
576
|
+
if (this._reusedContexts.has(context))
|
|
577
|
+
return;
|
|
578
|
+
await this._stopTracing(context.tracing);
|
|
579
|
+
await this._screenshotRecorder.captureTemporary(context);
|
|
580
|
+
await this._takePageSnapshot(context);
|
|
581
|
+
}
|
|
582
|
+
async _takePageSnapshot(context) {
|
|
583
|
+
if (!this._errorContext)
|
|
584
|
+
return;
|
|
585
|
+
if (this._testInfo.errors.length === 0)
|
|
586
|
+
return;
|
|
587
|
+
if (this._pageSnapshot)
|
|
588
|
+
return;
|
|
589
|
+
const page = context.pages()[0];
|
|
590
|
+
try {
|
|
591
|
+
this._pageSnapshot = await page?.locator("body").ariaSnapshot({ timeout: 5e3 });
|
|
592
|
+
} catch {
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
async didCreateRequestContext(context) {
|
|
596
|
+
const tracing2 = context._tracing;
|
|
597
|
+
await this._startTraceChunkOnContextCreation(tracing2);
|
|
598
|
+
}
|
|
599
|
+
async willCloseRequestContext(context) {
|
|
600
|
+
const tracing2 = context._tracing;
|
|
601
|
+
await this._stopTracing(tracing2);
|
|
602
|
+
}
|
|
603
|
+
async didFinishTestFunction() {
|
|
604
|
+
await this._screenshotRecorder.maybeCapture();
|
|
605
|
+
}
|
|
606
|
+
async didFinishTest() {
|
|
607
|
+
await this.didFinishTestFunction();
|
|
608
|
+
const leftoverContexts = this._playwright._allContexts().filter((context2) => !this._reusedContexts.has(context2));
|
|
609
|
+
const leftoverApiRequests = Array.from(this._playwright.request._contexts);
|
|
610
|
+
await Promise.all(leftoverContexts.map(async (context2) => {
|
|
611
|
+
await this._stopTracing(context2.tracing);
|
|
612
|
+
}).concat(leftoverApiRequests.map(async (context2) => {
|
|
613
|
+
const tracing2 = context2._tracing;
|
|
614
|
+
await this._stopTracing(tracing2);
|
|
615
|
+
})));
|
|
616
|
+
await this._screenshotRecorder.persistTemporary();
|
|
617
|
+
const context = leftoverContexts[0];
|
|
618
|
+
if (context)
|
|
619
|
+
await this._takePageSnapshot(context);
|
|
620
|
+
if (this._errorContext)
|
|
621
|
+
await (0, import_errorContext.attachErrorContext)(this._testInfo, this._errorContext.format, this._sourceCache, this._pageSnapshot);
|
|
622
|
+
}
|
|
623
|
+
async _startTraceChunkOnContextCreation(tracing2) {
|
|
624
|
+
const options = this._testInfo._tracing.traceOptions();
|
|
625
|
+
if (options) {
|
|
626
|
+
const title = this._testInfo._tracing.traceTitle();
|
|
627
|
+
const name = this._testInfo._tracing.generateNextTraceRecordingName();
|
|
628
|
+
if (!tracing2[kTracingStarted]) {
|
|
629
|
+
await tracing2.start({ ...options, title, name });
|
|
630
|
+
tracing2[kTracingStarted] = true;
|
|
631
|
+
} else {
|
|
632
|
+
await tracing2.startChunk({ title, name });
|
|
633
|
+
}
|
|
634
|
+
} else {
|
|
635
|
+
if (tracing2[kTracingStarted]) {
|
|
636
|
+
tracing2[kTracingStarted] = false;
|
|
637
|
+
await tracing2.stop();
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
async _stopTracing(tracing2) {
|
|
642
|
+
if (tracing2[this._startedCollectingArtifacts])
|
|
643
|
+
return;
|
|
644
|
+
tracing2[this._startedCollectingArtifacts] = true;
|
|
645
|
+
if (this._testInfo._tracing.traceOptions() && tracing2[kTracingStarted])
|
|
646
|
+
await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function paramsToRender(apiName) {
|
|
650
|
+
switch (apiName) {
|
|
651
|
+
case "locator.fill":
|
|
652
|
+
return ["value"];
|
|
653
|
+
default:
|
|
654
|
+
return ["url", "selector", "text", "key"];
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function renderApiCall(apiName, params) {
|
|
658
|
+
if (apiName === "tracing.group")
|
|
659
|
+
return params.name;
|
|
660
|
+
const paramsArray = [];
|
|
661
|
+
if (params) {
|
|
662
|
+
for (const name of paramsToRender(apiName)) {
|
|
663
|
+
if (!(name in params))
|
|
664
|
+
continue;
|
|
665
|
+
let value;
|
|
666
|
+
if (name === "selector" && (0, import_utils.isString)(params[name]) && params[name].startsWith("internal:")) {
|
|
667
|
+
const getter = (0, import_utils.asLocator)("javascript", params[name]);
|
|
668
|
+
apiName = apiName.replace(/^locator\./, "locator." + getter + ".");
|
|
669
|
+
apiName = apiName.replace(/^page\./, "page." + getter + ".");
|
|
670
|
+
apiName = apiName.replace(/^frame\./, "frame." + getter + ".");
|
|
671
|
+
} else {
|
|
672
|
+
value = params[name];
|
|
673
|
+
paramsArray.push(value);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
const paramsText = paramsArray.length ? "(" + paramsArray.join(", ") + ")" : "";
|
|
678
|
+
return apiName + paramsText;
|
|
679
|
+
}
|
|
680
|
+
function tracing() {
|
|
681
|
+
return test.info()._tracing;
|
|
682
|
+
}
|
|
683
|
+
const test = _baseTest.extend(playwrightFixtures);
|
|
684
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
685
|
+
0 && (module.exports = {
|
|
686
|
+
_baseTest,
|
|
687
|
+
defineConfig,
|
|
688
|
+
expect,
|
|
689
|
+
mergeExpects,
|
|
690
|
+
mergeTests,
|
|
691
|
+
test
|
|
692
|
+
});
|