@smoothdeploy/playwright 1.57.1 → 1.58.1-beta-1770383926000
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.
Potentially problematic release.
This version of @smoothdeploy/playwright might be problematic. Click here for more details.
- package/ThirdPartyNotices.txt +1188 -65
- package/lib/agents/agentParser.js +89 -0
- package/lib/agents/generateAgents.js +27 -74
- package/lib/agents/generateAgents.js.map +7 -0
- package/lib/agents/playwright-test-planner.agent.md +1 -0
- package/lib/common/config.js +6 -4
- package/lib/common/config.js.map +7 -0
- package/lib/common/configLoader.js.map +7 -0
- package/lib/common/esmLoaderHost.js +2 -0
- package/lib/common/esmLoaderHost.js.map +7 -0
- package/lib/common/expectBundle.js +2 -17
- package/lib/common/expectBundle.js.map +7 -0
- package/lib/common/expectBundleImpl.js +132 -132
- package/lib/common/expectBundleImpl.js.map +7 -0
- package/lib/common/fixtures.js.map +7 -0
- package/lib/common/globals.js.map +7 -0
- package/lib/common/ipc.js.map +7 -0
- package/lib/common/poolBuilder.js.map +7 -0
- package/lib/common/process.js +28 -0
- package/lib/common/process.js.map +7 -0
- package/lib/common/suiteUtils.js.map +7 -0
- package/lib/common/test.js.map +7 -0
- package/lib/common/testLoader.js.map +7 -0
- package/lib/common/testType.js.map +7 -0
- package/lib/common/validators.js +10 -10
- package/lib/common/validators.js.map +7 -0
- package/lib/fsWatcher.js.map +7 -0
- package/lib/index.js +205 -12
- package/lib/index.js.map +7 -0
- package/lib/internalsForTest.js.map +7 -0
- package/lib/isomorphic/events.js.map +7 -0
- package/lib/isomorphic/folders.js.map +7 -0
- package/lib/isomorphic/stringInternPool.js.map +7 -0
- package/lib/isomorphic/teleReceiver.js +15 -2
- package/lib/isomorphic/teleReceiver.js.map +7 -0
- package/lib/isomorphic/teleSuiteUpdater.js +24 -4
- package/lib/isomorphic/teleSuiteUpdater.js.map +7 -0
- package/lib/isomorphic/testServerConnection.js.map +7 -0
- package/lib/isomorphic/testServerInterface.js.map +7 -0
- package/lib/isomorphic/testTree.js +13 -18
- package/lib/isomorphic/testTree.js.map +7 -0
- package/lib/isomorphic/types.d.js.map +7 -0
- package/lib/loader/loaderMain.js.map +7 -0
- package/lib/matchers/expect.js +2 -15
- package/lib/matchers/expect.js.map +7 -0
- package/lib/matchers/matcherHint.js +1 -44
- package/lib/matchers/matcherHint.js.map +7 -0
- package/lib/matchers/matchers.js +3 -2
- package/lib/matchers/matchers.js.map +7 -0
- package/lib/matchers/toBeTruthy.js +5 -3
- package/lib/matchers/toBeTruthy.js.map +7 -0
- package/lib/matchers/toEqual.js +4 -3
- package/lib/matchers/toEqual.js.map +7 -0
- package/lib/matchers/toHaveURL.js +5 -6
- package/lib/matchers/toHaveURL.js.map +7 -0
- package/lib/matchers/toMatchAriaSnapshot.js +5 -5
- package/lib/matchers/toMatchAriaSnapshot.js.map +7 -0
- package/lib/matchers/toMatchSnapshot.js +9 -8
- package/lib/matchers/toMatchSnapshot.js.map +7 -0
- package/lib/matchers/toMatchText.js +9 -9
- package/lib/matchers/toMatchText.js.map +7 -0
- package/lib/mcp/browser/actions.d.js.map +7 -0
- package/lib/mcp/browser/browserContextFactory.js +62 -29
- package/lib/mcp/browser/browserContextFactory.js.map +7 -0
- package/lib/mcp/browser/browserServerBackend.js +17 -9
- package/lib/mcp/browser/browserServerBackend.js.map +7 -0
- package/lib/mcp/browser/codegen.js.map +7 -0
- package/lib/mcp/browser/config.js +65 -12
- package/lib/mcp/browser/config.js.map +7 -0
- package/lib/mcp/browser/context.js +71 -94
- package/lib/mcp/browser/context.js.map +7 -0
- package/lib/mcp/browser/response.js +172 -131
- package/lib/mcp/browser/response.js.map +7 -0
- package/lib/mcp/browser/sessionLog.js +19 -104
- package/lib/mcp/browser/sessionLog.js.map +7 -0
- package/lib/mcp/browser/tab.js +92 -41
- package/lib/mcp/browser/tab.js.map +7 -0
- package/lib/mcp/browser/tools/common.js +8 -6
- package/lib/mcp/browser/tools/common.js.map +7 -0
- package/lib/mcp/browser/tools/console.js +7 -5
- package/lib/mcp/browser/tools/console.js.map +7 -0
- package/lib/mcp/browser/tools/dialogs.js +4 -4
- package/lib/mcp/browser/tools/dialogs.js.map +7 -0
- package/lib/mcp/browser/tools/evaluate.js +11 -19
- package/lib/mcp/browser/tools/evaluate.js.map +7 -0
- package/lib/mcp/browser/tools/files.js +3 -3
- package/lib/mcp/browser/tools/files.js.map +7 -0
- package/lib/mcp/browser/tools/form.js +9 -19
- package/lib/mcp/browser/tools/form.js.map +7 -0
- package/lib/mcp/browser/tools/install.js +6 -3
- package/lib/mcp/browser/tools/install.js.map +7 -0
- package/lib/mcp/browser/tools/keyboard.js +34 -11
- package/lib/mcp/browser/tools/keyboard.js.map +7 -0
- package/lib/mcp/browser/tools/mouse.js +11 -11
- package/lib/mcp/browser/tools/mouse.js.map +7 -0
- package/lib/mcp/browser/tools/navigate.js +14 -5
- package/lib/mcp/browser/tools/navigate.js.map +7 -0
- package/lib/mcp/browser/tools/network.js +20 -11
- package/lib/mcp/browser/tools/network.js.map +7 -0
- package/lib/mcp/browser/tools/open.js +57 -0
- package/lib/mcp/browser/tools/pdf.js +9 -19
- package/lib/mcp/browser/tools/pdf.js.map +7 -0
- package/lib/mcp/browser/tools/runCode.js +11 -8
- package/lib/mcp/browser/tools/runCode.js.map +7 -0
- package/lib/mcp/browser/tools/screenshot.js +16 -29
- package/lib/mcp/browser/tools/screenshot.js.map +7 -0
- package/lib/mcp/browser/tools/snapshot.js +21 -29
- package/lib/mcp/browser/tools/snapshot.js.map +7 -0
- package/lib/mcp/browser/tools/tabs.js +12 -12
- package/lib/mcp/browser/tools/tabs.js.map +7 -0
- package/lib/mcp/browser/tools/tool.js +2 -4
- package/lib/mcp/browser/tools/tool.js.map +7 -0
- package/lib/mcp/browser/tools/tracing.js +6 -6
- package/lib/mcp/browser/tools/tracing.js.map +7 -0
- package/lib/mcp/browser/tools/utils.js +49 -44
- package/lib/mcp/browser/tools/utils.js.map +7 -0
- package/lib/mcp/browser/tools/verify.js +24 -34
- package/lib/mcp/browser/tools/verify.js.map +7 -0
- package/lib/mcp/browser/tools/wait.js +6 -6
- package/lib/mcp/browser/tools/wait.js.map +7 -0
- package/lib/mcp/browser/tools.js +3 -1
- package/lib/mcp/browser/tools.js.map +7 -0
- package/lib/mcp/browser/watchdog.js.map +7 -0
- package/lib/mcp/config.d.js.map +7 -0
- package/lib/mcp/extension/cdpRelay.js +1 -1
- package/lib/mcp/extension/cdpRelay.js.map +7 -0
- package/lib/mcp/extension/extensionContextFactory.js +6 -5
- package/lib/mcp/extension/extensionContextFactory.js.map +7 -0
- package/lib/mcp/extension/protocol.js.map +7 -0
- package/lib/mcp/index.js.map +7 -0
- package/lib/mcp/log.js.map +7 -0
- package/lib/mcp/program.js +15 -20
- package/lib/mcp/program.js.map +7 -0
- package/lib/mcp/sdk/bundle.js.map +7 -0
- package/lib/mcp/sdk/exports.js +0 -2
- package/lib/mcp/sdk/exports.js.map +7 -0
- package/lib/mcp/sdk/http.js +20 -55
- package/lib/mcp/sdk/http.js.map +7 -0
- package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
- package/lib/mcp/sdk/proxyBackend.js.map +7 -0
- package/lib/mcp/sdk/server.js +29 -4
- package/lib/mcp/sdk/server.js.map +7 -0
- package/lib/mcp/sdk/tool.js +2 -2
- package/lib/mcp/sdk/tool.js.map +7 -0
- package/lib/mcp/terminal/cli.js +296 -0
- package/lib/mcp/terminal/command.js +56 -0
- package/lib/mcp/terminal/commands.js +333 -0
- package/lib/mcp/terminal/daemon.js +129 -0
- package/lib/mcp/terminal/help.json +32 -0
- package/lib/mcp/terminal/helpGenerator.js +88 -0
- package/lib/mcp/terminal/socketConnection.js +80 -0
- package/lib/mcp/test/browserBackend.js +3 -13
- package/lib/mcp/test/browserBackend.js.map +7 -0
- package/lib/mcp/test/generatorTools.js +9 -9
- package/lib/mcp/test/generatorTools.js.map +7 -0
- package/lib/mcp/test/plannerTools.js +23 -22
- package/lib/mcp/test/plannerTools.js.map +7 -0
- package/lib/mcp/test/seed.js.map +7 -0
- package/lib/mcp/test/streams.js.map +7 -0
- package/lib/mcp/test/testBackend.js +6 -6
- package/lib/mcp/test/testBackend.js.map +7 -0
- package/lib/mcp/test/testContext.js +9 -3
- package/lib/mcp/test/testContext.js.map +7 -0
- package/lib/mcp/test/testTool.js.map +7 -0
- package/lib/mcp/test/testTools.js +12 -10
- package/lib/mcp/test/testTools.js.map +7 -0
- package/lib/mcpBundleImpl.js.map +7 -0
- package/lib/plugins/gitCommitInfoPlugin.js.map +7 -0
- package/lib/plugins/index.js.map +7 -0
- package/lib/plugins/webServerPlugin.js.map +7 -0
- package/lib/program.js +18 -4
- package/lib/program.js.map +7 -0
- package/lib/reporters/base.js +29 -4
- package/lib/reporters/base.js.map +7 -0
- package/lib/reporters/blob.js +3 -0
- package/lib/reporters/blob.js.map +7 -0
- package/lib/reporters/dot.js +17 -0
- package/lib/reporters/dot.js.map +7 -0
- package/lib/reporters/empty.js.map +7 -0
- package/lib/reporters/github.js.map +7 -0
- package/lib/reporters/html.js +13 -3
- package/lib/reporters/html.js.map +7 -0
- package/lib/reporters/internalReporter.js +6 -0
- package/lib/reporters/internalReporter.js.map +7 -0
- package/lib/reporters/json.js.map +7 -0
- package/lib/reporters/junit.js.map +7 -0
- package/lib/reporters/line.js +18 -0
- package/lib/reporters/line.js.map +7 -0
- package/lib/reporters/list.js +22 -0
- package/lib/reporters/list.js.map +7 -0
- package/lib/reporters/listModeReporter.js.map +7 -0
- package/lib/reporters/markdown.js.map +7 -0
- package/lib/reporters/merge.js +25 -8
- package/lib/reporters/merge.js.map +7 -0
- package/lib/reporters/multiplexer.js +8 -0
- package/lib/reporters/multiplexer.js.map +7 -0
- package/lib/reporters/reporterV2.js.map +7 -0
- package/lib/reporters/smoothdeploy.js +191 -0
- package/lib/reporters/teleEmitter.js +22 -4
- package/lib/reporters/teleEmitter.js.map +7 -0
- package/lib/reporters/versions/blobV1.js.map +7 -0
- package/lib/runner/dispatcher.js +20 -4
- package/lib/runner/dispatcher.js.map +7 -0
- package/lib/runner/failureTracker.js.map +7 -0
- package/lib/runner/lastRun.js.map +7 -0
- package/lib/runner/loadUtils.js +2 -2
- package/lib/runner/loadUtils.js.map +7 -0
- package/lib/runner/loaderHost.js.map +7 -0
- package/lib/runner/processHost.js +19 -0
- package/lib/runner/processHost.js.map +7 -0
- package/lib/runner/projectUtils.js +1 -1
- package/lib/runner/projectUtils.js.map +7 -0
- package/lib/runner/rebase.js.map +7 -0
- package/lib/runner/reporters.js +3 -1
- package/lib/runner/reporters.js.map +7 -0
- package/lib/runner/sigIntWatcher.js.map +7 -0
- package/lib/runner/storage.js +91 -0
- package/lib/runner/taskRunner.js.map +7 -0
- package/lib/runner/tasks.js.map +7 -0
- package/lib/runner/testGroups.js +14 -6
- package/lib/runner/testGroups.js.map +7 -0
- package/lib/runner/testRunner.js +13 -4
- package/lib/runner/testRunner.js.map +7 -0
- package/lib/runner/testServer.js +2 -2
- package/lib/runner/testServer.js.map +7 -0
- package/lib/runner/uiModeReporter.js.map +7 -0
- package/lib/runner/vcs.js.map +7 -0
- package/lib/runner/watchMode.js +2 -1
- package/lib/runner/watchMode.js.map +7 -0
- package/lib/runner/workerHost.js +6 -0
- package/lib/runner/workerHost.js.map +7 -0
- package/lib/third_party/pirates.js.map +7 -0
- package/lib/third_party/tsconfig-loader.js.map +7 -0
- package/lib/transform/babelBundle.js +3 -0
- package/lib/transform/babelBundle.js.map +7 -0
- package/lib/transform/babelBundleImpl.js +134 -134
- package/lib/transform/babelBundleImpl.js.map +7 -0
- package/lib/transform/compilationCache.js +2 -0
- package/lib/transform/compilationCache.js.map +7 -0
- package/lib/transform/esmLoader.js +10 -11
- package/lib/transform/esmLoader.js.map +7 -0
- package/lib/transform/md.js +221 -0
- package/lib/transform/portTransport.js.map +7 -0
- package/lib/transform/transform.js +18 -8
- package/lib/transform/transform.js.map +7 -0
- package/lib/util.js +3 -6
- package/lib/util.js.map +7 -0
- package/lib/utilsBundle.js +7 -0
- package/lib/utilsBundle.js.map +7 -0
- package/lib/utilsBundleImpl.js +51 -48
- package/lib/utilsBundleImpl.js.map +7 -0
- package/lib/worker/fixtureRunner.js +6 -2
- package/lib/worker/fixtureRunner.js.map +7 -0
- package/lib/worker/testInfo.js +39 -19
- package/lib/worker/testInfo.js.map +7 -0
- package/lib/worker/testTracing.js.map +7 -0
- package/lib/worker/timeoutManager.js.map +7 -0
- package/lib/worker/util.js.map +7 -0
- package/lib/worker/workerMain.js +17 -16
- package/lib/worker/workerMain.js.map +7 -0
- package/package.json +2 -2
- package/test.mjs +1 -0
- package/types/test.d.ts +26 -6
- package/types/testReporter.d.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -40,6 +40,8 @@ var import_fs = __toESM(require("fs"));
|
|
|
40
40
|
var import_path = __toESM(require("path"));
|
|
41
41
|
var playwrightLibrary = __toESM(require("playwright-core"));
|
|
42
42
|
var import_utils = require("playwright-core/lib/utils");
|
|
43
|
+
var import_screenshotCompositor = require("playwright-core/lib/server/screenshotCompositor");
|
|
44
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
43
45
|
var import_globals = require("./common/globals");
|
|
44
46
|
var import_testType = require("./common/testType");
|
|
45
47
|
var import_browserBackend = require("./mcp/test/browserBackend");
|
|
@@ -73,6 +75,7 @@ const playwrightFixtures = {
|
|
|
73
75
|
await use(connectOptionsFromEnv() || _optionConnectOptions);
|
|
74
76
|
}, { scope: "worker", option: true, box: true }],
|
|
75
77
|
screenshot: ["off", { scope: "worker", option: true, box: true }],
|
|
78
|
+
resultScreenshots: [false, { scope: "worker", option: true, box: true }],
|
|
76
79
|
video: ["off", { scope: "worker", option: true, box: true }],
|
|
77
80
|
trace: ["off", { scope: "worker", option: true, box: true }],
|
|
78
81
|
_browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
|
|
@@ -138,6 +141,7 @@ const playwrightFixtures = {
|
|
|
138
141
|
}, { option: true, box: true }],
|
|
139
142
|
serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
|
|
140
143
|
contextOptions: [{}, { option: true, box: true }],
|
|
144
|
+
agentOptions: [void 0, { option: true, box: true }],
|
|
141
145
|
_combinedContextOptions: [async ({
|
|
142
146
|
acceptDownloads,
|
|
143
147
|
bypassCSP,
|
|
@@ -162,7 +166,7 @@ const playwrightFixtures = {
|
|
|
162
166
|
baseURL,
|
|
163
167
|
contextOptions,
|
|
164
168
|
serviceWorkers
|
|
165
|
-
}, use) => {
|
|
169
|
+
}, use, testInfo) => {
|
|
166
170
|
const options = {};
|
|
167
171
|
if (acceptDownloads !== void 0)
|
|
168
172
|
options.acceptDownloads = acceptDownloads;
|
|
@@ -213,21 +217,19 @@ const playwrightFixtures = {
|
|
|
213
217
|
...options
|
|
214
218
|
});
|
|
215
219
|
}, { box: true }],
|
|
216
|
-
_setupContextOptions: [async ({ playwright,
|
|
220
|
+
_setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, testInfo) => {
|
|
217
221
|
if (testIdAttribute)
|
|
218
222
|
playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
|
|
219
223
|
testInfo.snapshotSuffix = process.platform;
|
|
220
224
|
if ((0, import_utils.debugMode)() === "inspector")
|
|
221
225
|
testInfo._setDebugMode();
|
|
222
|
-
playwright._defaultContextOptions = _combinedContextOptions;
|
|
223
226
|
playwright._defaultContextTimeout = actionTimeout || 0;
|
|
224
227
|
playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
|
|
225
228
|
await use();
|
|
226
|
-
playwright._defaultContextOptions = void 0;
|
|
227
229
|
playwright._defaultContextTimeout = void 0;
|
|
228
230
|
playwright._defaultContextNavigationTimeout = void 0;
|
|
229
231
|
}, { auto: "all-hooks-included", title: "context configuration", box: true }],
|
|
230
|
-
_setupArtifacts: [async ({ playwright, screenshot }, use, testInfo) => {
|
|
232
|
+
_setupArtifacts: [async ({ playwright, screenshot, resultScreenshots, _combinedContextOptions }, use, testInfo) => {
|
|
231
233
|
testInfo.setTimeout(testInfo.project.timeout);
|
|
232
234
|
const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
|
|
233
235
|
await artifactsRecorder.willStartTest(testInfo);
|
|
@@ -247,10 +249,11 @@ const playwrightFixtures = {
|
|
|
247
249
|
data.stepId = zone.stepId;
|
|
248
250
|
return;
|
|
249
251
|
}
|
|
252
|
+
const stepTitle = renderTitle(channel.type, channel.method, channel.params, data.title);
|
|
250
253
|
const step = testInfo2._addStep({
|
|
251
254
|
location: data.frames[0],
|
|
252
255
|
category: "pw:api",
|
|
253
|
-
title:
|
|
256
|
+
title: stepTitle,
|
|
254
257
|
apiName: data.apiName,
|
|
255
258
|
params: channel.params,
|
|
256
259
|
group: (0, import_utils.getActionGroup)({ type: channel.type, method: channel.method })
|
|
@@ -259,8 +262,10 @@ const playwrightFixtures = {
|
|
|
259
262
|
data.stepId = step.stepId;
|
|
260
263
|
if (data.apiName === "tracing.group")
|
|
261
264
|
tracingGroupSteps.push(step);
|
|
265
|
+
if (resultScreenshots && channel.params?.selector)
|
|
266
|
+
data._channel = channel;
|
|
262
267
|
},
|
|
263
|
-
onApiCallEnd: (data) => {
|
|
268
|
+
onApiCallEnd: async (data) => {
|
|
264
269
|
if (data.apiName === "tracing.group")
|
|
265
270
|
return;
|
|
266
271
|
if (data.apiName === "tracing.groupEnd") {
|
|
@@ -268,6 +273,16 @@ const playwrightFixtures = {
|
|
|
268
273
|
step2?.complete({ error: data.error });
|
|
269
274
|
return;
|
|
270
275
|
}
|
|
276
|
+
const channel = data._channel;
|
|
277
|
+
if (channel && !data.error) {
|
|
278
|
+
const testInfo2 = (0, import_globals.currentTestInfo)();
|
|
279
|
+
if (testInfo2) {
|
|
280
|
+
try {
|
|
281
|
+
await captureResultScreenshot(channel, data, testInfo2);
|
|
282
|
+
} catch {
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
271
286
|
const step = data.userData;
|
|
272
287
|
step?.complete({ error: data.error });
|
|
273
288
|
},
|
|
@@ -275,20 +290,32 @@ const playwrightFixtures = {
|
|
|
275
290
|
if (!keepTestTimeout)
|
|
276
291
|
(0, import_globals.currentTestInfo)()?._setDebugMode();
|
|
277
292
|
},
|
|
293
|
+
runBeforeCreateBrowserContext: async (options) => {
|
|
294
|
+
for (const [key, value] of Object.entries(_combinedContextOptions)) {
|
|
295
|
+
if (!(key in options))
|
|
296
|
+
options[key] = value;
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
runBeforeCreateRequestContext: async (options) => {
|
|
300
|
+
for (const [key, value] of Object.entries(_combinedContextOptions)) {
|
|
301
|
+
if (!(key in options))
|
|
302
|
+
options[key] = value;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
278
305
|
runAfterCreateBrowserContext: async (context) => {
|
|
279
|
-
await artifactsRecorder
|
|
306
|
+
await artifactsRecorder.didCreateBrowserContext(context);
|
|
280
307
|
const testInfo2 = (0, import_globals.currentTestInfo)();
|
|
281
308
|
if (testInfo2)
|
|
282
309
|
attachConnectedHeaderIfNeeded(testInfo2, context.browser());
|
|
283
310
|
},
|
|
284
311
|
runAfterCreateRequestContext: async (context) => {
|
|
285
|
-
await artifactsRecorder
|
|
312
|
+
await artifactsRecorder.didCreateRequestContext(context);
|
|
286
313
|
},
|
|
287
314
|
runBeforeCloseBrowserContext: async (context) => {
|
|
288
|
-
await artifactsRecorder
|
|
315
|
+
await artifactsRecorder.willCloseBrowserContext(context);
|
|
289
316
|
},
|
|
290
317
|
runBeforeCloseRequestContext: async (context) => {
|
|
291
|
-
await artifactsRecorder
|
|
318
|
+
await artifactsRecorder.willCloseRequestContext(context);
|
|
292
319
|
}
|
|
293
320
|
};
|
|
294
321
|
const clientInstrumentation = playwright._instrumentation;
|
|
@@ -401,6 +428,39 @@ const playwrightFixtures = {
|
|
|
401
428
|
page = await context.newPage();
|
|
402
429
|
await use(page);
|
|
403
430
|
},
|
|
431
|
+
agent: async ({ page, agentOptions }, use, testInfo) => {
|
|
432
|
+
const testInfoImpl = testInfo;
|
|
433
|
+
const cachePathTemplate = agentOptions?.cachePathTemplate ?? "{testDir}/{testFilePath}-cache.json";
|
|
434
|
+
const resolvedCacheFile = testInfoImpl._applyPathTemplate(cachePathTemplate, "", ".json");
|
|
435
|
+
const cacheFile = testInfoImpl.config.runAgents === "all" ? void 0 : await testInfoImpl._cloneStorage(resolvedCacheFile);
|
|
436
|
+
const cacheOutFile = import_path.default.join(testInfoImpl.artifactsDir(), "agent-cache-" + (0, import_utils.createGuid)() + ".json");
|
|
437
|
+
const provider = agentOptions?.provider && testInfo.config.runAgents !== "none" ? agentOptions.provider : void 0;
|
|
438
|
+
if (provider)
|
|
439
|
+
testInfo.setTimeout(0);
|
|
440
|
+
const cache = {
|
|
441
|
+
cacheFile,
|
|
442
|
+
cacheOutFile
|
|
443
|
+
};
|
|
444
|
+
const agent = await page.agent({
|
|
445
|
+
provider,
|
|
446
|
+
cache,
|
|
447
|
+
limits: agentOptions?.limits,
|
|
448
|
+
secrets: agentOptions?.secrets,
|
|
449
|
+
systemPrompt: agentOptions?.systemPrompt,
|
|
450
|
+
expect: {
|
|
451
|
+
timeout: testInfoImpl._projectInternal.expect?.timeout
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
await use(agent);
|
|
455
|
+
const usage = await agent.usage();
|
|
456
|
+
if (usage.turns > 0)
|
|
457
|
+
await testInfoImpl.attach("agent-usage", { contentType: "application/json", body: Buffer.from(JSON.stringify(usage, null, 2)) });
|
|
458
|
+
if (!resolvedCacheFile || !cacheOutFile)
|
|
459
|
+
return;
|
|
460
|
+
if (testInfo.status !== "passed")
|
|
461
|
+
return;
|
|
462
|
+
await testInfoImpl._upstreamStorage(resolvedCacheFile, cacheOutFile);
|
|
463
|
+
},
|
|
404
464
|
request: async ({ playwright }, use) => {
|
|
405
465
|
const request = await playwright.request.newContext();
|
|
406
466
|
await use(request);
|
|
@@ -477,13 +537,14 @@ function connectOptionsFromEnv() {
|
|
|
477
537
|
};
|
|
478
538
|
}
|
|
479
539
|
class SnapshotRecorder {
|
|
480
|
-
constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
|
|
540
|
+
constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot, _doAdditionalSnapshot) {
|
|
481
541
|
this._artifactsRecorder = _artifactsRecorder;
|
|
482
542
|
this._mode = _mode;
|
|
483
543
|
this._name = _name;
|
|
484
544
|
this._contentType = _contentType;
|
|
485
545
|
this._extension = _extension;
|
|
486
546
|
this._doSnapshot = _doSnapshot;
|
|
547
|
+
this._doAdditionalSnapshot = _doAdditionalSnapshot;
|
|
487
548
|
this._ordinal = 0;
|
|
488
549
|
this._temporary = [];
|
|
489
550
|
}
|
|
@@ -539,6 +600,21 @@ class SnapshotRecorder {
|
|
|
539
600
|
this._temporary.push(path2);
|
|
540
601
|
else
|
|
541
602
|
this._attach(path2);
|
|
603
|
+
if (this._doAdditionalSnapshot) {
|
|
604
|
+
try {
|
|
605
|
+
await this._doAdditionalSnapshot(page, path2, this.testInfo);
|
|
606
|
+
if (!temporary && this.testInfo._isFailure()) {
|
|
607
|
+
const highlightedPath = path2.replace(this._extension, `-highlighted${this._extension}`);
|
|
608
|
+
const elementPath = path2.replace(this._extension, `-element${this._extension}`);
|
|
609
|
+
const fs2 = require("fs");
|
|
610
|
+
if (fs2.existsSync(highlightedPath))
|
|
611
|
+
this._attach(highlightedPath);
|
|
612
|
+
if (fs2.existsSync(elementPath))
|
|
613
|
+
this._attach(elementPath);
|
|
614
|
+
}
|
|
615
|
+
} catch {
|
|
616
|
+
}
|
|
617
|
+
}
|
|
542
618
|
} catch {
|
|
543
619
|
}
|
|
544
620
|
}
|
|
@@ -556,6 +632,42 @@ class ArtifactsRecorder {
|
|
|
556
632
|
await page._wrapApiCall(async () => {
|
|
557
633
|
await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
|
|
558
634
|
}, { internal: true });
|
|
635
|
+
}, async (page, path2, testInfo) => {
|
|
636
|
+
if (!testInfo._isFailure())
|
|
637
|
+
return;
|
|
638
|
+
await page._wrapApiCall(async () => {
|
|
639
|
+
await page.screenshot({
|
|
640
|
+
...screenshotOptions,
|
|
641
|
+
timeout: 5e3,
|
|
642
|
+
path: path2.replace(".png", "-highlighted.png"),
|
|
643
|
+
caret: "initial",
|
|
644
|
+
style: `
|
|
645
|
+
a, button, input, select, textarea, [role="button"], [role="link"],
|
|
646
|
+
[onclick], [tabindex]:not([tabindex="-1"]), [contenteditable="true"] {
|
|
647
|
+
outline: 2px solid #ff0000 !important;
|
|
648
|
+
outline-offset: 2px !important;
|
|
649
|
+
box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3) !important;
|
|
650
|
+
}
|
|
651
|
+
`
|
|
652
|
+
});
|
|
653
|
+
}, { internal: true });
|
|
654
|
+
const error = testInfo.errors[0];
|
|
655
|
+
if (error) {
|
|
656
|
+
const selector = this._extractSelectorFromError(error);
|
|
657
|
+
if (selector) {
|
|
658
|
+
try {
|
|
659
|
+
await page._wrapApiCall(async () => {
|
|
660
|
+
const locator = page.locator(selector);
|
|
661
|
+
const elementHandle = await locator.elementHandle({ timeout: 2e3 });
|
|
662
|
+
if (elementHandle) {
|
|
663
|
+
const buffer = await elementHandle.screenshot({ timeout: 5e3, type: "png" });
|
|
664
|
+
await require("fs").promises.writeFile(path2.replace(".png", "-element.png"), buffer);
|
|
665
|
+
}
|
|
666
|
+
}, { internal: true });
|
|
667
|
+
} catch {
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
559
671
|
});
|
|
560
672
|
}
|
|
561
673
|
async willStartTest(testInfo) {
|
|
@@ -659,6 +771,87 @@ class ArtifactsRecorder {
|
|
|
659
771
|
await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
|
|
660
772
|
}, { internal: true });
|
|
661
773
|
}
|
|
774
|
+
_extractSelectorFromError(error) {
|
|
775
|
+
if (!error || !error.message)
|
|
776
|
+
return null;
|
|
777
|
+
const message = error.message;
|
|
778
|
+
const locatorMatch = message.match(/locator\(['"]([^'"]+)['"]\)/);
|
|
779
|
+
if (locatorMatch)
|
|
780
|
+
return locatorMatch[1];
|
|
781
|
+
const getByRoleMatch = message.match(/getByRole\(['"]([^'"]+)['"]\)/);
|
|
782
|
+
if (getByRoleMatch)
|
|
783
|
+
return `[role="${getByRoleMatch[1]}"]`;
|
|
784
|
+
const getByTextMatch = message.match(/getByText\(['"]([^'"]+)['"]\)/);
|
|
785
|
+
if (getByTextMatch)
|
|
786
|
+
return `text=${getByTextMatch[1]}`;
|
|
787
|
+
const quotedMatch = message.match(/['"]([#.[\w\-=\]]+)['"]/);
|
|
788
|
+
if (quotedMatch && (quotedMatch[1].startsWith("#") || quotedMatch[1].startsWith(".") || quotedMatch[1].startsWith("[")))
|
|
789
|
+
return quotedMatch[1];
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
let _capturingResultScreenshot = false;
|
|
794
|
+
async function captureResultScreenshot(channel, data, testInfo) {
|
|
795
|
+
if (_capturingResultScreenshot)
|
|
796
|
+
return;
|
|
797
|
+
_capturingResultScreenshot = true;
|
|
798
|
+
try {
|
|
799
|
+
const obj = channel.object;
|
|
800
|
+
if (!obj)
|
|
801
|
+
return;
|
|
802
|
+
const selector = channel.params?.selector;
|
|
803
|
+
if (!selector)
|
|
804
|
+
return;
|
|
805
|
+
const page = obj._type === "Frame" ? obj.page() : obj._type === "Page" ? obj : void 0;
|
|
806
|
+
if (!page)
|
|
807
|
+
return;
|
|
808
|
+
const frame = obj._type === "Frame" ? obj : page.mainFrame();
|
|
809
|
+
const box = await page._wrapApiCall(async () => {
|
|
810
|
+
const element = await frame.$(selector);
|
|
811
|
+
if (!element)
|
|
812
|
+
return null;
|
|
813
|
+
return await element.boundingBox();
|
|
814
|
+
}, { internal: true });
|
|
815
|
+
if (!box)
|
|
816
|
+
return;
|
|
817
|
+
const cssViewport = await page._wrapApiCall(async () => {
|
|
818
|
+
return await frame.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight }));
|
|
819
|
+
}, { internal: true }).catch(() => null);
|
|
820
|
+
const pngBuffer = await page._wrapApiCall(async () => {
|
|
821
|
+
return await page.screenshot({
|
|
822
|
+
type: "png",
|
|
823
|
+
animations: "disabled",
|
|
824
|
+
timeout: 5e3,
|
|
825
|
+
style: "x-pw-glass { display: none !important; }"
|
|
826
|
+
});
|
|
827
|
+
}, { internal: true });
|
|
828
|
+
const { full, cropped } = (0, import_screenshotCompositor.compositeHighlight)(pngBuffer, box, cssViewport);
|
|
829
|
+
const safeTestId = testInfo.testId.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
830
|
+
const safeStepId = (data.stepId ?? "unknown").replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
831
|
+
const screenshotDir = import_path.default.join(process.cwd(), "_internal_output", "screenshots", safeTestId);
|
|
832
|
+
import_fs.default.mkdirSync(screenshotDir, { recursive: true });
|
|
833
|
+
const fullPng = new import_utilsBundle.PNG({ width: full.width, height: full.height });
|
|
834
|
+
fullPng.data = full.data;
|
|
835
|
+
import_fs.default.writeFileSync(import_path.default.join(screenshotDir, `${safeStepId}-page.png`), import_utilsBundle.PNG.sync.write(fullPng));
|
|
836
|
+
const croppedPng = new import_utilsBundle.PNG({ width: cropped.width, height: cropped.height });
|
|
837
|
+
croppedPng.data = cropped.data;
|
|
838
|
+
import_fs.default.writeFileSync(import_path.default.join(screenshotDir, `${safeStepId}-element.png`), import_utilsBundle.PNG.sync.write(croppedPng));
|
|
839
|
+
const fullJpeg = import_utilsBundle.jpegjs.encode(full, 50);
|
|
840
|
+
const croppedJpeg = import_utilsBundle.jpegjs.encode(cropped, 80);
|
|
841
|
+
testInfo._attach({
|
|
842
|
+
name: "result-screenshot",
|
|
843
|
+
body: Buffer.from(fullJpeg.data),
|
|
844
|
+
contentType: "image/jpeg"
|
|
845
|
+
}, data.stepId);
|
|
846
|
+
testInfo._attach({
|
|
847
|
+
name: "result-screenshot-element",
|
|
848
|
+
body: Buffer.from(croppedJpeg.data),
|
|
849
|
+
contentType: "image/jpeg"
|
|
850
|
+
}, data.stepId);
|
|
851
|
+
} catch {
|
|
852
|
+
} finally {
|
|
853
|
+
_capturingResultScreenshot = false;
|
|
854
|
+
}
|
|
662
855
|
}
|
|
663
856
|
function renderTitle(type, method, params, title) {
|
|
664
857
|
const prefix = (0, import_utils.renderTitleForCall)({ title, type, method, params });
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as playwrightLibrary from 'playwright-core';\nimport { setBoxedStackPrefixes, createGuid, currentZone, debugMode, jsonStringifyForceASCII, asLocatorDescription, renderTitleForCall, getActionGroup } from 'playwright-core/lib/utils';\n\nimport { currentTestInfo } from './common/globals';\nimport { rootTestType } from './common/testType';\nimport { createCustomMessageHandler } from './mcp/test/browserBackend';\n\nimport type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, ScreenshotMode, TestInfo, TestType, VideoMode } from '../types/test';\nimport type { ContextReuseMode } from './common/config';\nimport type { TestInfoImpl, TestStepInternal } from './worker/testInfo';\nimport type { ClientInstrumentationListener } from '../../playwright-core/src/client/clientInstrumentation';\nimport type { Playwright as PlaywrightImpl } from '../../playwright-core/src/client/playwright';\nimport type { Browser as BrowserImpl } from '../../playwright-core/src/client/browser';\nimport type { BrowserContext as BrowserContextImpl } from '../../playwright-core/src/client/browserContext';\nimport type { APIRequestContext as APIRequestContextImpl } from '../../playwright-core/src/client/fetch';\nimport type { ChannelOwner } from '../../playwright-core/src/client/channelOwner';\nimport type { Page as PageImpl } from '../../playwright-core/src/client/page';\nimport type { BrowserContext, BrowserContextOptions, LaunchOptions, Page, Tracing } from 'playwright-core';\n\nexport { expect } from './matchers/expect';\nexport const _baseTest: TestType<{}, {}> = rootTestType.test;\n\nsetBoxedStackPrefixes([path.dirname(require.resolve('../package.json'))]);\n\nif ((process as any)['__pw_initiator__']) {\n const originalStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 200;\n try {\n throw new Error('Requiring @playwright/test second time, \\nFirst:\\n' + (process as any)['__pw_initiator__'] + '\\n\\nSecond: ');\n } finally {\n Error.stackTraceLimit = originalStackTraceLimit;\n }\n} else {\n (process as any)['__pw_initiator__'] = new Error().stack;\n}\n\ntype TestFixtures = PlaywrightTestArgs & PlaywrightTestOptions & {\n _combinedContextOptions: BrowserContextOptions,\n _setupContextOptions: void;\n _setupArtifacts: void;\n _contextFactory: (options?: BrowserContextOptions) => Promise<{ context: BrowserContext, close: () => Promise<void> }>;\n};\n\ntype WorkerFixtures = PlaywrightWorkerArgs & PlaywrightWorkerOptions & {\n playwright: PlaywrightImpl;\n _browserOptions: LaunchOptions;\n _optionContextReuseMode: ContextReuseMode,\n _optionConnectOptions: PlaywrightWorkerOptions['connectOptions'],\n _reuseContext: boolean,\n};\n\nconst playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({\n defaultBrowserType: ['chromium', { scope: 'worker', option: true, box: true }],\n browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: 'worker', option: true, box: true }],\n playwright: [async ({}, use) => {\n await use(require('playwright-core'));\n }, { scope: 'worker', box: true }],\n headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: 'worker', option: true, box: true }],\n channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: 'worker', option: true, box: true }],\n launchOptions: [{}, { scope: 'worker', option: true, box: true }],\n connectOptions: [async ({ _optionConnectOptions }, use) => {\n await use(connectOptionsFromEnv() || _optionConnectOptions);\n }, { scope: 'worker', option: true, box: true }],\n screenshot: ['off', { scope: 'worker', option: true, box: true }],\n video: ['off', { scope: 'worker', option: true, box: true }],\n trace: ['off', { scope: 'worker', option: true, box: true }],\n\n _browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {\n const options: LaunchOptions = {\n handleSIGINT: false,\n ...launchOptions,\n tracesDir: tracing().tracesDir(),\n };\n if (headless !== undefined)\n options.headless = headless;\n if (channel !== undefined)\n options.channel = channel;\n\n playwright._defaultLaunchOptions = options;\n await use(options);\n playwright._defaultLaunchOptions = undefined;\n }, { scope: 'worker', auto: true, box: true }],\n\n browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use) => {\n if (!['chromium', 'firefox', 'webkit'].includes(browserName))\n throw new Error(`Unexpected browserName \"${browserName}\", must be one of \"chromium\", \"firefox\" or \"webkit\"`);\n\n if (connectOptions) {\n const browser = await playwright[browserName].connect({\n ...connectOptions,\n exposeNetwork: connectOptions.exposeNetwork ?? (connectOptions as any)._exposeNetwork,\n headers: {\n // HTTP headers are ASCII only (not UTF-8).\n 'x-playwright-launch-options': jsonStringifyForceASCII(_browserOptions),\n ...connectOptions.headers,\n },\n });\n await use(browser);\n await browser.close({ reason: 'Test ended.' });\n return;\n }\n\n const browser = await playwright[browserName].launch();\n await use(browser);\n await browser.close({ reason: 'Test ended.' });\n }, { scope: 'worker', timeout: 0 }],\n\n acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true, box: true }],\n bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true, box: true }],\n colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === undefined ? 'light' : contextOptions.colorScheme), { option: true, box: true }],\n deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true, box: true }],\n extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true, box: true }],\n geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true, box: true }],\n hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true, box: true }],\n httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true, box: true }],\n ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true, box: true }],\n isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true, box: true }],\n javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true, box: true }],\n locale: [({ contextOptions }, use) => use(contextOptions.locale ?? 'en-US'), { option: true, box: true }],\n offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true, box: true }],\n permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true, box: true }],\n proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true, box: true }],\n storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true, box: true }],\n clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true, box: true }],\n timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true, box: true }],\n userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true, box: true }],\n viewport: [({ contextOptions }, use) => use(contextOptions.viewport === undefined ? null : contextOptions.viewport), { option: true, box: true }],\n actionTimeout: [0, { option: true, box: true }],\n testIdAttribute: ['data-testid', { option: true, box: true }],\n navigationTimeout: [0, { option: true, box: true }],\n baseURL: [async ({ }, use) => {\n await use(process.env.PLAYWRIGHT_TEST_BASE_URL);\n }, { option: true, box: true }],\n serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? 'allow'), { option: true, box: true }],\n contextOptions: [{}, { option: true, box: true }],\n\n _combinedContextOptions: [async ({\n acceptDownloads,\n bypassCSP,\n clientCertificates,\n colorScheme,\n deviceScaleFactor,\n extraHTTPHeaders,\n hasTouch,\n geolocation,\n httpCredentials,\n ignoreHTTPSErrors,\n isMobile,\n javaScriptEnabled,\n locale,\n offline,\n permissions,\n proxy,\n storageState,\n viewport,\n timezoneId,\n userAgent,\n baseURL,\n contextOptions,\n serviceWorkers,\n }, use) => {\n const options: BrowserContextOptions = {};\n if (acceptDownloads !== undefined)\n options.acceptDownloads = acceptDownloads;\n if (bypassCSP !== undefined)\n options.bypassCSP = bypassCSP;\n if (colorScheme !== undefined)\n options.colorScheme = colorScheme;\n if (deviceScaleFactor !== undefined)\n options.deviceScaleFactor = deviceScaleFactor;\n if (extraHTTPHeaders !== undefined)\n options.extraHTTPHeaders = extraHTTPHeaders;\n if (geolocation !== undefined)\n options.geolocation = geolocation;\n if (hasTouch !== undefined)\n options.hasTouch = hasTouch;\n if (httpCredentials !== undefined)\n options.httpCredentials = httpCredentials;\n if (ignoreHTTPSErrors !== undefined)\n options.ignoreHTTPSErrors = ignoreHTTPSErrors;\n if (isMobile !== undefined)\n options.isMobile = isMobile;\n if (javaScriptEnabled !== undefined)\n options.javaScriptEnabled = javaScriptEnabled;\n if (locale !== undefined)\n options.locale = locale;\n if (offline !== undefined)\n options.offline = offline;\n if (permissions !== undefined)\n options.permissions = permissions;\n if (proxy !== undefined)\n options.proxy = proxy;\n if (storageState !== undefined)\n options.storageState = storageState;\n if (clientCertificates?.length)\n options.clientCertificates = resolveClientCerticates(clientCertificates);\n if (timezoneId !== undefined)\n options.timezoneId = timezoneId;\n if (userAgent !== undefined)\n options.userAgent = userAgent;\n if (viewport !== undefined)\n options.viewport = viewport;\n if (baseURL !== undefined)\n options.baseURL = baseURL;\n if (serviceWorkers !== undefined)\n options.serviceWorkers = serviceWorkers;\n await use({\n ...contextOptions,\n ...options,\n });\n }, { box: true }],\n\n _setupContextOptions: [async ({ playwright, _combinedContextOptions, actionTimeout, navigationTimeout, testIdAttribute }, use, testInfo) => {\n if (testIdAttribute)\n playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);\n testInfo.snapshotSuffix = process.platform;\n if (debugMode() === 'inspector')\n (testInfo as TestInfoImpl)._setDebugMode();\n\n playwright._defaultContextOptions = _combinedContextOptions;\n playwright._defaultContextTimeout = actionTimeout || 0;\n playwright._defaultContextNavigationTimeout = navigationTimeout || 0;\n await use();\n playwright._defaultContextOptions = undefined;\n playwright._defaultContextTimeout = undefined;\n playwright._defaultContextNavigationTimeout = undefined;\n }, { auto: 'all-hooks-included', title: 'context configuration', box: true } as any],\n\n _setupArtifacts: [async ({ playwright, screenshot }, use, testInfo) => {\n // This fixture has a separate zero-timeout slot to ensure that artifact collection\n // happens even after some fixtures or hooks time out.\n // Now that default test timeout is known, we can replace zero with an actual value.\n testInfo.setTimeout(testInfo.project.timeout);\n\n const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);\n await artifactsRecorder.willStartTest(testInfo as TestInfoImpl);\n\n const tracingGroupSteps: TestStepInternal[] = [];\n const csiListener: ClientInstrumentationListener = {\n onApiCallBegin: (data, channel) => {\n const testInfo = currentTestInfo();\n // Some special calls do not get into steps.\n if (!testInfo || data.apiName.includes('setTestIdAttribute') || data.apiName === 'tracing.groupEnd')\n return;\n const zone = currentZone().data<TestStepInternal>('stepZone');\n const isExpectCall = data.apiName === 'locator._expect' || data.apiName === 'frame._expect' || data.apiName === 'page._expectScreenshot';\n if (zone && zone.category === 'expect' && isExpectCall) {\n // Display the internal locator._expect call under the name of the enclosing expect call,\n // and connect it to the existing expect step.\n if (zone.apiName)\n data.apiName = zone.apiName;\n if (zone.shortTitle || zone.title)\n data.title = zone.shortTitle ?? zone.title;\n data.stepId = zone.stepId;\n return;\n }\n\n // In the general case, create a step for each api call and connect them through the stepId.\n const step = testInfo._addStep({\n location: data.frames[0],\n category: 'pw:api',\n title: renderTitle(channel.type, channel.method, channel.params, data.title),\n apiName: data.apiName,\n params: channel.params,\n group: getActionGroup({ type: channel.type, method: channel.method }),\n }, tracingGroupSteps[tracingGroupSteps.length - 1]);\n data.userData = step;\n data.stepId = step.stepId;\n if (data.apiName === 'tracing.group')\n tracingGroupSteps.push(step);\n },\n onApiCallEnd: data => {\n\n // \"tracing.group\" step will end later, when \"tracing.groupEnd\" finishes.\n if (data.apiName === 'tracing.group')\n return;\n if (data.apiName === 'tracing.groupEnd') {\n const step = tracingGroupSteps.pop();\n step?.complete({ error: data.error });\n return;\n }\n const step = data.userData;\n step?.complete({ error: data.error });\n },\n onWillPause: ({ keepTestTimeout }) => {\n if (!keepTestTimeout)\n currentTestInfo()?._setDebugMode();\n },\n runAfterCreateBrowserContext: async (context: BrowserContextImpl) => {\n await artifactsRecorder?.didCreateBrowserContext(context);\n const testInfo = currentTestInfo();\n if (testInfo)\n attachConnectedHeaderIfNeeded(testInfo, context.browser());\n },\n runAfterCreateRequestContext: async (context: APIRequestContextImpl) => {\n await artifactsRecorder?.didCreateRequestContext(context);\n },\n runBeforeCloseBrowserContext: async (context: BrowserContextImpl) => {\n await artifactsRecorder?.willCloseBrowserContext(context);\n },\n runBeforeCloseRequestContext: async (context: APIRequestContextImpl) => {\n await artifactsRecorder?.willCloseRequestContext(context);\n },\n };\n\n const clientInstrumentation = playwright._instrumentation;\n clientInstrumentation.addListener(csiListener);\n\n await use();\n\n clientInstrumentation.removeListener(csiListener);\n await artifactsRecorder.didFinishTest();\n }, { auto: 'all-hooks-included', title: 'trace recording', box: true, timeout: 0 } as any],\n\n _contextFactory: [async ({ browser, video, _reuseContext, _combinedContextOptions /** mitigate dep-via-auto lack of traceability */ }, use, testInfo) => {\n const testInfoImpl = testInfo as TestInfoImpl;\n const videoMode = normalizeVideoMode(video);\n const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;\n const contexts = new Map<BrowserContext, { close: () => Promise<void>, pagesWithVideo: Page[] }>();\n let counter = 0;\n\n await use(async options => {\n const hook = testInfoImpl._currentHookType();\n if (hook === 'beforeAll' || hook === 'afterAll') {\n throw new Error([\n `\"context\" and \"page\" fixtures are not supported in \"${hook}\" since they are created on a per-test basis.`,\n `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.`,\n `If you would like to configure your page before each test, do that in beforeEach hook instead.`,\n ].join('\\n'));\n }\n const videoOptions: BrowserContextOptions = captureVideo ? {\n recordVideo: {\n dir: tracing().artifactsDir(),\n size: typeof video === 'string' ? undefined : video.size,\n }\n } : {};\n const context = await browser.newContext({ ...videoOptions, ...options }) as BrowserContextImpl;\n\n if (process.env.PW_CLOCK === 'frozen') {\n await context._wrapApiCall(async () => {\n await context.clock.install({ time: 0 });\n await context.clock.pauseAt(1000);\n }, { internal: true });\n } else if (process.env.PW_CLOCK === 'realtime') {\n await context._wrapApiCall(async () => {\n await context.clock.install({ time: 0 });\n }, { internal: true });\n }\n\n let closed = false;\n const close = async () => {\n if (closed)\n return;\n closed = true;\n const closeReason = testInfo.status === 'timedOut' ? 'Test timeout of ' + testInfo.timeout + 'ms exceeded.' : 'Test ended.';\n await context.close({ reason: closeReason });\n const testFailed = testInfo.status !== testInfo.expectedStatus;\n const preserveVideo = captureVideo && (videoMode === 'on' || (testFailed && videoMode === 'retain-on-failure') || (videoMode === 'on-first-retry' && testInfo.retry === 1));\n if (preserveVideo) {\n const { pagesWithVideo: pagesForVideo } = contexts.get(context)!;\n const videos = pagesForVideo.map(p => p.video()).filter(video => !!video);\n await Promise.all(videos.map(async v => {\n try {\n const savedPath = testInfo.outputPath(`video${counter ? '-' + counter : ''}.webm`);\n ++counter;\n await v.saveAs(savedPath);\n testInfo.attachments.push({ name: 'video', path: savedPath, contentType: 'video/webm' });\n } catch (e) {\n // Silent catch empty videos.\n }\n }));\n }\n };\n\n const contextData = { close, pagesWithVideo: [] as Page[] };\n if (captureVideo)\n context.on('page', page => contextData.pagesWithVideo.push(page));\n contexts.set(context, contextData);\n return { context, close };\n });\n\n await Promise.all([...contexts.values()].map(data => data.close()));\n }, { scope: 'test', title: 'context', box: true }],\n\n _optionContextReuseMode: ['none', { scope: 'worker', option: true, box: true }],\n _optionConnectOptions: [undefined, { scope: 'worker', option: true, box: true }],\n\n _reuseContext: [async ({ video, _optionContextReuseMode }, use) => {\n let mode = _optionContextReuseMode;\n if (process.env.PW_TEST_REUSE_CONTEXT)\n mode = 'when-possible';\n const reuse = mode === 'when-possible' && normalizeVideoMode(video) === 'off';\n await use(reuse);\n }, { scope: 'worker', title: 'context', box: true }],\n\n context: async ({ browser, _reuseContext, _contextFactory }, use, testInfo) => {\n const browserImpl = browser as BrowserImpl;\n attachConnectedHeaderIfNeeded(testInfo, browserImpl);\n if (!_reuseContext) {\n const { context, close } = await _contextFactory();\n (testInfo as TestInfoImpl)._onCustomMessageCallback = createCustomMessageHandler(testInfo, context);\n await use(context);\n await close();\n return;\n }\n\n const context = await browserImpl._wrapApiCall(() => browserImpl._newContextForReuse(), { internal: true });\n (testInfo as TestInfoImpl)._onCustomMessageCallback = createCustomMessageHandler(testInfo, context);\n await use(context);\n const closeReason = testInfo.status === 'timedOut' ? 'Test timeout of ' + testInfo.timeout + 'ms exceeded.' : 'Test ended.';\n await browserImpl._wrapApiCall(() => browserImpl._disconnectFromReusedContext(closeReason), { internal: true });\n },\n\n page: async ({ context, _reuseContext }, use) => {\n if (!_reuseContext) {\n await use(await context.newPage());\n return;\n }\n\n // First time we are reusing the context, we should create the page.\n let [page] = context.pages();\n if (!page)\n page = await context.newPage();\n await use(page);\n },\n\n request: async ({ playwright }, use) => {\n const request = await playwright.request.newContext();\n await use(request);\n const hook = (test.info() as TestInfoImpl)._currentHookType();\n if (hook === 'beforeAll') {\n await request.dispose({ reason: [\n `Fixture { request } from beforeAll cannot be reused in a test.`,\n ` - Recommended fix: use a separate { request } in the test.`,\n ` - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,\n `See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`,\n ].join('\\n') });\n } else {\n await request.dispose();\n }\n },\n});\n\ntype ScreenshotOption = PlaywrightWorkerOptions['screenshot'] | undefined;\n\nfunction normalizeVideoMode(video: VideoMode | 'retry-with-video' | { mode: VideoMode } | undefined): VideoMode {\n if (!video)\n return 'off';\n let videoMode = typeof video === 'string' ? video : video.mode;\n if (videoMode === 'retry-with-video')\n videoMode = 'on-first-retry';\n return videoMode;\n}\n\nfunction shouldCaptureVideo(videoMode: VideoMode, testInfo: TestInfo) {\n return (videoMode === 'on' || videoMode === 'retain-on-failure' || (videoMode === 'on-first-retry' && testInfo.retry === 1));\n}\n\nfunction normalizeScreenshotMode(screenshot: ScreenshotOption): ScreenshotMode {\n if (!screenshot)\n return 'off';\n return typeof screenshot === 'string' ? screenshot : screenshot.mode;\n}\n\nfunction attachConnectedHeaderIfNeeded(testInfo: TestInfo, browser: BrowserImpl | null) {\n const connectHeaders: { name: string, value: string }[] | undefined = browser?._connection.headers;\n if (!connectHeaders)\n return;\n for (const header of connectHeaders) {\n if (header.name !== 'x-playwright-attachment')\n continue;\n const [name, value] = header.value.split('=');\n if (!name || !value)\n continue;\n if (testInfo.attachments.some(attachment => attachment.name === name))\n continue;\n testInfo.attachments.push({ name, contentType: 'text/plain', body: Buffer.from(value) });\n }\n}\n\nfunction resolveFileToConfig(file: string | undefined) {\n const config = test.info().config.configFile;\n if (!config || !file)\n return file;\n if (path.isAbsolute(file))\n return file;\n return path.resolve(path.dirname(config), file);\n}\n\ntype ClientCertificates = NonNullable<PlaywrightTestOptions['clientCertificates']>;\n\nfunction resolveClientCerticates(clientCertificates: ClientCertificates): ClientCertificates {\n for (const cert of clientCertificates) {\n cert.certPath = resolveFileToConfig(cert.certPath);\n cert.keyPath = resolveFileToConfig(cert.keyPath);\n cert.pfxPath = resolveFileToConfig(cert.pfxPath);\n }\n return clientCertificates;\n}\n\nconst kTracingStarted = Symbol('kTracingStarted');\n\nfunction connectOptionsFromEnv() {\n const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;\n if (!wsEndpoint)\n return undefined;\n const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : undefined;\n return {\n wsEndpoint,\n headers,\n exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK,\n };\n}\n\ntype SnapshotRecorderMode = 'on' | 'off' | 'only-on-failure' | 'on-first-failure';\n\nclass SnapshotRecorder {\n private _ordinal = 0;\n private _temporary: string[] = [];\n\n constructor(\n private _artifactsRecorder: ArtifactsRecorder,\n private _mode: SnapshotRecorderMode,\n private _name: string,\n private _contentType: string,\n private _extension: string,\n private _doSnapshot: (page: PageImpl, path: string) => Promise<void>,\n private _doAdditionalSnapshot?: (page: PageImpl, path: string, testInfo: TestInfoImpl) => Promise<void>) {\n }\n\n fixOrdinal() {\n // Since beforeAll(s), test and afterAll(s) reuse the same TestInfo, make sure we do not\n // overwrite previous screenshots.\n this._ordinal = this.testInfo.attachments.filter(a => a.name === this._name).length;\n }\n\n private shouldCaptureUponFinish() {\n return this._mode === 'on' ||\n (this._mode === 'only-on-failure' && this.testInfo._isFailure()) ||\n (this._mode === 'on-first-failure' && this.testInfo._isFailure() && this.testInfo.retry === 0);\n }\n\n async maybeCapture() {\n if (!this.shouldCaptureUponFinish())\n return;\n\n await Promise.all(this._artifactsRecorder._playwright._allPages().map(page => this._snapshotPage(page, false)));\n }\n\n async persistTemporary() {\n if (this.shouldCaptureUponFinish()) {\n await Promise.all(this._temporary.map(async file => {\n try {\n const path = this._createAttachmentPath();\n await fs.promises.rename(file, path);\n this._attach(path);\n } catch {\n }\n }));\n }\n }\n\n async captureTemporary(context: BrowserContextImpl) {\n if (this._mode === 'on' || this._mode === 'only-on-failure' || (this._mode === 'on-first-failure' && this.testInfo.retry === 0))\n await Promise.all(context.pages().map(page => this._snapshotPage(page, true)));\n }\n\n private _attach(screenshotPath: string) {\n this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });\n }\n\n private _createAttachmentPath() {\n const testFailed = this.testInfo._isFailure();\n const index = this._ordinal + 1;\n ++this._ordinal;\n const path = this.testInfo.outputPath(`test-${testFailed ? 'failed' : 'finished'}-${index}${this._extension}`);\n return path;\n }\n\n private _createTemporaryArtifact(...name: string[]) {\n const file = path.join(this._artifactsRecorder._artifactsDir, ...name);\n return file;\n }\n\n private async _snapshotPage(page: PageImpl, temporary: boolean) {\n // Make sure we do not snapshot the same page twice for a single TestInfo,\n // which is reused between beforeAll(s), test and afterAll(s).\n if ((page as any)[this.testInfo._uniqueSymbol])\n return;\n (page as any)[this.testInfo._uniqueSymbol] = true;\n try {\n const path = temporary ? this._createTemporaryArtifact(createGuid() + this._extension) : this._createAttachmentPath();\n await this._doSnapshot(page, path);\n if (temporary)\n this._temporary.push(path);\n else\n this._attach(path);\n\n // Capture additional screenshots if callback is provided\n if (this._doAdditionalSnapshot) {\n try {\n await this._doAdditionalSnapshot(page, path, this.testInfo);\n // Attach the additional screenshots if they were created (on failure only)\n if (!temporary && this.testInfo._isFailure()) {\n const highlightedPath = path.replace(this._extension, `-highlighted${this._extension}`);\n const elementPath = path.replace(this._extension, `-element${this._extension}`);\n\n // Check if files exist before attaching\n const fs = require('fs');\n if (fs.existsSync(highlightedPath))\n this._attach(highlightedPath);\n if (fs.existsSync(elementPath))\n this._attach(elementPath);\n }\n } catch {\n // Additional snapshot may fail, just ignore.\n }\n }\n } catch {\n // snapshot may fail, just ignore.\n }\n }\n\n private get testInfo(): TestInfoImpl {\n return this._artifactsRecorder._testInfo;\n }\n}\n\nclass ArtifactsRecorder {\n _testInfo!: TestInfoImpl;\n _playwright: PlaywrightImpl;\n _artifactsDir: string;\n private _startedCollectingArtifacts: symbol;\n\n private _screenshotRecorder: SnapshotRecorder;\n private _pageSnapshot: string | undefined;\n\n constructor(playwright: PlaywrightImpl, artifactsDir: string, screenshot: ScreenshotOption) {\n this._playwright = playwright;\n this._artifactsDir = artifactsDir;\n const screenshotOptions = typeof screenshot === 'string' ? undefined : screenshot;\n this._startedCollectingArtifacts = Symbol('startedCollectingArtifacts');\n\n this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), 'screenshot', 'image/png', '.png', async (page, path) => {\n await page._wrapApiCall(async () => {\n await page.screenshot({ ...screenshotOptions, timeout: 5000, path, caret: 'initial' });\n }, { internal: true });\n }, async (page, path, testInfo) => {\n // Additional screenshots on failure only\n if (!testInfo._isFailure())\n return;\n\n // 1. Full page screenshot with all interactive elements highlighted\n await page._wrapApiCall(async () => {\n await page.screenshot({\n ...screenshotOptions,\n timeout: 5000,\n path: path.replace('.png', '-highlighted.png'),\n caret: 'initial',\n style: `\n a, button, input, select, textarea, [role=\"button\"], [role=\"link\"],\n [onclick], [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"] {\n outline: 2px solid #ff0000 !important;\n outline-offset: 2px !important;\n box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3) !important;\n }\n `\n });\n }, { internal: true });\n\n // 2. Try to extract selector from error and capture element screenshot\n const error = testInfo.errors[0];\n if (error) {\n const selector = this._extractSelectorFromError(error);\n if (selector) {\n try {\n await page._wrapApiCall(async () => {\n const locator = page.locator(selector);\n const elementHandle = await locator.elementHandle({ timeout: 2000 });\n if (elementHandle) {\n const buffer = await elementHandle.screenshot({ timeout: 5000, type: 'png' });\n await require('fs').promises.writeFile(path.replace('.png', '-element.png'), buffer);\n }\n }, { internal: true });\n } catch {\n // Element screenshot may fail if element doesn't exist\n }\n }\n }\n });\n }\n\n async willStartTest(testInfo: TestInfoImpl) {\n this._testInfo = testInfo;\n testInfo._onDidFinishTestFunctionCallback = () => this.didFinishTestFunction();\n\n this._screenshotRecorder.fixOrdinal();\n\n // Process existing contexts.\n await Promise.all(this._playwright._allContexts().map(context => this.didCreateBrowserContext(context)));\n const existingApiRequests = Array.from(this._playwright.request._contexts);\n await Promise.all(existingApiRequests.map(c => this.didCreateRequestContext(c)));\n }\n\n async didCreateBrowserContext(context: BrowserContextImpl) {\n await this._startTraceChunkOnContextCreation(context, context.tracing);\n }\n\n async willCloseBrowserContext(context: BrowserContextImpl) {\n await this._stopTracing(context, context.tracing);\n await this._screenshotRecorder.captureTemporary(context);\n await this._takePageSnapshot(context);\n }\n\n private async _takePageSnapshot(context: BrowserContextImpl) {\n if (process.env.PLAYWRIGHT_NO_COPY_PROMPT)\n return;\n if (this._testInfo.errors.length === 0)\n return;\n if (this._pageSnapshot)\n return;\n const page = context.pages()[0];\n if (!page)\n return;\n\n try {\n // TODO: maybe capture snapshot when the error is created, so it's from the right page and right time\n await page._wrapApiCall(async () => {\n this._pageSnapshot = (await page._snapshotForAI({ timeout: 5000 })).full;\n }, { internal: true });\n } catch {}\n }\n\n async didCreateRequestContext(context: APIRequestContextImpl) {\n await this._startTraceChunkOnContextCreation(context, context._tracing);\n }\n\n async willCloseRequestContext(context: APIRequestContextImpl) {\n await this._stopTracing(context, context._tracing);\n }\n\n async didFinishTestFunction() {\n await this._screenshotRecorder.maybeCapture();\n }\n\n async didFinishTest() {\n await this.didFinishTestFunction();\n\n const leftoverContexts = this._playwright._allContexts();\n const leftoverApiRequests = Array.from(this._playwright.request._contexts);\n\n // Collect traces/screenshots for remaining contexts.\n await Promise.all(leftoverContexts.map(async context => {\n await this._stopTracing(context, context.tracing);\n }).concat(leftoverApiRequests.map(async context => {\n await this._stopTracing(context, context._tracing);\n })));\n\n await this._screenshotRecorder.persistTemporary();\n\n const context = leftoverContexts[0];\n if (context)\n await this._takePageSnapshot(context);\n\n if (this._pageSnapshot && this._testInfo.errors.length > 0 && !this._testInfo.attachments.some(a => a.name === 'error-context')) {\n const lines = [\n '# Page snapshot',\n '',\n '```yaml',\n this._pageSnapshot,\n '```',\n ];\n const filePath = this._testInfo.outputPath('error-context.md');\n await fs.promises.writeFile(filePath, lines.join('\\n'), 'utf8');\n\n this._testInfo._attach({\n name: 'error-context',\n contentType: 'text/markdown',\n path: filePath,\n }, undefined);\n }\n }\n\n private async _startTraceChunkOnContextCreation(channelOwner: ChannelOwner, tracing: Tracing) {\n await channelOwner._wrapApiCall(async () => {\n const options = this._testInfo._tracing.traceOptions();\n if (options) {\n const title = this._testInfo._tracing.traceTitle();\n const name = this._testInfo._tracing.generateNextTraceRecordingName();\n if (!(tracing as any)[kTracingStarted]) {\n await tracing.start({ ...options, title, name });\n (tracing as any)[kTracingStarted] = true;\n } else {\n await tracing.startChunk({ title, name });\n }\n } else {\n if ((tracing as any)[kTracingStarted]) {\n (tracing as any)[kTracingStarted] = false;\n await tracing.stop();\n }\n }\n }, { internal: true });\n }\n\n private async _stopTracing(channelOwner: ChannelOwner, tracing: Tracing) {\n await channelOwner._wrapApiCall(async () => {\n if ((tracing as any)[this._startedCollectingArtifacts])\n return;\n (tracing as any)[this._startedCollectingArtifacts] = true;\n if (this._testInfo._tracing.traceOptions() && (tracing as any)[kTracingStarted])\n await tracing.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });\n }, { internal: true });\n }\n\n private _extractSelectorFromError(error: any): string | null {\n if (!error || !error.message)\n return null;\n\n const message = error.message;\n\n // Try to extract selector from common Playwright error patterns\n // Pattern 1: \"locator.click: Timeout 30000ms exceeded.\" with selector in context\n // Pattern 2: \"page.click(selector)\"\n // Pattern 3: Error message may contain \"selector resolved to...\" or \"waiting for...\"\n\n // Look for patterns like: waiting for locator('button')\n const locatorMatch = message.match(/locator\\(['\"]([^'\"]+)['\"]\\)/);\n if (locatorMatch)\n return locatorMatch[1];\n\n // Look for patterns like: getByRole('button')\n const getByRoleMatch = message.match(/getByRole\\(['\"]([^'\"]+)['\"]\\)/);\n if (getByRoleMatch)\n return `[role=\"${getByRoleMatch[1]}\"]`;\n\n // Look for patterns like: getByText('...')\n const getByTextMatch = message.match(/getByText\\(['\"]([^'\"]+)['\"]\\)/);\n if (getByTextMatch)\n return `text=${getByTextMatch[1]}`;\n\n // Look for direct selector strings in quotes (last resort)\n const quotedMatch = message.match(/['\"]([#.[\\w\\-=\\]]+)['\"]/);\n if (quotedMatch && (quotedMatch[1].startsWith('#') || quotedMatch[1].startsWith('.') || quotedMatch[1].startsWith('[')))\n return quotedMatch[1];\n\n return null;\n }\n}\n\nfunction renderTitle(type: string, method: string, params: Record<string, string> | undefined, title?: string) {\n const prefix = renderTitleForCall({ title, type, method, params });\n let selector;\n if (params?.['selector'] && typeof params.selector === 'string')\n selector = asLocatorDescription('javascript', params.selector);\n return prefix + (selector ? ` ${selector}` : '');\n}\n\nfunction tracing() {\n return (test.info() as TestInfoImpl)._tracing;\n}\n\nexport const test = _baseTest.extend<TestFixtures, WorkerFixtures>(playwrightFixtures);\n\nexport { defineConfig } from './common/configLoader';\nexport { mergeTests } from './common/testType';\nexport { mergeExpects } from './matchers/expect';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AAEjB,wBAAmC;AACnC,mBAA6J;AAE7J,qBAAgC;AAChC,sBAA6B;AAC7B,4BAA2C;AAc3C,oBAAuB;AA40BvB,0BAA6B;AAC7B,IAAAA,mBAA2B;AAC3B,IAAAC,iBAA6B;AA70BtB,MAAM,YAA8B,6BAAa;AAAA,IAExD,oCAAsB,CAAC,YAAAC,QAAK,QAAQ,gBAAgB,iBAAiB,CAAC,CAAC,CAAC;AAExE,IAAK,QAAgB,kBAAkB,GAAG;AACxC,QAAM,0BAA0B,MAAM;AACtC,QAAM,kBAAkB;AACxB,MAAI;AACF,UAAM,IAAI,MAAM,uDAAwD,QAAgB,kBAAkB,IAAI,cAAc;AAAA,EAC9H,UAAE;AACA,UAAM,kBAAkB;AAAA,EAC1B;AACF,OAAO;AACL,EAAC,QAAgB,kBAAkB,IAAI,IAAI,MAAM,EAAE;AACrD;AAiBA,MAAM,qBAA8D;AAAA,EAClE,oB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CAAC,CAAC;AAGlC,UAAM,cAAc,QAAQ,MAAM,yBAAyB;AAC3D,QAAI,gBAAgB,YAAY,CAAC,EAAE,WAAW,GAAG,KAAK,YAAY,CAAC,EAAE,WAAW,GAAG,KAAK,YAAY,CAAC,EAAE,WAAW,GAAG;AACnH,aAAO,YAAY,CAAC;AAEtB,WAAO;AAAA,EACT;AACF;AAEA,SAAS,YAAY,MAAc,QAAgB,QAA4C,OAAgB;AAC7G,QAAM,aAAS,iCAAmB,EAAE,OAAO,MAAM,QAAQ,OAAO,CAAC;AACjE,MAAI;AACJ,MAAI,SAAS,UAAU,KAAK,OAAO,OAAO,aAAa;AACrD,mBAAW,mCAAqB,cAAc,OAAO,QAAQ;AAC/D,SAAO,UAAU,WAAW,IAAI,QAAQ,KAAK;AAC/C;AAEA,SAAS,UAAU;AACjB,SAAQ,KAAK,KAAK,EAAmB;AACvC;AAEO,MAAM,OAAO,UAAU,OAAqC,kBAAkB;",
|
|
6
|
+
"names": ["import_testType", "import_expect", "path", "browser", "testInfo", "step", "video", "context", "fs", "tracing"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/internalsForTest.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { fileDependenciesForTest } from './transform/compilationCache';\n\nexport function fileDependencies() {\n return Object.fromEntries([...fileDependenciesForTest().entries()].map(entry => (\n [path.basename(entry[0]), [...entry[1]].map(f => path.basename(f)).sort()]\n )));\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,8BAAwC;AAEjC,SAAS,mBAAmB;AACjC,SAAO,OAAO,YAAY,CAAC,OAAG,iDAAwB,EAAE,QAAQ,CAAC,EAAE,IAAI,WACrE,CAAC,YAAAA,QAAK,SAAS,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,OAAK,YAAAA,QAAK,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAC1E,CAAC;AACJ;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/isomorphic/events.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport namespace Disposable {\n export function disposeAll(disposables: Disposable[]): void {\n for (const disposable of disposables.splice(0))\n disposable.dispose();\n }\n}\n\nexport type Disposable = {\n dispose(): void;\n};\n\nexport interface Event<T> {\n (listener: (e: T) => any, disposables?: Disposable[]): Disposable;\n}\n\nexport class EventEmitter<T> {\n public event: Event<T>;\n\n private _deliveryQueue?: {listener: (e: T) => void, event: T}[];\n private _listeners = new Set<(e: T) => void>();\n\n constructor() {\n this.event = (listener: (e: T) => any, disposables?: Disposable[]) => {\n this._listeners.add(listener);\n let disposed = false;\n const self = this;\n const result: Disposable = {\n dispose() {\n if (!disposed) {\n disposed = true;\n self._listeners.delete(listener);\n }\n }\n };\n if (disposables)\n disposables.push(result);\n return result;\n };\n }\n\n fire(event: T): void {\n const dispatch = !this._deliveryQueue;\n if (!this._deliveryQueue)\n this._deliveryQueue = [];\n for (const listener of this._listeners)\n this._deliveryQueue.push({ listener, event });\n if (!dispatch)\n return;\n for (let index = 0; index < this._deliveryQueue.length; index++) {\n const { listener, event } = this._deliveryQueue[index];\n listener.call(null, event);\n }\n this._deliveryQueue = undefined;\n }\n\n dispose() {\n this._listeners.clear();\n if (this._deliveryQueue)\n this._deliveryQueue = [];\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAU;AAAA,CAAV,CAAUA,gBAAV;AACE,WAAS,WAAW,aAAiC;AAC1D,eAAW,cAAc,YAAY,OAAO,CAAC;AAC3C,iBAAW,QAAQ;AAAA,EACvB;AAHO,EAAAA,YAAS;AAAA,GADD;AAeV,MAAM,aAAgB;AAAA,EAM3B,cAAc;AAFd,SAAQ,aAAa,oBAAI,IAAoB;AAG3C,SAAK,QAAQ,CAAC,UAAyB,gBAA+B;AACpE,WAAK,WAAW,IAAI,QAAQ;AAC5B,UAAI,WAAW;AACf,YAAM,OAAO;AACb,YAAM,SAAqB;AAAA,QACzB,UAAU;AACR,cAAI,CAAC,UAAU;AACb,uBAAW;AACX,iBAAK,WAAW,OAAO,QAAQ;AAAA,UACjC;AAAA,QACF;AAAA,MACF;AACA,UAAI;AACF,oBAAY,KAAK,MAAM;AACzB,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,KAAK,OAAgB;AACnB,UAAM,WAAW,CAAC,KAAK;AACvB,QAAI,CAAC,KAAK;AACR,WAAK,iBAAiB,CAAC;AACzB,eAAW,YAAY,KAAK;AAC1B,WAAK,eAAe,KAAK,EAAE,UAAU,MAAM,CAAC;AAC9C,QAAI,CAAC;AACH;AACF,aAAS,QAAQ,GAAG,QAAQ,KAAK,eAAe,QAAQ,SAAS;AAC/D,YAAM,EAAE,UAAU,OAAAC,OAAM,IAAI,KAAK,eAAe,KAAK;AACrD,eAAS,KAAK,MAAMA,MAAK;AAAA,IAC3B;AACA,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,UAAU;AACR,SAAK,WAAW,MAAM;AACtB,QAAI,KAAK;AACP,WAAK,iBAAiB,CAAC;AAAA,EAC3B;AACF;",
|
|
6
|
+
"names": ["Disposable", "event"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/isomorphic/folders.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function artifactsFolderName(workerIndex: number) {\n return `.playwright-artifacts-${workerIndex}`;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,SAAS,oBAAoB,aAAqB;AACvD,SAAO,yBAAyB,WAAW;AAC7C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/isomorphic/stringInternPool.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class StringInternPool {\n private _stringCache = new Map<string, string>();\n\n public internString(s: string): string {\n let result = this._stringCache.get(s);\n if (!result) {\n this._stringCache.set(s, s);\n result = s;\n }\n return result;\n }\n}\n\nexport class JsonStringInternalizer {\n private readonly _pool;\n\n constructor(pool: StringInternPool) {\n this._pool = pool;\n }\n\n traverse(value: any) {\n if (typeof value !== 'object')\n return;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n if (typeof value[i] === 'string')\n value[i] = this.intern(value[i]);\n else\n this.traverse(value[i]);\n }\n } else {\n for (const name in value) {\n if (typeof value[name] === 'string')\n value[name] = this.intern(value[name]);\n else\n this.traverse(value[name]);\n }\n }\n }\n\n private intern(value: string): string {\n return this._pool.internString(value);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,MAAM,iBAAiB;AAAA,EAAvB;AACL,SAAQ,eAAe,oBAAI,IAAoB;AAAA;AAAA,EAExC,aAAa,GAAmB;AACrC,QAAI,SAAS,KAAK,aAAa,IAAI,CAAC;AACpC,QAAI,CAAC,QAAQ;AACX,WAAK,aAAa,IAAI,GAAG,CAAC;AAC1B,eAAS;AAAA,IACX;AACA,WAAO;AAAA,EACT;AACF;AAEO,MAAM,uBAAuB;AAAA,EAGlC,YAAY,MAAwB;AAClC,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,SAAS,OAAY;AACnB,QAAI,OAAO,UAAU;AACnB;AACF,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,YAAI,OAAO,MAAM,CAAC,MAAM;AACtB,gBAAM,CAAC,IAAI,KAAK,OAAO,MAAM,CAAC,CAAC;AAAA;AAE/B,eAAK,SAAS,MAAM,CAAC,CAAC;AAAA,MAC1B;AAAA,IACF,OAAO;AACL,iBAAW,QAAQ,OAAO;AACxB,YAAI,OAAO,MAAM,IAAI,MAAM;AACzB,gBAAM,IAAI,IAAI,KAAK,OAAO,MAAM,IAAI,CAAC;AAAA;AAErC,eAAK,SAAS,MAAM,IAAI,CAAC;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AAAA,EAEQ,OAAO,OAAuB;AACpC,WAAO,KAAK,MAAM,aAAa,KAAK;AAAA,EACtC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -58,6 +58,10 @@ class TeleReporterReceiver {
|
|
|
58
58
|
this._onTestBegin(params.testId, params.result);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
+
if (method === "onTestPaused") {
|
|
62
|
+
this._onTestPaused(params.testId, params.resultId, params.errors);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
61
65
|
if (method === "onTestEnd") {
|
|
62
66
|
this._onTestEnd(params.test, params.result);
|
|
63
67
|
return;
|
|
@@ -116,6 +120,13 @@ class TeleReporterReceiver {
|
|
|
116
120
|
testResult.setStartTimeNumber(payload.startTime);
|
|
117
121
|
this._reporter.onTestBegin?.(test, testResult);
|
|
118
122
|
}
|
|
123
|
+
_onTestPaused(testId, resultId, errors) {
|
|
124
|
+
const test = this._tests.get(testId);
|
|
125
|
+
const result = test.results.find((r) => r._id === resultId);
|
|
126
|
+
result.errors.push(...errors);
|
|
127
|
+
result.error = result.errors[0];
|
|
128
|
+
void this._reporter.onTestPaused?.(test, result);
|
|
129
|
+
}
|
|
119
130
|
_onTestEnd(testEndPayload, payload) {
|
|
120
131
|
const test = this._tests.get(testEndPayload.testId);
|
|
121
132
|
test.timeout = testEndPayload.timeout;
|
|
@@ -123,8 +134,8 @@ class TeleReporterReceiver {
|
|
|
123
134
|
const result = test.results.find((r) => r._id === payload.id);
|
|
124
135
|
result.duration = payload.duration;
|
|
125
136
|
result.status = payload.status;
|
|
126
|
-
result.errors
|
|
127
|
-
result.error = result.errors
|
|
137
|
+
result.errors.push(...payload.errors ?? []);
|
|
138
|
+
result.error = result.errors[0];
|
|
128
139
|
if (!!payload.attachments)
|
|
129
140
|
result.attachments = this._parseAttachments(payload.attachments);
|
|
130
141
|
if (payload.annotations) {
|
|
@@ -448,6 +459,8 @@ const baseFullConfig = {
|
|
|
448
459
|
tags: [],
|
|
449
460
|
updateSnapshots: "missing",
|
|
450
461
|
updateSourceMethod: "patch",
|
|
462
|
+
// @ts-expect-error runAgents is hidden
|
|
463
|
+
runAgents: "none",
|
|
451
464
|
version: "",
|
|
452
465
|
workers: 0,
|
|
453
466
|
webServer: null
|