@stablyai/internal-playwright 0.1.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 +6277 -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/agents/generateAgents.js +265 -0
- package/lib/agents/generator.md +102 -0
- package/lib/agents/healer.md +78 -0
- package/lib/agents/planner.md +135 -0
- package/lib/cli.js +274 -0
- package/lib/common/config.js +274 -0
- package/lib/common/config.js.map +7 -0
- package/lib/common/configLoader.js +377 -0
- package/lib/common/configLoader.js.map +7 -0
- package/lib/common/esmLoaderHost.js +102 -0
- package/lib/common/esmLoaderHost.js.map +7 -0
- package/lib/common/expectBundle.js +52 -0
- package/lib/common/expectBundle.js.map +7 -0
- package/lib/common/expectBundleImpl.js +389 -0
- package/lib/common/expectBundleImpl.js.map +7 -0
- package/lib/common/fixtures.js +302 -0
- package/lib/common/fixtures.js.map +7 -0
- package/lib/common/globals.js +58 -0
- package/lib/common/globals.js.map +7 -0
- package/lib/common/ipc.js +60 -0
- package/lib/common/ipc.js.map +7 -0
- package/lib/common/poolBuilder.js +85 -0
- package/lib/common/poolBuilder.js.map +7 -0
- package/lib/common/process.js +104 -0
- package/lib/common/process.js.map +7 -0
- package/lib/common/suiteUtils.js +140 -0
- package/lib/common/suiteUtils.js.map +7 -0
- package/lib/common/test.js +321 -0
- package/lib/common/test.js.map +7 -0
- package/lib/common/testLoader.js +100 -0
- package/lib/common/testLoader.js.map +7 -0
- package/lib/common/testType.js +310 -0
- package/lib/common/testType.js.map +7 -0
- package/lib/fsWatcher.js +67 -0
- package/lib/fsWatcher.js.map +7 -0
- package/lib/index.js +696 -0
- package/lib/index.js.map +7 -0
- package/lib/internalsForTest.js +42 -0
- package/lib/internalsForTest.js.map +7 -0
- package/lib/isomorphic/events.js +77 -0
- package/lib/isomorphic/events.js.map +7 -0
- package/lib/isomorphic/folders.js +30 -0
- package/lib/isomorphic/folders.js.map +7 -0
- package/lib/isomorphic/stringInternPool.js +69 -0
- package/lib/isomorphic/stringInternPool.js.map +7 -0
- package/lib/isomorphic/teleReceiver.js +507 -0
- package/lib/isomorphic/teleReceiver.js.map +7 -0
- package/lib/isomorphic/teleSuiteUpdater.js +137 -0
- package/lib/isomorphic/teleSuiteUpdater.js.map +7 -0
- package/lib/isomorphic/testServerConnection.js +211 -0
- package/lib/isomorphic/testServerConnection.js.map +7 -0
- package/lib/isomorphic/testServerInterface.js +16 -0
- package/lib/isomorphic/testServerInterface.js.map +7 -0
- package/lib/isomorphic/testTree.js +334 -0
- package/lib/isomorphic/testTree.js.map +7 -0
- package/lib/isomorphic/types.d.js +16 -0
- package/lib/isomorphic/types.d.js.map +7 -0
- package/lib/loader/loaderMain.js +59 -0
- package/lib/loader/loaderMain.js.map +7 -0
- package/lib/matchers/expect.js +325 -0
- package/lib/matchers/expect.js.map +7 -0
- package/lib/matchers/matcherHint.js +87 -0
- package/lib/matchers/matcherHint.js.map +7 -0
- package/lib/matchers/matchers.js +366 -0
- package/lib/matchers/matchers.js.map +7 -0
- package/lib/matchers/toBeTruthy.js +73 -0
- package/lib/matchers/toBeTruthy.js.map +7 -0
- package/lib/matchers/toEqual.js +99 -0
- package/lib/matchers/toEqual.js.map +7 -0
- package/lib/matchers/toHaveURL.js +102 -0
- package/lib/matchers/toHaveURL.js.map +7 -0
- package/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/lib/matchers/toMatchAriaSnapshot.js.map +7 -0
- package/lib/matchers/toMatchSnapshot.js +359 -0
- package/lib/matchers/toMatchSnapshot.js.map +7 -0
- package/lib/matchers/toMatchText.js +99 -0
- package/lib/matchers/toMatchText.js.map +7 -0
- package/lib/mcp/browser/actions.d.js +16 -0
- package/lib/mcp/browser/backend.js +93 -0
- package/lib/mcp/browser/backend.js.map +7 -0
- package/lib/mcp/browser/browserContextFactory.js +296 -0
- package/lib/mcp/browser/browserServerBackend.js +76 -0
- package/lib/mcp/browser/codegen.js +66 -0
- package/lib/mcp/browser/config.js +385 -0
- package/lib/mcp/browser/context.js +287 -0
- package/lib/mcp/browser/response.js +228 -0
- package/lib/mcp/browser/sessionLog.js +160 -0
- package/lib/mcp/browser/tab.js +277 -0
- package/lib/mcp/browser/tool.js +30 -0
- package/lib/mcp/browser/tool.js.map +7 -0
- package/lib/mcp/browser/tools/common.js +63 -0
- package/lib/mcp/browser/tools/console.js +44 -0
- package/lib/mcp/browser/tools/dialogs.js +60 -0
- package/lib/mcp/browser/tools/evaluate.js +70 -0
- package/lib/mcp/browser/tools/files.js +58 -0
- package/lib/mcp/browser/tools/form.js +74 -0
- package/lib/mcp/browser/tools/install.js +69 -0
- package/lib/mcp/browser/tools/keyboard.js +85 -0
- package/lib/mcp/browser/tools/mouse.js +107 -0
- package/lib/mcp/browser/tools/navigate.js +62 -0
- package/lib/mcp/browser/tools/network.js +54 -0
- package/lib/mcp/browser/tools/pdf.js +59 -0
- package/lib/mcp/browser/tools/screenshot.js +88 -0
- package/lib/mcp/browser/tools/snapshot.js +182 -0
- package/lib/mcp/browser/tools/tabs.js +67 -0
- package/lib/mcp/browser/tools/tool.js +49 -0
- package/lib/mcp/browser/tools/tracing.js +74 -0
- package/lib/mcp/browser/tools/utils.js +100 -0
- package/lib/mcp/browser/tools/verify.js +154 -0
- package/lib/mcp/browser/tools/wait.js +63 -0
- package/lib/mcp/browser/tools.js +80 -0
- package/lib/mcp/browser/tools.js.map +7 -0
- package/lib/mcp/browser/watchdog.js +44 -0
- package/lib/mcp/config.d.js +16 -0
- package/lib/mcp/extension/cdpRelay.js +351 -0
- package/lib/mcp/extension/extensionContextFactory.js +75 -0
- package/lib/mcp/extension/protocol.js +28 -0
- package/lib/mcp/index.js +61 -0
- package/lib/mcp/log.js +35 -0
- package/lib/mcp/program.js +96 -0
- package/lib/mcp/sdk/bundle.js +81 -0
- package/lib/mcp/sdk/bundle.js.map +7 -0
- package/lib/mcp/sdk/call.js +49 -0
- package/lib/mcp/sdk/call.js.map +7 -0
- package/lib/mcp/sdk/exports.js +32 -0
- package/lib/mcp/sdk/exports.js.map +7 -0
- package/lib/mcp/sdk/http.js +187 -0
- package/lib/mcp/sdk/http.js.map +7 -0
- package/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
- package/lib/mcp/sdk/mdb.js +206 -0
- package/lib/mcp/sdk/mdb.js.map +7 -0
- package/lib/mcp/sdk/proxyBackend.js +128 -0
- package/lib/mcp/sdk/proxyBackend.js.map +7 -0
- package/lib/mcp/sdk/server.js +189 -0
- package/lib/mcp/sdk/server.js.map +7 -0
- package/lib/mcp/sdk/tool.js +51 -0
- package/lib/mcp/sdk/tool.js.map +7 -0
- package/lib/mcp/test/backend.js +67 -0
- package/lib/mcp/test/backend.js.map +7 -0
- package/lib/mcp/test/browserBackend.js +98 -0
- package/lib/mcp/test/context.js +48 -0
- package/lib/mcp/test/context.js.map +7 -0
- package/lib/mcp/test/generatorTools.js +122 -0
- package/lib/mcp/test/plannerTools.js +46 -0
- package/lib/mcp/test/seed.js +72 -0
- package/lib/mcp/test/streams.js +39 -0
- package/lib/mcp/test/streams.js.map +7 -0
- package/lib/mcp/test/testBackend.js +97 -0
- package/lib/mcp/test/testContext.js +176 -0
- package/lib/mcp/test/testTool.js +30 -0
- package/lib/mcp/test/testTools.js +115 -0
- package/lib/mcp/test/tool.js +30 -0
- package/lib/mcp/test/tool.js.map +7 -0
- package/lib/mcp/test/tools.js +150 -0
- package/lib/mcp/test/tools.js.map +7 -0
- package/lib/mcp/vscode/host.js +187 -0
- package/lib/mcp/vscode/main.js +77 -0
- package/lib/mcpBundleImpl.js +41 -0
- package/lib/mcpBundleImpl.js.map +7 -0
- package/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/lib/plugins/gitCommitInfoPlugin.js.map +7 -0
- package/lib/plugins/index.js +28 -0
- package/lib/plugins/index.js.map +7 -0
- package/lib/plugins/webServerPlugin.js +209 -0
- package/lib/plugins/webServerPlugin.js.map +7 -0
- package/lib/program.js +412 -0
- package/lib/program.js.map +7 -0
- package/lib/reporters/base.js +609 -0
- package/lib/reporters/base.js.map +7 -0
- package/lib/reporters/blob.js +135 -0
- package/lib/reporters/blob.js.map +7 -0
- package/lib/reporters/dot.js +82 -0
- package/lib/reporters/dot.js.map +7 -0
- package/lib/reporters/empty.js +32 -0
- package/lib/reporters/empty.js.map +7 -0
- package/lib/reporters/github.js +128 -0
- package/lib/reporters/github.js.map +7 -0
- package/lib/reporters/html.js +644 -0
- package/lib/reporters/html.js.map +7 -0
- package/lib/reporters/internalReporter.js +130 -0
- package/lib/reporters/internalReporter.js.map +7 -0
- package/lib/reporters/json.js +254 -0
- package/lib/reporters/json.js.map +7 -0
- package/lib/reporters/junit.js +230 -0
- package/lib/reporters/junit.js.map +7 -0
- package/lib/reporters/line.js +113 -0
- package/lib/reporters/line.js.map +7 -0
- package/lib/reporters/list.js +235 -0
- package/lib/reporters/list.js.map +7 -0
- package/lib/reporters/listModeReporter.js +69 -0
- package/lib/reporters/listModeReporter.js.map +7 -0
- package/lib/reporters/markdown.js +144 -0
- package/lib/reporters/markdown.js.map +7 -0
- package/lib/reporters/merge.js +535 -0
- package/lib/reporters/merge.js.map +7 -0
- package/lib/reporters/multiplexer.js +104 -0
- package/lib/reporters/multiplexer.js.map +7 -0
- package/lib/reporters/reporterV2.js +102 -0
- package/lib/reporters/reporterV2.js.map +7 -0
- package/lib/reporters/teleEmitter.js +297 -0
- package/lib/reporters/teleEmitter.js.map +7 -0
- package/lib/reporters/versions/blobV1.js +16 -0
- package/lib/reporters/versions/blobV1.js.map +7 -0
- package/lib/runner/dispatcher.js +491 -0
- package/lib/runner/dispatcher.js.map +7 -0
- package/lib/runner/failureTracker.js +72 -0
- package/lib/runner/failureTracker.js.map +7 -0
- package/lib/runner/lastRun.js +77 -0
- package/lib/runner/lastRun.js.map +7 -0
- package/lib/runner/loadUtils.js +333 -0
- package/lib/runner/loadUtils.js.map +7 -0
- package/lib/runner/loaderHost.js +89 -0
- package/lib/runner/loaderHost.js.map +7 -0
- package/lib/runner/processHost.js +161 -0
- package/lib/runner/processHost.js.map +7 -0
- package/lib/runner/projectUtils.js +241 -0
- package/lib/runner/projectUtils.js.map +7 -0
- package/lib/runner/rebase.js +189 -0
- package/lib/runner/rebase.js.map +7 -0
- package/lib/runner/reporters.js +137 -0
- package/lib/runner/reporters.js.map +7 -0
- package/lib/runner/runner.js +173 -0
- package/lib/runner/sigIntWatcher.js +96 -0
- package/lib/runner/sigIntWatcher.js.map +7 -0
- package/lib/runner/taskRunner.js +127 -0
- package/lib/runner/taskRunner.js.map +7 -0
- package/lib/runner/tasks.js +410 -0
- package/lib/runner/tasks.js.map +7 -0
- package/lib/runner/testGroups.js +117 -0
- package/lib/runner/testGroups.js.map +7 -0
- package/lib/runner/testRunner.js +390 -0
- package/lib/runner/testRunner.js.map +7 -0
- package/lib/runner/testServer.js +264 -0
- package/lib/runner/testServer.js.map +7 -0
- package/lib/runner/uiMode.js +271 -0
- package/lib/runner/uiModeReporter.js +30 -0
- package/lib/runner/uiModeReporter.js.map +7 -0
- package/lib/runner/vcs.js +72 -0
- package/lib/runner/vcs.js.map +7 -0
- package/lib/runner/watchMode.js +395 -0
- package/lib/runner/watchMode.js.map +7 -0
- package/lib/runner/workerHost.js +95 -0
- package/lib/runner/workerHost.js.map +7 -0
- package/lib/store.js +98 -0
- package/lib/third_party/pirates.js +62 -0
- package/lib/third_party/pirates.js.map +7 -0
- package/lib/third_party/tsconfig-loader.js +103 -0
- package/lib/third_party/tsconfig-loader.js.map +7 -0
- package/lib/transform/babelBundle.js +43 -0
- package/lib/transform/babelBundle.js.map +7 -0
- package/lib/transform/babelBundleImpl.js +461 -0
- package/lib/transform/babelBundleImpl.js.map +7 -0
- package/lib/transform/compilationCache.js +272 -0
- package/lib/transform/compilationCache.js.map +7 -0
- package/lib/transform/esmLoader.js +104 -0
- package/lib/transform/esmLoader.js.map +7 -0
- package/lib/transform/esmUtils.js +32 -0
- package/lib/transform/portTransport.js +67 -0
- package/lib/transform/portTransport.js.map +7 -0
- package/lib/transform/transform.js +293 -0
- package/lib/transform/transform.js.map +7 -0
- package/lib/util.js +403 -0
- package/lib/util.js.map +7 -0
- package/lib/utilsBundle.js +43 -0
- package/lib/utilsBundle.js.map +7 -0
- package/lib/utilsBundleImpl.js +100 -0
- package/lib/utilsBundleImpl.js.map +7 -0
- package/lib/worker/fixtureRunner.js +258 -0
- package/lib/worker/fixtureRunner.js.map +7 -0
- package/lib/worker/stepContext.js +34 -0
- package/lib/worker/testInfo.js +508 -0
- package/lib/worker/testInfo.js.map +7 -0
- package/lib/worker/testTracing.js +344 -0
- package/lib/worker/testTracing.js.map +7 -0
- package/lib/worker/timeoutManager.js +174 -0
- package/lib/worker/timeoutManager.js.map +7 -0
- package/lib/worker/util.js +31 -0
- package/lib/worker/util.js.map +7 -0
- package/lib/worker/workerMain.js +520 -0
- package/lib/worker/workerMain.js.map +7 -0
- package/package.json +74 -0
- package/test.d.ts +18 -0
- package/test.js +24 -0
- package/test.mjs +33 -0
- package/types/test.d.ts +10217 -0
- package/types/testReporter.d.ts +816 -0
@@ -0,0 +1,508 @@
|
|
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 testInfo_exports = {};
|
30
|
+
__export(testInfo_exports, {
|
31
|
+
StepSkipError: () => StepSkipError,
|
32
|
+
TestInfoImpl: () => TestInfoImpl,
|
33
|
+
TestSkipError: () => TestSkipError,
|
34
|
+
TestStepInfoImpl: () => TestStepInfoImpl
|
35
|
+
});
|
36
|
+
module.exports = __toCommonJS(testInfo_exports);
|
37
|
+
var import_fs = __toESM(require("fs"));
|
38
|
+
var import_path = __toESM(require("path"));
|
39
|
+
var import_utils = require("playwright-core/lib/utils");
|
40
|
+
var import_timeoutManager = require("./timeoutManager");
|
41
|
+
var import_util = require("../util");
|
42
|
+
var import_testTracing = require("./testTracing");
|
43
|
+
var import_util2 = require("./util");
|
44
|
+
var import_transform = require("../transform/transform");
|
45
|
+
class TestInfoImpl {
|
46
|
+
constructor(configInternal, projectInternal, workerParams, test, retry, onStepBegin, onStepEnd, onAttach) {
|
47
|
+
this._snapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
|
48
|
+
this._ariaSnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
|
49
|
+
this._wasInterrupted = false;
|
50
|
+
this._lastStepId = 0;
|
51
|
+
this._steps = [];
|
52
|
+
this._stepMap = /* @__PURE__ */ new Map();
|
53
|
+
this._onDidFinishTestFunctions = [];
|
54
|
+
this._hasNonRetriableError = false;
|
55
|
+
this._hasUnhandledError = false;
|
56
|
+
this._allowSkips = false;
|
57
|
+
this.duration = 0;
|
58
|
+
this.annotations = [];
|
59
|
+
this.attachments = [];
|
60
|
+
this.status = "passed";
|
61
|
+
this.snapshotSuffix = "";
|
62
|
+
this.errors = [];
|
63
|
+
this.testId = test?.id ?? "";
|
64
|
+
this._onStepBegin = onStepBegin;
|
65
|
+
this._onStepEnd = onStepEnd;
|
66
|
+
this._onAttach = onAttach;
|
67
|
+
this._startTime = (0, import_utils.monotonicTime)();
|
68
|
+
this._startWallTime = Date.now();
|
69
|
+
this._requireFile = test?._requireFile ?? "";
|
70
|
+
this._uniqueSymbol = Symbol("testInfoUniqueSymbol");
|
71
|
+
this._workerParams = workerParams;
|
72
|
+
this.repeatEachIndex = workerParams.repeatEachIndex;
|
73
|
+
this.retry = retry;
|
74
|
+
this.workerIndex = workerParams.workerIndex;
|
75
|
+
this.parallelIndex = workerParams.parallelIndex;
|
76
|
+
this._projectInternal = projectInternal;
|
77
|
+
this.project = projectInternal.project;
|
78
|
+
this._configInternal = configInternal;
|
79
|
+
this.config = configInternal.config;
|
80
|
+
this.title = test?.title ?? "";
|
81
|
+
this.titlePath = test?.titlePath() ?? [];
|
82
|
+
this.file = test?.location.file ?? "";
|
83
|
+
this.line = test?.location.line ?? 0;
|
84
|
+
this.column = test?.location.column ?? 0;
|
85
|
+
this.tags = test?.tags ?? [];
|
86
|
+
this.fn = test?.fn ?? (() => {
|
87
|
+
});
|
88
|
+
this.expectedStatus = test?.expectedStatus ?? "skipped";
|
89
|
+
this._timeoutManager = new import_timeoutManager.TimeoutManager(this.project.timeout);
|
90
|
+
if (configInternal.configCLIOverrides.debug)
|
91
|
+
this._setDebugMode();
|
92
|
+
this.outputDir = (() => {
|
93
|
+
const relativeTestFilePath = import_path.default.relative(this.project.testDir, this._requireFile.replace(/\.(spec|test)\.(js|ts|jsx|tsx|mjs|mts|cjs|cts)$/, ""));
|
94
|
+
const sanitizedRelativePath = relativeTestFilePath.replace(process.platform === "win32" ? new RegExp("\\\\", "g") : new RegExp("/", "g"), "-");
|
95
|
+
const fullTitleWithoutSpec = this.titlePath.slice(1).join(" ");
|
96
|
+
let testOutputDir = (0, import_util.trimLongString)(sanitizedRelativePath + "-" + (0, import_utils.sanitizeForFilePath)(fullTitleWithoutSpec), import_util.windowsFilesystemFriendlyLength);
|
97
|
+
if (projectInternal.id)
|
98
|
+
testOutputDir += "-" + (0, import_utils.sanitizeForFilePath)(projectInternal.id);
|
99
|
+
if (this.retry)
|
100
|
+
testOutputDir += "-retry" + this.retry;
|
101
|
+
if (this.repeatEachIndex)
|
102
|
+
testOutputDir += "-repeat" + this.repeatEachIndex;
|
103
|
+
return import_path.default.join(this.project.outputDir, testOutputDir);
|
104
|
+
})();
|
105
|
+
this.snapshotDir = (() => {
|
106
|
+
const relativeTestFilePath = import_path.default.relative(this.project.testDir, this._requireFile);
|
107
|
+
return import_path.default.join(this.project.snapshotDir, relativeTestFilePath + "-snapshots");
|
108
|
+
})();
|
109
|
+
this._attachmentsPush = this.attachments.push.bind(this.attachments);
|
110
|
+
this.attachments.push = (...attachments) => {
|
111
|
+
for (const a of attachments)
|
112
|
+
this._attach(a, this._parentStep()?.stepId);
|
113
|
+
return this.attachments.length;
|
114
|
+
};
|
115
|
+
this._tracing = new import_testTracing.TestTracing(this, workerParams.artifactsDir);
|
116
|
+
this.skip = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("skip", location, args));
|
117
|
+
this.fixme = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("fixme", location, args));
|
118
|
+
this.fail = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("fail", location, args));
|
119
|
+
this.slow = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("slow", location, args));
|
120
|
+
}
|
121
|
+
get error() {
|
122
|
+
return this.errors[0];
|
123
|
+
}
|
124
|
+
set error(e) {
|
125
|
+
if (e === void 0)
|
126
|
+
throw new Error("Cannot assign testInfo.error undefined value!");
|
127
|
+
this.errors[0] = e;
|
128
|
+
}
|
129
|
+
get timeout() {
|
130
|
+
return this._timeoutManager.defaultSlot().timeout;
|
131
|
+
}
|
132
|
+
set timeout(timeout) {
|
133
|
+
}
|
134
|
+
_deadlineForMatcher(timeout) {
|
135
|
+
const startTime = (0, import_utils.monotonicTime)();
|
136
|
+
const matcherDeadline = timeout ? startTime + timeout : import_timeoutManager.kMaxDeadline;
|
137
|
+
const testDeadline = this._timeoutManager.currentSlotDeadline() - 250;
|
138
|
+
const matcherMessage = `Timeout ${timeout}ms exceeded while waiting on the predicate`;
|
139
|
+
const testMessage = `Test timeout of ${this.timeout}ms exceeded`;
|
140
|
+
return { deadline: Math.min(testDeadline, matcherDeadline), timeoutMessage: testDeadline < matcherDeadline ? testMessage : matcherMessage };
|
141
|
+
}
|
142
|
+
static _defaultDeadlineForMatcher(timeout) {
|
143
|
+
return { deadline: timeout ? (0, import_utils.monotonicTime)() + timeout : 0, timeoutMessage: `Timeout ${timeout}ms exceeded while waiting on the predicate` };
|
144
|
+
}
|
145
|
+
_modifier(type, location, modifierArgs) {
|
146
|
+
if (typeof modifierArgs[1] === "function") {
|
147
|
+
throw new Error([
|
148
|
+
"It looks like you are calling test.skip() inside the test and pass a callback.",
|
149
|
+
"Pass a condition instead and optional description instead:",
|
150
|
+
`test('my test', async ({ page, isMobile }) => {`,
|
151
|
+
` test.skip(isMobile, 'This test is not applicable on mobile');`,
|
152
|
+
`});`
|
153
|
+
].join("\n"));
|
154
|
+
}
|
155
|
+
if (modifierArgs.length >= 1 && !modifierArgs[0])
|
156
|
+
return;
|
157
|
+
const description = modifierArgs[1];
|
158
|
+
this.annotations.push({ type, description, location });
|
159
|
+
if (type === "slow") {
|
160
|
+
this._timeoutManager.slow();
|
161
|
+
} else if (type === "skip" || type === "fixme") {
|
162
|
+
this.expectedStatus = "skipped";
|
163
|
+
throw new TestSkipError("Test is skipped: " + (description || ""));
|
164
|
+
} else if (type === "fail") {
|
165
|
+
if (this.expectedStatus !== "skipped")
|
166
|
+
this.expectedStatus = "failed";
|
167
|
+
}
|
168
|
+
}
|
169
|
+
_findLastPredefinedStep(steps) {
|
170
|
+
for (let i = steps.length - 1; i >= 0; i--) {
|
171
|
+
const child = this._findLastPredefinedStep(steps[i].steps);
|
172
|
+
if (child)
|
173
|
+
return child;
|
174
|
+
if ((steps[i].category === "hook" || steps[i].category === "fixture") && !steps[i].endWallTime)
|
175
|
+
return steps[i];
|
176
|
+
}
|
177
|
+
}
|
178
|
+
_parentStep() {
|
179
|
+
return (0, import_utils.currentZone)().data("stepZone") ?? this._findLastPredefinedStep(this._steps);
|
180
|
+
}
|
181
|
+
_addStep(data, parentStep) {
|
182
|
+
const stepId = `${data.category}@${++this._lastStepId}`;
|
183
|
+
if (data.category === "hook" || data.category === "fixture") {
|
184
|
+
parentStep = this._findLastPredefinedStep(this._steps);
|
185
|
+
} else {
|
186
|
+
if (!parentStep)
|
187
|
+
parentStep = this._parentStep();
|
188
|
+
}
|
189
|
+
const filteredStack = (0, import_util.filteredStackTrace)((0, import_utils.captureRawStack)());
|
190
|
+
let boxedStack = parentStep?.boxedStack;
|
191
|
+
let location = data.location;
|
192
|
+
if (!boxedStack && data.box) {
|
193
|
+
boxedStack = filteredStack.slice(1);
|
194
|
+
location = location || boxedStack[0];
|
195
|
+
}
|
196
|
+
location = location || filteredStack[0];
|
197
|
+
const step = {
|
198
|
+
...data,
|
199
|
+
stepId,
|
200
|
+
group: parentStep?.group ?? data.group,
|
201
|
+
boxedStack,
|
202
|
+
location,
|
203
|
+
steps: [],
|
204
|
+
attachmentIndices: [],
|
205
|
+
info: new TestStepInfoImpl(this, stepId, data.title, parentStep?.info),
|
206
|
+
complete: (result) => {
|
207
|
+
if (step.endWallTime)
|
208
|
+
return;
|
209
|
+
step.endWallTime = Date.now();
|
210
|
+
if (result.error) {
|
211
|
+
if (typeof result.error === "object" && !result.error?.[stepSymbol])
|
212
|
+
result.error[stepSymbol] = step;
|
213
|
+
const error = (0, import_util2.testInfoError)(result.error);
|
214
|
+
if (step.boxedStack)
|
215
|
+
error.stack = `${error.message}
|
216
|
+
${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
217
|
+
step.error = error;
|
218
|
+
}
|
219
|
+
if (!step.error) {
|
220
|
+
for (const childStep of step.steps) {
|
221
|
+
if (childStep.error && childStep.infectParentStepsWithError) {
|
222
|
+
step.error = childStep.error;
|
223
|
+
step.infectParentStepsWithError = true;
|
224
|
+
break;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
}
|
228
|
+
if (!step.group) {
|
229
|
+
const payload = {
|
230
|
+
testId: this.testId,
|
231
|
+
stepId,
|
232
|
+
wallTime: step.endWallTime,
|
233
|
+
error: step.error,
|
234
|
+
suggestedRebaseline: result.suggestedRebaseline,
|
235
|
+
annotations: step.info.annotations
|
236
|
+
};
|
237
|
+
this._onStepEnd(payload);
|
238
|
+
}
|
239
|
+
if (step.group !== "internal") {
|
240
|
+
const errorForTrace = step.error ? { name: "", message: step.error.message || "", stack: step.error.stack } : void 0;
|
241
|
+
const attachments = step.attachmentIndices.map((i) => this.attachments[i]);
|
242
|
+
this._tracing.appendAfterActionForStep(stepId, errorForTrace, attachments, step.info.annotations);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
};
|
246
|
+
const parentStepList = parentStep ? parentStep.steps : this._steps;
|
247
|
+
parentStepList.push(step);
|
248
|
+
this._stepMap.set(stepId, step);
|
249
|
+
if (!step.group) {
|
250
|
+
const payload = {
|
251
|
+
testId: this.testId,
|
252
|
+
stepId,
|
253
|
+
parentStepId: parentStep ? parentStep.stepId : void 0,
|
254
|
+
title: step.title,
|
255
|
+
category: step.category,
|
256
|
+
wallTime: Date.now(),
|
257
|
+
location: step.location
|
258
|
+
};
|
259
|
+
this._onStepBegin(payload);
|
260
|
+
}
|
261
|
+
if (step.group !== "internal") {
|
262
|
+
this._tracing.appendBeforeActionForStep({
|
263
|
+
stepId,
|
264
|
+
parentId: parentStep?.stepId,
|
265
|
+
title: step.title,
|
266
|
+
category: step.category,
|
267
|
+
params: step.params,
|
268
|
+
stack: step.location ? [step.location] : [],
|
269
|
+
group: step.group
|
270
|
+
});
|
271
|
+
}
|
272
|
+
return step;
|
273
|
+
}
|
274
|
+
_interrupt() {
|
275
|
+
this._wasInterrupted = true;
|
276
|
+
this._timeoutManager.interrupt();
|
277
|
+
if (this.status === "passed")
|
278
|
+
this.status = "interrupted";
|
279
|
+
}
|
280
|
+
_failWithError(error) {
|
281
|
+
if (this.status === "passed" || this.status === "skipped")
|
282
|
+
this.status = error instanceof import_timeoutManager.TimeoutManagerError ? "timedOut" : "failed";
|
283
|
+
const serialized = (0, import_util2.testInfoError)(error);
|
284
|
+
const step = typeof error === "object" ? error?.[stepSymbol] : void 0;
|
285
|
+
if (step && step.boxedStack)
|
286
|
+
serialized.stack = `${error.name}: ${error.message}
|
287
|
+
${(0, import_utils.stringifyStackFrames)(step.boxedStack).join("\n")}`;
|
288
|
+
this.errors.push(serialized);
|
289
|
+
this._tracing.appendForError(serialized);
|
290
|
+
}
|
291
|
+
async _runAsStep(stepInfo, cb) {
|
292
|
+
const step = this._addStep(stepInfo);
|
293
|
+
try {
|
294
|
+
await cb();
|
295
|
+
step.complete({});
|
296
|
+
} catch (error) {
|
297
|
+
step.complete({ error });
|
298
|
+
throw error;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
async _runWithTimeout(runnable, cb) {
|
302
|
+
try {
|
303
|
+
await this._timeoutManager.withRunnable(runnable, async () => {
|
304
|
+
try {
|
305
|
+
await cb();
|
306
|
+
} catch (e) {
|
307
|
+
if (this._allowSkips && e instanceof TestSkipError) {
|
308
|
+
if (this.status === "passed")
|
309
|
+
this.status = "skipped";
|
310
|
+
} else {
|
311
|
+
this._failWithError(e);
|
312
|
+
}
|
313
|
+
throw e;
|
314
|
+
}
|
315
|
+
});
|
316
|
+
} catch (error) {
|
317
|
+
if (!this._wasInterrupted && error instanceof import_timeoutManager.TimeoutManagerError)
|
318
|
+
this._failWithError(error);
|
319
|
+
throw error;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
_isFailure() {
|
323
|
+
return this.status !== "skipped" && this.status !== this.expectedStatus;
|
324
|
+
}
|
325
|
+
_currentHookType() {
|
326
|
+
const type = this._timeoutManager.currentSlotType();
|
327
|
+
return ["beforeAll", "afterAll", "beforeEach", "afterEach"].includes(type) ? type : void 0;
|
328
|
+
}
|
329
|
+
_setDebugMode() {
|
330
|
+
this._timeoutManager.setIgnoreTimeouts();
|
331
|
+
}
|
332
|
+
// ------------ TestInfo methods ------------
|
333
|
+
async attach(name, options = {}) {
|
334
|
+
const step = this._addStep({
|
335
|
+
title: `Attach ${(0, import_utils.escapeWithQuotes)(name, '"')}`,
|
336
|
+
category: "test.attach"
|
337
|
+
});
|
338
|
+
this._attach(
|
339
|
+
await (0, import_util.normalizeAndSaveAttachment)(this.outputPath(), name, options),
|
340
|
+
step.stepId
|
341
|
+
);
|
342
|
+
step.complete({});
|
343
|
+
}
|
344
|
+
_attach(attachment, stepId) {
|
345
|
+
const index = this._attachmentsPush(attachment) - 1;
|
346
|
+
let step = stepId ? this._stepMap.get(stepId) : void 0;
|
347
|
+
if (!!step?.group)
|
348
|
+
step = void 0;
|
349
|
+
if (step) {
|
350
|
+
step.attachmentIndices.push(index);
|
351
|
+
} else {
|
352
|
+
const stepId2 = `attach@${(0, import_utils.createGuid)()}`;
|
353
|
+
this._tracing.appendBeforeActionForStep({ stepId: stepId2, title: `Attach ${(0, import_utils.escapeWithQuotes)(attachment.name, '"')}`, category: "test.attach", stack: [] });
|
354
|
+
this._tracing.appendAfterActionForStep(stepId2, void 0, [attachment]);
|
355
|
+
}
|
356
|
+
this._onAttach({
|
357
|
+
testId: this.testId,
|
358
|
+
name: attachment.name,
|
359
|
+
contentType: attachment.contentType,
|
360
|
+
path: attachment.path,
|
361
|
+
body: attachment.body?.toString("base64"),
|
362
|
+
stepId: step?.stepId
|
363
|
+
});
|
364
|
+
}
|
365
|
+
outputPath(...pathSegments) {
|
366
|
+
const outputPath = this._getOutputPath(...pathSegments);
|
367
|
+
import_fs.default.mkdirSync(this.outputDir, { recursive: true });
|
368
|
+
return outputPath;
|
369
|
+
}
|
370
|
+
_getOutputPath(...pathSegments) {
|
371
|
+
const joinedPath = import_path.default.join(...pathSegments);
|
372
|
+
const outputPath = (0, import_util.getContainedPath)(this.outputDir, joinedPath);
|
373
|
+
if (outputPath)
|
374
|
+
return outputPath;
|
375
|
+
throw new Error(`The outputPath is not allowed outside of the parent directory. Please fix the defined path.
|
376
|
+
|
377
|
+
outputPath: ${joinedPath}`);
|
378
|
+
}
|
379
|
+
_fsSanitizedTestName() {
|
380
|
+
const fullTitleWithoutSpec = this.titlePath.slice(1).join(" ");
|
381
|
+
return (0, import_utils.sanitizeForFilePath)((0, import_util.trimLongString)(fullTitleWithoutSpec));
|
382
|
+
}
|
383
|
+
_resolveSnapshotPaths(kind, name, updateSnapshotIndex, anonymousExtension) {
|
384
|
+
const snapshotNames = kind === "aria" ? this._ariaSnapshotNames : this._snapshotNames;
|
385
|
+
const defaultExtensions = { "aria": ".aria.yml", "screenshot": ".png", "snapshot": ".txt" };
|
386
|
+
const ariaAwareExtname = (filePath) => kind === "aria" && filePath.endsWith(".aria.yml") ? ".aria.yml" : import_path.default.extname(filePath);
|
387
|
+
let subPath;
|
388
|
+
let ext;
|
389
|
+
let relativeOutputPath;
|
390
|
+
if (!name) {
|
391
|
+
const index = snapshotNames.lastAnonymousSnapshotIndex + 1;
|
392
|
+
if (updateSnapshotIndex === "updateSnapshotIndex")
|
393
|
+
snapshotNames.lastAnonymousSnapshotIndex = index;
|
394
|
+
const fullTitleWithoutSpec = [...this.titlePath.slice(1), index].join(" ");
|
395
|
+
ext = anonymousExtension ?? defaultExtensions[kind];
|
396
|
+
subPath = (0, import_util.sanitizeFilePathBeforeExtension)((0, import_util.trimLongString)(fullTitleWithoutSpec) + ext, ext);
|
397
|
+
relativeOutputPath = (0, import_util.sanitizeFilePathBeforeExtension)((0, import_util.trimLongString)(fullTitleWithoutSpec, import_util.windowsFilesystemFriendlyLength) + ext, ext);
|
398
|
+
} else {
|
399
|
+
if (Array.isArray(name)) {
|
400
|
+
subPath = import_path.default.join(...name);
|
401
|
+
relativeOutputPath = import_path.default.join(...name);
|
402
|
+
ext = ariaAwareExtname(subPath);
|
403
|
+
} else {
|
404
|
+
ext = ariaAwareExtname(name);
|
405
|
+
subPath = (0, import_util.sanitizeFilePathBeforeExtension)(name, ext);
|
406
|
+
relativeOutputPath = (0, import_util.sanitizeFilePathBeforeExtension)((0, import_util.trimLongString)(name, import_util.windowsFilesystemFriendlyLength), ext);
|
407
|
+
}
|
408
|
+
const index = (snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] || 0) + 1;
|
409
|
+
if (updateSnapshotIndex === "updateSnapshotIndex")
|
410
|
+
snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] = index;
|
411
|
+
if (index > 1)
|
412
|
+
relativeOutputPath = (0, import_util.addSuffixToFilePath)(relativeOutputPath, `-${index - 1}`);
|
413
|
+
}
|
414
|
+
const absoluteSnapshotPath = this._applyPathTemplate(kind, subPath, ext);
|
415
|
+
return { absoluteSnapshotPath, relativeOutputPath };
|
416
|
+
}
|
417
|
+
_applyPathTemplate(kind, relativePath, ext) {
|
418
|
+
const legacyTemplate = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}";
|
419
|
+
let template;
|
420
|
+
if (kind === "screenshot") {
|
421
|
+
template = this._projectInternal.expect?.toHaveScreenshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || legacyTemplate;
|
422
|
+
} else if (kind === "aria") {
|
423
|
+
const ariaDefaultTemplate = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}";
|
424
|
+
template = this._projectInternal.expect?.toMatchAriaSnapshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || ariaDefaultTemplate;
|
425
|
+
} else {
|
426
|
+
template = this._projectInternal.snapshotPathTemplate || legacyTemplate;
|
427
|
+
}
|
428
|
+
const dir = import_path.default.dirname(relativePath);
|
429
|
+
const name = import_path.default.basename(relativePath, ext);
|
430
|
+
const relativeTestFilePath = import_path.default.relative(this.project.testDir, this._requireFile);
|
431
|
+
const parsedRelativeTestFilePath = import_path.default.parse(relativeTestFilePath);
|
432
|
+
const projectNamePathSegment = (0, import_utils.sanitizeForFilePath)(this.project.name);
|
433
|
+
const snapshotPath = template.replace(/\{(.)?testDir\}/g, "$1" + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, "$1" + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? "$1" + this.snapshotSuffix : "").replace(/\{(.)?testFileDir\}/g, "$1" + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, "$1" + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? "$1" + projectNamePathSegment : "").replace(/\{(.)?testName\}/g, "$1" + this._fsSanitizedTestName()).replace(/\{(.)?testFileName\}/g, "$1" + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, "$1" + relativeTestFilePath).replace(/\{(.)?arg\}/g, "$1" + import_path.default.join(dir, name)).replace(/\{(.)?ext\}/g, ext ? "$1" + ext : "");
|
434
|
+
return import_path.default.normalize(import_path.default.resolve(this._configInternal.configDir, snapshotPath));
|
435
|
+
}
|
436
|
+
snapshotPath(...args) {
|
437
|
+
let name = args;
|
438
|
+
let kind = "snapshot";
|
439
|
+
const options = args[args.length - 1];
|
440
|
+
if (options && typeof options === "object") {
|
441
|
+
kind = options.kind ?? kind;
|
442
|
+
name = args.slice(0, -1);
|
443
|
+
}
|
444
|
+
if (!["snapshot", "screenshot", "aria"].includes(kind))
|
445
|
+
throw new Error(`testInfo.snapshotPath: unknown kind "${kind}", must be one of "snapshot", "screenshot" or "aria"`);
|
446
|
+
return this._resolveSnapshotPaths(kind, name.length <= 1 ? name[0] : name, "dontUpdateSnapshotIndex").absoluteSnapshotPath;
|
447
|
+
}
|
448
|
+
setTimeout(timeout) {
|
449
|
+
this._timeoutManager.setTimeout(timeout);
|
450
|
+
}
|
451
|
+
_pauseOnError() {
|
452
|
+
return this._workerParams.pauseOnError;
|
453
|
+
}
|
454
|
+
_pauseAtEnd() {
|
455
|
+
return this._workerParams.pauseAtEnd;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
class TestStepInfoImpl {
|
459
|
+
constructor(testInfo, stepId, title, parentStep) {
|
460
|
+
this.annotations = [];
|
461
|
+
this._testInfo = testInfo;
|
462
|
+
this._stepId = stepId;
|
463
|
+
this._title = title;
|
464
|
+
this._parentStep = parentStep;
|
465
|
+
this.skip = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => {
|
466
|
+
if (args.length > 0 && !args[0])
|
467
|
+
return;
|
468
|
+
const description = args[1];
|
469
|
+
this.annotations.push({ type: "skip", description, location });
|
470
|
+
throw new StepSkipError(description);
|
471
|
+
});
|
472
|
+
}
|
473
|
+
async _runStepBody(skip, body, location) {
|
474
|
+
if (skip) {
|
475
|
+
this.annotations.push({ type: "skip", location });
|
476
|
+
return void 0;
|
477
|
+
}
|
478
|
+
try {
|
479
|
+
return await body(this);
|
480
|
+
} catch (e) {
|
481
|
+
if (e instanceof StepSkipError)
|
482
|
+
return void 0;
|
483
|
+
throw e;
|
484
|
+
}
|
485
|
+
}
|
486
|
+
_attachToStep(attachment) {
|
487
|
+
this._testInfo._attach(attachment, this._stepId);
|
488
|
+
}
|
489
|
+
async attach(name, options) {
|
490
|
+
this._attachToStep(await (0, import_util.normalizeAndSaveAttachment)(this._testInfo.outputPath(), name, options));
|
491
|
+
}
|
492
|
+
get titlePath() {
|
493
|
+
const parent = this._parentStep ?? this._testInfo;
|
494
|
+
return [...parent.titlePath, this._title];
|
495
|
+
}
|
496
|
+
}
|
497
|
+
class TestSkipError extends Error {
|
498
|
+
}
|
499
|
+
class StepSkipError extends Error {
|
500
|
+
}
|
501
|
+
const stepSymbol = Symbol("step");
|
502
|
+
// Annotate the CommonJS export names for ESM import in node:
|
503
|
+
0 && (module.exports = {
|
504
|
+
StepSkipError,
|
505
|
+
TestInfoImpl,
|
506
|
+
TestSkipError,
|
507
|
+
TestStepInfoImpl
|
508
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/worker/testInfo.ts"],
|
4
|
+
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { captureRawStack, monotonicTime, sanitizeForFilePath, stringifyStackFrames, currentZone, createGuid, escapeWithQuotes } from 'playwright-core/lib/utils';\n\nimport { TimeoutManager, TimeoutManagerError, kMaxDeadline } from './timeoutManager';\nimport { addSuffixToFilePath, filteredStackTrace, getContainedPath, normalizeAndSaveAttachment, sanitizeFilePathBeforeExtension, trimLongString, windowsFilesystemFriendlyLength } from '../util';\nimport { TestTracing } from './testTracing';\nimport { testInfoError } from './util';\nimport { wrapFunctionWithLocation } from '../transform/transform';\n\nimport type { RunnableDescription } from './timeoutManager';\nimport type { FullProject, TestInfo, TestStatus, TestStepInfo, TestAnnotation } from '../../types/test';\nimport type { FullConfig, Location } from '../../types/testReporter';\nimport type { FullConfigInternal, FullProjectInternal } from '../common/config';\nimport type { AttachmentPayload, StepBeginPayload, StepEndPayload, TestInfoErrorImpl, WorkerInitParams } from '../common/ipc';\nimport type { TestCase } from '../common/test';\nimport type { StackFrame } from '@protocol/channels';\n\nexport type TestStepCategory = 'expect' | 'fixture' | 'hook' | 'pw:api' | 'test.step' | 'test.attach';\n\ninterface TestStepData {\n title: string;\n category: TestStepCategory;\n location?: Location;\n apiName?: string;\n params?: Record<string, any>;\n infectParentStepsWithError?: boolean;\n box?: boolean;\n // steps with any defined group are hidden from the report\n // 'internal' steps are hidden from the trace\n group?: string;\n}\n\nexport interface TestStepInternal extends TestStepData {\n complete(result: { error?: Error | unknown, suggestedRebaseline?: string }): void;\n info: TestStepInfoImpl;\n attachmentIndices: number[];\n stepId: string;\n boxedStack?: StackFrame[];\n steps: TestStepInternal[];\n endWallTime?: number;\n error?: TestInfoErrorImpl;\n}\n\ntype SnapshotNames = {\n lastAnonymousSnapshotIndex: number;\n lastNamedSnapshotIndex: { [key: string]: number };\n};\n\nexport class TestInfoImpl implements TestInfo {\n private _onStepBegin: (payload: StepBeginPayload) => void;\n private _onStepEnd: (payload: StepEndPayload) => void;\n private _onAttach: (payload: AttachmentPayload) => void;\n private _snapshotNames: SnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };\n private _ariaSnapshotNames: SnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };\n readonly _timeoutManager: TimeoutManager;\n readonly _startTime: number;\n readonly _startWallTime: number;\n readonly _tracing: TestTracing;\n readonly _uniqueSymbol;\n\n _wasInterrupted = false;\n _lastStepId = 0;\n private readonly _requireFile: string;\n readonly _projectInternal: FullProjectInternal;\n readonly _configInternal: FullConfigInternal;\n private readonly _steps: TestStepInternal[] = [];\n private readonly _stepMap = new Map<string, TestStepInternal>();\n _onDidFinishTestFunction: (() => Promise<void>) | undefined;\n _hasNonRetriableError = false;\n _hasUnhandledError = false;\n _allowSkips = false;\n\n // ------------ Main methods ------------\n skip: (arg?: any, description?: string) => void;\n fixme: (arg?: any, description?: string) => void;\n fail: (arg?: any, description?: string) => void;\n slow: (arg?: any, description?: string) => void;\n\n // ------------ TestInfo fields ------------\n readonly testId: string;\n readonly repeatEachIndex: number;\n readonly retry: number;\n readonly workerIndex: number;\n readonly parallelIndex: number;\n readonly project: FullProject;\n readonly config: FullConfig;\n readonly title: string;\n readonly titlePath: string[];\n readonly file: string;\n readonly line: number;\n readonly tags: string[];\n readonly column: number;\n readonly fn: Function;\n expectedStatus: TestStatus;\n duration: number = 0;\n readonly annotations: TestAnnotation[] = [];\n readonly attachments: TestInfo['attachments'] = [];\n status: TestStatus = 'passed';\n snapshotSuffix: string = '';\n readonly outputDir: string;\n readonly snapshotDir: string;\n errors: TestInfoErrorImpl[] = [];\n readonly _attachmentsPush: (...items: TestInfo['attachments']) => number;\n\n get error(): TestInfoErrorImpl | undefined {\n return this.errors[0];\n }\n\n set error(e: TestInfoErrorImpl | undefined) {\n if (e === undefined)\n throw new Error('Cannot assign testInfo.error undefined value!');\n this.errors[0] = e;\n }\n\n get timeout(): number {\n return this._timeoutManager.defaultSlot().timeout;\n }\n\n set timeout(timeout: number) {\n // Ignored.\n }\n\n _deadlineForMatcher(timeout: number): { deadline: number, timeoutMessage: string } {\n const startTime = monotonicTime();\n const matcherDeadline = timeout ? startTime + timeout : kMaxDeadline;\n const testDeadline = this._timeoutManager.currentSlotDeadline() - 250;\n const matcherMessage = `Timeout ${timeout}ms exceeded while waiting on the predicate`;\n const testMessage = `Test timeout of ${this.timeout}ms exceeded`;\n return { deadline: Math.min(testDeadline, matcherDeadline), timeoutMessage: testDeadline < matcherDeadline ? testMessage : matcherMessage };\n }\n\n static _defaultDeadlineForMatcher(timeout: number): { deadline: any; timeoutMessage: any; } {\n return { deadline: (timeout ? monotonicTime() + timeout : 0), timeoutMessage: `Timeout ${timeout}ms exceeded while waiting on the predicate` };\n }\n\n constructor(\n configInternal: FullConfigInternal,\n projectInternal: FullProjectInternal,\n workerParams: WorkerInitParams,\n test: TestCase | undefined,\n retry: number,\n onStepBegin: (payload: StepBeginPayload) => void,\n onStepEnd: (payload: StepEndPayload) => void,\n onAttach: (payload: AttachmentPayload) => void,\n ) {\n this.testId = test?.id ?? '';\n this._onStepBegin = onStepBegin;\n this._onStepEnd = onStepEnd;\n this._onAttach = onAttach;\n this._startTime = monotonicTime();\n this._startWallTime = Date.now();\n this._requireFile = test?._requireFile ?? '';\n this._uniqueSymbol = Symbol('testInfoUniqueSymbol');\n\n this.repeatEachIndex = workerParams.repeatEachIndex;\n this.retry = retry;\n this.workerIndex = workerParams.workerIndex;\n this.parallelIndex = workerParams.parallelIndex;\n this._projectInternal = projectInternal;\n this.project = projectInternal.project;\n this._configInternal = configInternal;\n this.config = configInternal.config;\n this.title = test?.title ?? '';\n this.titlePath = test?.titlePath() ?? [];\n this.file = test?.location.file ?? '';\n this.line = test?.location.line ?? 0;\n this.column = test?.location.column ?? 0;\n this.tags = test?.tags ?? [];\n this.fn = test?.fn ?? (() => {});\n this.expectedStatus = test?.expectedStatus ?? 'skipped';\n\n this._timeoutManager = new TimeoutManager(this.project.timeout);\n if (configInternal.configCLIOverrides.debug)\n this._setDebugMode();\n\n this.outputDir = (() => {\n const relativeTestFilePath = path.relative(this.project.testDir, this._requireFile.replace(/\\.(spec|test)\\.(js|ts|jsx|tsx|mjs|mts|cjs|cts)$/, ''));\n const sanitizedRelativePath = relativeTestFilePath.replace(process.platform === 'win32' ? new RegExp('\\\\\\\\', 'g') : new RegExp('/', 'g'), '-');\n const fullTitleWithoutSpec = this.titlePath.slice(1).join(' ');\n\n let testOutputDir = trimLongString(sanitizedRelativePath + '-' + sanitizeForFilePath(fullTitleWithoutSpec), windowsFilesystemFriendlyLength);\n if (projectInternal.id)\n testOutputDir += '-' + sanitizeForFilePath(projectInternal.id);\n if (this.retry)\n testOutputDir += '-retry' + this.retry;\n if (this.repeatEachIndex)\n testOutputDir += '-repeat' + this.repeatEachIndex;\n return path.join(this.project.outputDir, testOutputDir);\n })();\n\n this.snapshotDir = (() => {\n const relativeTestFilePath = path.relative(this.project.testDir, this._requireFile);\n return path.join(this.project.snapshotDir, relativeTestFilePath + '-snapshots');\n })();\n\n this._attachmentsPush = this.attachments.push.bind(this.attachments);\n this.attachments.push = (...attachments: TestInfo['attachments']) => {\n for (const a of attachments)\n this._attach(a, this._parentStep()?.stepId);\n return this.attachments.length;\n };\n\n this._tracing = new TestTracing(this, workerParams.artifactsDir);\n\n this.skip = wrapFunctionWithLocation((location, ...args) => this._modifier('skip', location, args));\n this.fixme = wrapFunctionWithLocation((location, ...args) => this._modifier('fixme', location, args));\n this.fail = wrapFunctionWithLocation((location, ...args) => this._modifier('fail', location, args));\n this.slow = wrapFunctionWithLocation((location, ...args) => this._modifier('slow', location, args));\n }\n\n _modifier(type: 'skip' | 'fail' | 'fixme' | 'slow', location: Location, modifierArgs: [arg?: any, description?: string]) {\n if (typeof modifierArgs[1] === 'function') {\n throw new Error([\n 'It looks like you are calling test.skip() inside the test and pass a callback.',\n 'Pass a condition instead and optional description instead:',\n `test('my test', async ({ page, isMobile }) => {`,\n ` test.skip(isMobile, 'This test is not applicable on mobile');`,\n `});`,\n ].join('\\n'));\n }\n\n if (modifierArgs.length >= 1 && !modifierArgs[0])\n return;\n\n const description = modifierArgs[1];\n this.annotations.push({ type, description, location });\n if (type === 'slow') {\n this._timeoutManager.slow();\n } else if (type === 'skip' || type === 'fixme') {\n this.expectedStatus = 'skipped';\n throw new TestSkipError('Test is skipped: ' + (description || ''));\n } else if (type === 'fail') {\n if (this.expectedStatus !== 'skipped')\n this.expectedStatus = 'failed';\n }\n }\n\n private _findLastPredefinedStep(steps: TestStepInternal[]): TestStepInternal | undefined {\n // Find the deepest predefined step that has not finished yet.\n for (let i = steps.length - 1; i >= 0; i--) {\n const child = this._findLastPredefinedStep(steps[i].steps);\n if (child)\n return child;\n if ((steps[i].category === 'hook' || steps[i].category === 'fixture') && !steps[i].endWallTime)\n return steps[i];\n }\n }\n\n private _parentStep() {\n return currentZone().data<TestStepInternal>('stepZone') ?? this._findLastPredefinedStep(this._steps);\n }\n\n _addStep(data: Readonly<TestStepData>, parentStep?: TestStepInternal): TestStepInternal {\n const stepId = `${data.category}@${++this._lastStepId}`;\n\n if (data.category === 'hook' || data.category === 'fixture') {\n // Predefined steps form a fixed hierarchy - use the current one as parent.\n parentStep = this._findLastPredefinedStep(this._steps);\n } else {\n if (!parentStep)\n parentStep = this._parentStep();\n }\n\n const filteredStack = filteredStackTrace(captureRawStack());\n let boxedStack = parentStep?.boxedStack;\n let location = data.location;\n if (!boxedStack && data.box) {\n boxedStack = filteredStack.slice(1);\n location = location || boxedStack[0];\n }\n location = location || filteredStack[0];\n\n const step: TestStepInternal = {\n ...data,\n stepId,\n group: parentStep?.group ?? data.group,\n boxedStack,\n location,\n steps: [],\n attachmentIndices: [],\n info: new TestStepInfoImpl(this, stepId, data.title, parentStep?.info),\n complete: result => {\n if (step.endWallTime)\n return;\n\n step.endWallTime = Date.now();\n if (result.error) {\n if (typeof result.error === 'object' && !(result.error as any)?.[stepSymbol])\n (result.error as any)[stepSymbol] = step;\n const error = testInfoError(result.error);\n if (step.boxedStack)\n error.stack = `${error.message}\\n${stringifyStackFrames(step.boxedStack).join('\\n')}`;\n step.error = error;\n }\n\n if (!step.error) {\n // Soft errors inside try/catch will make the test fail.\n // In order to locate the failing step, we are marking all the parent\n // steps as failing unconditionally.\n for (const childStep of step.steps) {\n if (childStep.error && childStep.infectParentStepsWithError) {\n step.error = childStep.error;\n step.infectParentStepsWithError = true;\n break;\n }\n }\n }\n\n if (!step.group) {\n const payload: StepEndPayload = {\n testId: this.testId,\n stepId,\n wallTime: step.endWallTime,\n error: step.error,\n suggestedRebaseline: result.suggestedRebaseline,\n annotations: step.info.annotations,\n };\n this._onStepEnd(payload);\n }\n if (step.group !== 'internal') {\n const errorForTrace = step.error ? { name: '', message: step.error.message || '', stack: step.error.stack } : undefined;\n const attachments = step.attachmentIndices.map(i => this.attachments[i]);\n this._tracing.appendAfterActionForStep(stepId, errorForTrace, attachments, step.info.annotations);\n }\n }\n };\n const parentStepList = parentStep ? parentStep.steps : this._steps;\n parentStepList.push(step);\n this._stepMap.set(stepId, step);\n\n if (!step.group) {\n const payload: StepBeginPayload = {\n testId: this.testId,\n stepId,\n parentStepId: parentStep ? parentStep.stepId : undefined,\n title: step.title,\n category: step.category,\n wallTime: Date.now(),\n location: step.location,\n };\n this._onStepBegin(payload);\n }\n if (step.group !== 'internal') {\n this._tracing.appendBeforeActionForStep({\n stepId,\n parentId: parentStep?.stepId,\n title: step.title,\n category: step.category,\n params: step.params,\n stack: step.location ? [step.location] : [],\n group: step.group,\n });\n }\n\n return step;\n }\n\n _interrupt() {\n // Mark as interrupted so we can ignore TimeoutError thrown by interrupt() call.\n this._wasInterrupted = true;\n this._timeoutManager.interrupt();\n // Do not overwrite existing failure (for example, unhandled rejection) with \"interrupted\".\n if (this.status === 'passed')\n this.status = 'interrupted';\n }\n\n _failWithError(error: Error | unknown) {\n if (this.status === 'passed' || this.status === 'skipped')\n this.status = error instanceof TimeoutManagerError ? 'timedOut' : 'failed';\n const serialized = testInfoError(error);\n const step: TestStepInternal | undefined = typeof error === 'object' ? (error as any)?.[stepSymbol] : undefined;\n if (step && step.boxedStack)\n serialized.stack = `${(error as Error).name}: ${(error as Error).message}\\n${stringifyStackFrames(step.boxedStack).join('\\n')}`;\n this.errors.push(serialized);\n this._tracing.appendForError(serialized);\n }\n\n async _runAsStep(stepInfo: { title: string, category: 'hook' | 'fixture', location?: Location, group?: string }, cb: () => Promise<any>) {\n const step = this._addStep(stepInfo);\n try {\n await cb();\n step.complete({});\n } catch (error) {\n step.complete({ error });\n throw error;\n }\n }\n\n async _runWithTimeout(runnable: RunnableDescription, cb: () => Promise<any>) {\n try {\n await this._timeoutManager.withRunnable(runnable, async () => {\n try {\n await cb();\n } catch (e) {\n if (this._allowSkips && (e instanceof TestSkipError)) {\n if (this.status === 'passed')\n this.status = 'skipped';\n } else {\n // Unfortunately, we have to handle user errors and timeout errors differently.\n // Consider the following scenario:\n // - locator.click times out\n // - all steps containing the test function finish with TimeoutManagerError\n // - test finishes, the page is closed and this triggers locator.click error\n // - we would like to present the locator.click error to the user\n // - therefore, we need a try/catch inside the \"run with timeout\" block and capture the error\n this._failWithError(e);\n }\n throw e;\n }\n });\n } catch (error) {\n // When interrupting, we arrive here with a TimeoutManagerError, but we should not\n // consider it a timeout.\n if (!this._wasInterrupted && (error instanceof TimeoutManagerError))\n this._failWithError(error);\n throw error;\n }\n }\n\n _isFailure() {\n return this.status !== 'skipped' && this.status !== this.expectedStatus;\n }\n\n _currentHookType() {\n const type = this._timeoutManager.currentSlotType();\n return ['beforeAll', 'afterAll', 'beforeEach', 'afterEach'].includes(type) ? type : undefined;\n }\n\n _setDebugMode() {\n this._timeoutManager.setIgnoreTimeouts();\n }\n\n // ------------ TestInfo methods ------------\n\n async attach(name: string, options: { path?: string, body?: string | Buffer, contentType?: string } = {}) {\n const step = this._addStep({\n title: `Attach ${escapeWithQuotes(name, '\"')}`,\n category: 'test.attach',\n });\n this._attach(\n await normalizeAndSaveAttachment(this.outputPath(), name, options),\n step.group ? undefined : step.stepId\n );\n step.complete({});\n }\n\n _attach(attachment: TestInfo['attachments'][0], stepId: string | undefined) {\n const index = this._attachmentsPush(attachment) - 1;\n if (stepId) {\n this._stepMap.get(stepId)!.attachmentIndices.push(index);\n } else {\n const stepId = `attach@${createGuid()}`;\n this._tracing.appendBeforeActionForStep({ stepId, title: `Attach ${escapeWithQuotes(attachment.name, '\"')}`, category: 'test.attach', stack: [] });\n this._tracing.appendAfterActionForStep(stepId, undefined, [attachment]);\n }\n\n this._onAttach({\n testId: this.testId,\n name: attachment.name,\n contentType: attachment.contentType,\n path: attachment.path,\n body: attachment.body?.toString('base64'),\n stepId,\n });\n }\n\n outputPath(...pathSegments: string[]){\n const outputPath = this._getOutputPath(...pathSegments);\n fs.mkdirSync(this.outputDir, { recursive: true });\n return outputPath;\n }\n\n _getOutputPath(...pathSegments: string[]){\n const joinedPath = path.join(...pathSegments);\n const outputPath = getContainedPath(this.outputDir, joinedPath);\n if (outputPath)\n return outputPath;\n throw new Error(`The outputPath is not allowed outside of the parent directory. Please fix the defined path.\\n\\n\\toutputPath: ${joinedPath}`);\n }\n\n _fsSanitizedTestName() {\n const fullTitleWithoutSpec = this.titlePath.slice(1).join(' ');\n return sanitizeForFilePath(trimLongString(fullTitleWithoutSpec));\n }\n\n _resolveSnapshotPaths(kind: 'snapshot' | 'screenshot' | 'aria', name: string | string[] | undefined, updateSnapshotIndex: 'updateSnapshotIndex' | 'dontUpdateSnapshotIndex', anonymousExtension?: string) {\n // NOTE: snapshot path must not ever change for backwards compatibility!\n\n const snapshotNames = kind === 'aria' ? this._ariaSnapshotNames : this._snapshotNames;\n const defaultExtensions = { 'aria': '.aria.yml', 'screenshot': '.png', 'snapshot': '.txt' };\n const ariaAwareExtname = (filePath: string) => kind === 'aria' && filePath.endsWith('.aria.yml') ? '.aria.yml' : path.extname(filePath);\n\n let subPath: string;\n let ext: string;\n let relativeOutputPath: string;\n\n if (!name) {\n // Consider the use case below. We should save actual to different paths, so we use |nextAnonymousSnapshotIndex|.\n //\n // expect.toMatchSnapshot('a.png')\n // // noop\n // expect.toMatchSnapshot('a.png')\n const index = snapshotNames.lastAnonymousSnapshotIndex + 1;\n if (updateSnapshotIndex === 'updateSnapshotIndex')\n snapshotNames.lastAnonymousSnapshotIndex = index;\n const fullTitleWithoutSpec = [...this.titlePath.slice(1), index].join(' ');\n ext = anonymousExtension ?? defaultExtensions[kind];\n subPath = sanitizeFilePathBeforeExtension(trimLongString(fullTitleWithoutSpec) + ext, ext);\n // Trim the output file paths more aggressively to avoid hitting Windows filesystem limits.\n relativeOutputPath = sanitizeFilePathBeforeExtension(trimLongString(fullTitleWithoutSpec, windowsFilesystemFriendlyLength) + ext, ext);\n } else {\n if (Array.isArray(name)) {\n // We intentionally do not sanitize user-provided array of segments,\n // assuming it is a file system path.\n // See https://github.com/microsoft/playwright/pull/9156.\n subPath = path.join(...name);\n relativeOutputPath = path.join(...name);\n ext = ariaAwareExtname(subPath);\n } else {\n ext = ariaAwareExtname(name);\n subPath = sanitizeFilePathBeforeExtension(name, ext);\n // Trim the output file paths more aggressively to avoid hitting Windows filesystem limits.\n relativeOutputPath = sanitizeFilePathBeforeExtension(trimLongString(name, windowsFilesystemFriendlyLength), ext);\n }\n const index = (snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] || 0) + 1;\n if (updateSnapshotIndex === 'updateSnapshotIndex')\n snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] = index;\n if (index > 1)\n relativeOutputPath = addSuffixToFilePath(relativeOutputPath, `-${index - 1}`);\n }\n\n const absoluteSnapshotPath = this._applyPathTemplate(kind, subPath, ext);\n return { absoluteSnapshotPath, relativeOutputPath };\n }\n\n private _applyPathTemplate(kind: 'snapshot' | 'screenshot' | 'aria', relativePath: string, ext: string) {\n const legacyTemplate = '{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}';\n let template: string;\n if (kind === 'screenshot') {\n template = this._projectInternal.expect?.toHaveScreenshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || legacyTemplate;\n } else if (kind === 'aria') {\n const ariaDefaultTemplate = '{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}';\n template = this._projectInternal.expect?.toMatchAriaSnapshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || ariaDefaultTemplate;\n } else {\n template = this._projectInternal.snapshotPathTemplate || legacyTemplate;\n }\n\n const dir = path.dirname(relativePath);\n const name = path.basename(relativePath, ext);\n const relativeTestFilePath = path.relative(this.project.testDir, this._requireFile);\n const parsedRelativeTestFilePath = path.parse(relativeTestFilePath);\n const projectNamePathSegment = sanitizeForFilePath(this.project.name);\n\n const snapshotPath = template\n .replace(/\\{(.)?testDir\\}/g, '$1' + this.project.testDir)\n .replace(/\\{(.)?snapshotDir\\}/g, '$1' + this.project.snapshotDir)\n .replace(/\\{(.)?snapshotSuffix\\}/g, this.snapshotSuffix ? '$1' + this.snapshotSuffix : '')\n .replace(/\\{(.)?testFileDir\\}/g, '$1' + parsedRelativeTestFilePath.dir)\n .replace(/\\{(.)?platform\\}/g, '$1' + process.platform)\n .replace(/\\{(.)?projectName\\}/g, projectNamePathSegment ? '$1' + projectNamePathSegment : '')\n .replace(/\\{(.)?testName\\}/g, '$1' + this._fsSanitizedTestName())\n .replace(/\\{(.)?testFileName\\}/g, '$1' + parsedRelativeTestFilePath.base)\n .replace(/\\{(.)?testFilePath\\}/g, '$1' + relativeTestFilePath)\n .replace(/\\{(.)?arg\\}/g, '$1' + path.join(dir, name))\n .replace(/\\{(.)?ext\\}/g, ext ? '$1' + ext : '');\n\n return path.normalize(path.resolve(this._configInternal.configDir, snapshotPath));\n }\n\n snapshotPath(...name: string[]): string;\n snapshotPath(name: string, options: { kind: 'snapshot' | 'screenshot' | 'aria' }): string;\n snapshotPath(...args: any[]) {\n let name: string[] = args;\n let kind: 'snapshot' | 'screenshot' | 'aria' = 'snapshot';\n\n const options = args[args.length - 1];\n if (options && typeof options === 'object') {\n kind = options.kind ?? kind;\n name = args.slice(0, -1);\n }\n\n if (!['snapshot', 'screenshot', 'aria'].includes(kind))\n throw new Error(`testInfo.snapshotPath: unknown kind \"${kind}\", must be one of \"snapshot\", \"screenshot\" or \"aria\"`);\n\n // Assume a zero/single path segment corresponds to `toHaveScreenshot(name)`,\n // while multiple path segments correspond to `toHaveScreenshot([...name])`.\n return this._resolveSnapshotPaths(kind, name.length <= 1 ? name[0] : name, 'dontUpdateSnapshotIndex').absoluteSnapshotPath;\n }\n\n setTimeout(timeout: number) {\n this._timeoutManager.setTimeout(timeout);\n }\n}\n\nexport class TestStepInfoImpl implements TestStepInfo {\n annotations: TestAnnotation[] = [];\n\n private _testInfo: TestInfoImpl;\n private _stepId: string;\n private _title: string;\n private _parentStep?: TestStepInfoImpl;\n\n skip: (arg?: any, description?: string) => void;\n\n constructor(testInfo: TestInfoImpl, stepId: string, title: string, parentStep?: TestStepInfoImpl) {\n this._testInfo = testInfo;\n this._stepId = stepId;\n this._title = title;\n this._parentStep = parentStep;\n this.skip = wrapFunctionWithLocation((location: Location, ...args: unknown[]) => {\n // skip();\n // skip(condition: boolean, description: string);\n if (args.length > 0 && !args[0])\n return;\n const description = args[1] as (string|undefined);\n this.annotations.push({ type: 'skip', description, location });\n throw new StepSkipError(description);\n });\n }\n\n async _runStepBody<T>(skip: boolean, body: (step: TestStepInfo) => T | Promise<T>, location?: Location) {\n if (skip) {\n this.annotations.push({ type: 'skip', location });\n return undefined as T;\n }\n try {\n return await body(this);\n } catch (e) {\n if (e instanceof StepSkipError)\n return undefined as T;\n throw e;\n }\n }\n\n _attachToStep(attachment: TestInfo['attachments'][0]): void {\n this._testInfo._attach(attachment, this._stepId);\n }\n\n async attach(name: string, options?: { body?: string | Buffer; contentType?: string; path?: string; }): Promise<void> {\n this._attachToStep(await normalizeAndSaveAttachment(this._testInfo.outputPath(), name, options));\n }\n\n get titlePath(): string[] {\n const parent = this._parentStep ?? this._testInfo;\n return [...parent.titlePath, this._title];\n }\n}\n\nexport class TestSkipError extends Error {\n}\n\nexport class StepSkipError extends Error {\n}\n\nconst stepSymbol = Symbol('step');\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AAEjB,mBAAqI;AAErI,4BAAkE;AAClE,kBAAwL;AACxL,yBAA4B;AAC5B,IAAAA,eAA8B;AAC9B,uBAAyC;AAyClC,MAAM,aAAiC;AAAA,EAuF5C,YACE,gBACA,iBACA,cACA,MACA,OACA,aACA,WACA,UACA;AA5FF,SAAQ,iBAAgC,EAAE,4BAA4B,GAAG,wBAAwB,CAAC,EAAE;AACpG,SAAQ,qBAA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