@scoutqa/playwright 1.58.0-fork.1
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/ThirdPartyNotices.txt +3919 -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/agentParser.js +89 -0
- package/lib/agents/copilot-setup-steps.yml +34 -0
- package/lib/agents/generateAgents.js +348 -0
- package/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/lib/agents/playwright-test-generator.agent.md +88 -0
- package/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/lib/agents/playwright-test-healer.agent.md +55 -0
- package/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/lib/agents/playwright-test-planner.agent.md +73 -0
- package/lib/common/config.js +281 -0
- package/lib/common/configLoader.js +344 -0
- package/lib/common/esmLoaderHost.js +104 -0
- package/lib/common/expectBundle.js +43 -0
- package/lib/common/expectBundleImpl.js +407 -0
- package/lib/common/fixtures.js +302 -0
- package/lib/common/globals.js +58 -0
- package/lib/common/ipc.js +60 -0
- package/lib/common/poolBuilder.js +85 -0
- package/lib/common/process.js +132 -0
- package/lib/common/suiteUtils.js +140 -0
- package/lib/common/test.js +322 -0
- package/lib/common/testLoader.js +101 -0
- package/lib/common/testType.js +298 -0
- package/lib/common/validators.js +68 -0
- package/lib/fsWatcher.js +67 -0
- package/lib/index.js +721 -0
- package/lib/internalsForTest.js +42 -0
- package/lib/isomorphic/events.js +77 -0
- package/lib/isomorphic/folders.js +30 -0
- package/lib/isomorphic/stringInternPool.js +69 -0
- package/lib/isomorphic/teleReceiver.js +523 -0
- package/lib/isomorphic/teleSuiteUpdater.js +157 -0
- package/lib/isomorphic/testServerConnection.js +225 -0
- package/lib/isomorphic/testServerInterface.js +16 -0
- package/lib/isomorphic/testTree.js +329 -0
- package/lib/isomorphic/types.d.js +16 -0
- package/lib/loader/loaderMain.js +59 -0
- package/lib/matchers/expect.js +324 -0
- package/lib/matchers/matcherHint.js +87 -0
- package/lib/matchers/matchers.js +382 -0
- package/lib/matchers/toBeTruthy.js +73 -0
- package/lib/matchers/toEqual.js +99 -0
- package/lib/matchers/toHaveURL.js +102 -0
- package/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/lib/matchers/toMatchSnapshot.js +341 -0
- package/lib/matchers/toMatchText.js +99 -0
- package/lib/mcp/browser/actions.d.js +16 -0
- package/lib/mcp/browser/browserContextFactory.js +321 -0
- package/lib/mcp/browser/browserServerBackend.js +77 -0
- package/lib/mcp/browser/config.js +418 -0
- package/lib/mcp/browser/context.js +285 -0
- package/lib/mcp/browser/response.js +352 -0
- package/lib/mcp/browser/sessionLog.js +160 -0
- package/lib/mcp/browser/tab.js +328 -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 +59 -0
- package/lib/mcp/browser/tools/files.js +58 -0
- package/lib/mcp/browser/tools/form.js +63 -0
- package/lib/mcp/browser/tools/install.js +69 -0
- package/lib/mcp/browser/tools/keyboard.js +84 -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 +60 -0
- package/lib/mcp/browser/tools/pdf.js +48 -0
- package/lib/mcp/browser/tools/runCode.js +77 -0
- package/lib/mcp/browser/tools/screenshot.js +105 -0
- package/lib/mcp/browser/tools/snapshot.js +191 -0
- package/lib/mcp/browser/tools/tabs.js +67 -0
- package/lib/mcp/browser/tools/tool.js +50 -0
- package/lib/mcp/browser/tools/tracing.js +74 -0
- package/lib/mcp/browser/tools/utils.js +94 -0
- package/lib/mcp/browser/tools/verify.js +143 -0
- package/lib/mcp/browser/tools/wait.js +63 -0
- package/lib/mcp/browser/tools.js +82 -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 +76 -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 +93 -0
- package/lib/mcp/sdk/exports.js +28 -0
- package/lib/mcp/sdk/http.js +152 -0
- package/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/lib/mcp/sdk/server.js +207 -0
- package/lib/mcp/sdk/tool.js +47 -0
- package/lib/mcp/test/browserBackend.js +98 -0
- package/lib/mcp/test/generatorTools.js +122 -0
- package/lib/mcp/test/plannerTools.js +144 -0
- package/lib/mcp/test/seed.js +82 -0
- package/lib/mcp/test/streams.js +44 -0
- package/lib/mcp/test/testBackend.js +99 -0
- package/lib/mcp/test/testContext.js +279 -0
- package/lib/mcp/test/testTool.js +30 -0
- package/lib/mcp/test/testTools.js +108 -0
- package/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/lib/plugins/index.js +28 -0
- package/lib/plugins/webServerPlugin.js +237 -0
- package/lib/program.js +417 -0
- package/lib/reporters/base.js +609 -0
- package/lib/reporters/blob.js +139 -0
- package/lib/reporters/dot.js +82 -0
- package/lib/reporters/empty.js +32 -0
- package/lib/reporters/github.js +128 -0
- package/lib/reporters/html.js +623 -0
- package/lib/reporters/internalReporter.js +140 -0
- package/lib/reporters/json.js +255 -0
- package/lib/reporters/junit.js +232 -0
- package/lib/reporters/line.js +113 -0
- package/lib/reporters/list.js +231 -0
- package/lib/reporters/listModeReporter.js +69 -0
- package/lib/reporters/markdown.js +144 -0
- package/lib/reporters/merge.js +546 -0
- package/lib/reporters/multiplexer.js +112 -0
- package/lib/reporters/reporterV2.js +102 -0
- package/lib/reporters/teleEmitter.js +319 -0
- package/lib/reporters/versions/blobV1.js +16 -0
- package/lib/runner/dispatcher.js +533 -0
- package/lib/runner/failureTracker.js +72 -0
- package/lib/runner/lastRun.js +77 -0
- package/lib/runner/loadUtils.js +334 -0
- package/lib/runner/loaderHost.js +89 -0
- package/lib/runner/processHost.js +180 -0
- package/lib/runner/projectUtils.js +241 -0
- package/lib/runner/rebase.js +189 -0
- package/lib/runner/reporters.js +138 -0
- package/lib/runner/sigIntWatcher.js +96 -0
- package/lib/runner/storage.js +91 -0
- package/lib/runner/taskRunner.js +127 -0
- package/lib/runner/tasks.js +410 -0
- package/lib/runner/testGroups.js +125 -0
- package/lib/runner/testRunner.js +398 -0
- package/lib/runner/testServer.js +269 -0
- package/lib/runner/uiModeReporter.js +30 -0
- package/lib/runner/vcs.js +72 -0
- package/lib/runner/watchMode.js +396 -0
- package/lib/runner/workerHost.js +104 -0
- package/lib/third_party/pirates.js +62 -0
- package/lib/third_party/tsconfig-loader.js +103 -0
- package/lib/transform/babelBundle.js +43 -0
- package/lib/transform/babelBundleImpl.js +461 -0
- package/lib/transform/babelHighlightUtils.js +63 -0
- package/lib/transform/compilationCache.js +272 -0
- package/lib/transform/esmLoader.js +103 -0
- package/lib/transform/portTransport.js +67 -0
- package/lib/transform/transform.js +296 -0
- package/lib/util.js +403 -0
- package/lib/utilsBundle.js +43 -0
- package/lib/utilsBundleImpl.js +100 -0
- package/lib/worker/fixtureRunner.js +258 -0
- package/lib/worker/testInfo.js +557 -0
- package/lib/worker/testTracing.js +345 -0
- package/lib/worker/timeoutManager.js +174 -0
- package/lib/worker/util.js +31 -0
- package/lib/worker/workerMain.js +529 -0
- package/package.json +72 -0
- package/test.d.ts +18 -0
- package/test.js +24 -0
- package/test.mjs +34 -0
- package/types/test.d.ts +10277 -0
- package/types/testReporter.d.ts +827 -0
|
@@ -0,0 +1,269 @@
|
|
|
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 testServer_exports = {};
|
|
30
|
+
__export(testServer_exports, {
|
|
31
|
+
TestServerDispatcher: () => TestServerDispatcher,
|
|
32
|
+
runTestServer: () => runTestServer,
|
|
33
|
+
runUIMode: () => runUIMode
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(testServer_exports);
|
|
36
|
+
var import_util = __toESM(require("util"));
|
|
37
|
+
var import_server = require("playwright-core/lib/server");
|
|
38
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
39
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
40
|
+
var import_configLoader = require("../common/configLoader");
|
|
41
|
+
var import_list = __toESM(require("../reporters/list"));
|
|
42
|
+
var import_reporters = require("./reporters");
|
|
43
|
+
var import_sigIntWatcher = require("./sigIntWatcher");
|
|
44
|
+
var import_testRunner = require("./testRunner");
|
|
45
|
+
const originalDebugLog = import_utilsBundle.debug.log;
|
|
46
|
+
const originalStdoutWrite = process.stdout.write;
|
|
47
|
+
const originalStderrWrite = process.stderr.write;
|
|
48
|
+
const originalStdinIsTTY = process.stdin.isTTY;
|
|
49
|
+
class TestServer {
|
|
50
|
+
constructor(configLocation, configCLIOverrides) {
|
|
51
|
+
this._configLocation = configLocation;
|
|
52
|
+
this._configCLIOverrides = configCLIOverrides;
|
|
53
|
+
}
|
|
54
|
+
async start(options) {
|
|
55
|
+
this._dispatcher = new TestServerDispatcher(this._configLocation, this._configCLIOverrides);
|
|
56
|
+
return await (0, import_server.startTraceViewerServer)({ ...options, transport: this._dispatcher.transport });
|
|
57
|
+
}
|
|
58
|
+
async stop() {
|
|
59
|
+
await this._dispatcher?.stop();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class TestServerDispatcher {
|
|
63
|
+
constructor(configLocation, configCLIOverrides) {
|
|
64
|
+
this._serializer = require.resolve("./uiModeReporter");
|
|
65
|
+
this._closeOnDisconnect = false;
|
|
66
|
+
this._testRunner = new import_testRunner.TestRunner(configLocation, configCLIOverrides);
|
|
67
|
+
this.transport = {
|
|
68
|
+
onconnect: () => {
|
|
69
|
+
},
|
|
70
|
+
dispatch: (method, params) => this[method](params),
|
|
71
|
+
onclose: () => {
|
|
72
|
+
if (this._closeOnDisconnect)
|
|
73
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(0);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
this._dispatchEvent = (method, params) => this.transport.sendEvent?.(method, params);
|
|
77
|
+
this._testRunner.on(import_testRunner.TestRunnerEvent.TestFilesChanged, (testFiles) => this._dispatchEvent("testFilesChanged", { testFiles }));
|
|
78
|
+
this._testRunner.on(import_testRunner.TestRunnerEvent.TestPaused, (params) => this._dispatchEvent("testPaused", { errors: params.errors }));
|
|
79
|
+
}
|
|
80
|
+
async _wireReporter(messageSink) {
|
|
81
|
+
return await (0, import_reporters.createReporterForTestServer)(this._serializer, messageSink);
|
|
82
|
+
}
|
|
83
|
+
async _collectingReporter() {
|
|
84
|
+
const report = [];
|
|
85
|
+
return {
|
|
86
|
+
reporter: await (0, import_reporters.createReporterForTestServer)(this._serializer, (e) => report.push(e)),
|
|
87
|
+
report
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async initialize(params) {
|
|
91
|
+
this._serializer = params.serializer || require.resolve("./uiModeReporter");
|
|
92
|
+
this._closeOnDisconnect = !!params.closeOnDisconnect;
|
|
93
|
+
await this._testRunner.initialize({
|
|
94
|
+
...params
|
|
95
|
+
});
|
|
96
|
+
this._setInterceptStdio(!!params.interceptStdio);
|
|
97
|
+
}
|
|
98
|
+
async ping() {
|
|
99
|
+
}
|
|
100
|
+
async open(params) {
|
|
101
|
+
if ((0, import_utils.isUnderTest)())
|
|
102
|
+
return;
|
|
103
|
+
(0, import_utilsBundle.open)("vscode://file/" + params.location.file + ":" + params.location.line).catch((e) => console.error(e));
|
|
104
|
+
}
|
|
105
|
+
async resizeTerminal(params) {
|
|
106
|
+
this._testRunner.resizeTerminal(params);
|
|
107
|
+
}
|
|
108
|
+
async checkBrowsers() {
|
|
109
|
+
return { hasBrowsers: this._testRunner.hasSomeBrowsers() };
|
|
110
|
+
}
|
|
111
|
+
async installBrowsers() {
|
|
112
|
+
await this._testRunner.installBrowsers();
|
|
113
|
+
}
|
|
114
|
+
async runGlobalSetup(params) {
|
|
115
|
+
const { reporter, report } = await this._collectingReporter();
|
|
116
|
+
this._globalSetupReport = report;
|
|
117
|
+
const { status, env } = await this._testRunner.runGlobalSetup([reporter, new import_list.default()]);
|
|
118
|
+
return { report, status, env };
|
|
119
|
+
}
|
|
120
|
+
async runGlobalTeardown() {
|
|
121
|
+
const { status } = await this._testRunner.runGlobalTeardown();
|
|
122
|
+
const report = this._globalSetupReport || [];
|
|
123
|
+
this._globalSetupReport = void 0;
|
|
124
|
+
return { status, report };
|
|
125
|
+
}
|
|
126
|
+
async startDevServer(params) {
|
|
127
|
+
await this.stopDevServer({});
|
|
128
|
+
const { reporter, report } = await this._collectingReporter();
|
|
129
|
+
const { status } = await this._testRunner.startDevServer(reporter, "out-of-process");
|
|
130
|
+
return { report, status };
|
|
131
|
+
}
|
|
132
|
+
async stopDevServer(params) {
|
|
133
|
+
const { status } = await this._testRunner.stopDevServer();
|
|
134
|
+
const report = this._devServerReport || [];
|
|
135
|
+
this._devServerReport = void 0;
|
|
136
|
+
return { status, report };
|
|
137
|
+
}
|
|
138
|
+
async clearCache(params) {
|
|
139
|
+
await this._testRunner.clearCache();
|
|
140
|
+
}
|
|
141
|
+
async listFiles(params) {
|
|
142
|
+
const { reporter, report } = await this._collectingReporter();
|
|
143
|
+
const { status } = await this._testRunner.listFiles(reporter, params.projects);
|
|
144
|
+
return { report, status };
|
|
145
|
+
}
|
|
146
|
+
async listTests(params) {
|
|
147
|
+
const { reporter, report } = await this._collectingReporter();
|
|
148
|
+
const { status } = await this._testRunner.listTests(reporter, params);
|
|
149
|
+
return { report, status };
|
|
150
|
+
}
|
|
151
|
+
async runTests(params) {
|
|
152
|
+
const wireReporter = await this._wireReporter((e) => this._dispatchEvent("report", e));
|
|
153
|
+
const { status } = await this._testRunner.runTests(wireReporter, {
|
|
154
|
+
...params,
|
|
155
|
+
doNotRunDepsOutsideProjectFilter: true,
|
|
156
|
+
pauseAtEnd: params.pauseAtEnd,
|
|
157
|
+
pauseOnError: params.pauseOnError
|
|
158
|
+
});
|
|
159
|
+
return { status };
|
|
160
|
+
}
|
|
161
|
+
async watch(params) {
|
|
162
|
+
await this._testRunner.watch(params.fileNames);
|
|
163
|
+
}
|
|
164
|
+
async findRelatedTestFiles(params) {
|
|
165
|
+
return this._testRunner.findRelatedTestFiles(params.files);
|
|
166
|
+
}
|
|
167
|
+
async stopTests() {
|
|
168
|
+
await this._testRunner.stopTests();
|
|
169
|
+
}
|
|
170
|
+
async stop() {
|
|
171
|
+
this._setInterceptStdio(false);
|
|
172
|
+
await this._testRunner.stop();
|
|
173
|
+
}
|
|
174
|
+
async closeGracefully() {
|
|
175
|
+
await this._testRunner.closeGracefully();
|
|
176
|
+
}
|
|
177
|
+
_setInterceptStdio(interceptStdio) {
|
|
178
|
+
if (process.env.PWTEST_DEBUG)
|
|
179
|
+
return;
|
|
180
|
+
if (interceptStdio) {
|
|
181
|
+
if (import_utilsBundle.debug.log === originalDebugLog) {
|
|
182
|
+
import_utilsBundle.debug.log = (...args) => {
|
|
183
|
+
const string = import_util.default.format(...args) + "\n";
|
|
184
|
+
return originalStderrWrite.apply(process.stderr, [string]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const stdoutWrite = (chunk) => {
|
|
188
|
+
this._dispatchEvent("stdio", chunkToPayload("stdout", chunk));
|
|
189
|
+
return true;
|
|
190
|
+
};
|
|
191
|
+
const stderrWrite = (chunk) => {
|
|
192
|
+
this._dispatchEvent("stdio", chunkToPayload("stderr", chunk));
|
|
193
|
+
return true;
|
|
194
|
+
};
|
|
195
|
+
process.stdout.write = stdoutWrite;
|
|
196
|
+
process.stderr.write = stderrWrite;
|
|
197
|
+
process.stdin.isTTY = void 0;
|
|
198
|
+
} else {
|
|
199
|
+
import_utilsBundle.debug.log = originalDebugLog;
|
|
200
|
+
process.stdout.write = originalStdoutWrite;
|
|
201
|
+
process.stderr.write = originalStderrWrite;
|
|
202
|
+
process.stdin.isTTY = originalStdinIsTTY;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
async function runUIMode(configFile, configCLIOverrides, options) {
|
|
207
|
+
const configLocation = (0, import_configLoader.resolveConfigLocation)(configFile);
|
|
208
|
+
return await innerRunTestServer(configLocation, configCLIOverrides, options, async (server, cancelPromise) => {
|
|
209
|
+
await (0, import_server.installRootRedirect)(server, void 0, { ...options, webApp: "uiMode.html" });
|
|
210
|
+
if (options.host !== void 0 || options.port !== void 0) {
|
|
211
|
+
await (0, import_server.openTraceInBrowser)(server.urlPrefix("human-readable"));
|
|
212
|
+
} else {
|
|
213
|
+
const channel = await installedChromiumChannelForUI(configLocation, configCLIOverrides);
|
|
214
|
+
const page = await (0, import_server.openTraceViewerApp)(server.urlPrefix("precise"), "chromium", {
|
|
215
|
+
headless: (0, import_utils.isUnderTest)() && process.env.PWTEST_HEADED_FOR_TEST !== "1",
|
|
216
|
+
persistentContextOptions: {
|
|
217
|
+
handleSIGINT: false,
|
|
218
|
+
channel
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
page.on("close", () => cancelPromise.resolve());
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
async function installedChromiumChannelForUI(configLocation, configCLIOverrides) {
|
|
226
|
+
const config = await (0, import_configLoader.loadConfig)(configLocation, configCLIOverrides).catch((e) => null);
|
|
227
|
+
if (!config)
|
|
228
|
+
return void 0;
|
|
229
|
+
if (config.projects.some((p) => (!p.project.use.browserName || p.project.use.browserName === "chromium") && !p.project.use.channel))
|
|
230
|
+
return void 0;
|
|
231
|
+
for (const channel of ["chromium", "chrome", "msedge"]) {
|
|
232
|
+
if (config.projects.some((p) => p.project.use.channel === channel))
|
|
233
|
+
return channel;
|
|
234
|
+
}
|
|
235
|
+
return void 0;
|
|
236
|
+
}
|
|
237
|
+
async function runTestServer(configFile, configCLIOverrides, options) {
|
|
238
|
+
const configLocation = (0, import_configLoader.resolveConfigLocation)(configFile);
|
|
239
|
+
return await innerRunTestServer(configLocation, configCLIOverrides, options, async (server) => {
|
|
240
|
+
console.log("Listening on " + server.urlPrefix("precise").replace("http:", "ws:") + "/" + server.wsGuid());
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
async function innerRunTestServer(configLocation, configCLIOverrides, options, openUI) {
|
|
244
|
+
const testServer = new TestServer(configLocation, configCLIOverrides);
|
|
245
|
+
const cancelPromise = new import_utils.ManualPromise();
|
|
246
|
+
const sigintWatcher = new import_sigIntWatcher.SigIntWatcher();
|
|
247
|
+
process.stdin.on("close", () => (0, import_utils.gracefullyProcessExitDoNotHang)(0));
|
|
248
|
+
void sigintWatcher.promise().then(() => cancelPromise.resolve());
|
|
249
|
+
try {
|
|
250
|
+
const server = await testServer.start(options);
|
|
251
|
+
await openUI(server, cancelPromise);
|
|
252
|
+
await cancelPromise;
|
|
253
|
+
} finally {
|
|
254
|
+
await testServer.stop();
|
|
255
|
+
sigintWatcher.disarm();
|
|
256
|
+
}
|
|
257
|
+
return sigintWatcher.hadSignal() ? "interrupted" : "passed";
|
|
258
|
+
}
|
|
259
|
+
function chunkToPayload(type, chunk) {
|
|
260
|
+
if (chunk instanceof Uint8Array)
|
|
261
|
+
return { type, buffer: chunk.toString("base64") };
|
|
262
|
+
return { type, text: chunk };
|
|
263
|
+
}
|
|
264
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
265
|
+
0 && (module.exports = {
|
|
266
|
+
TestServerDispatcher,
|
|
267
|
+
runTestServer,
|
|
268
|
+
runUIMode
|
|
269
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var uiModeReporter_exports = {};
|
|
20
|
+
__export(uiModeReporter_exports, {
|
|
21
|
+
default: () => uiModeReporter_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(uiModeReporter_exports);
|
|
24
|
+
var import_teleEmitter = require("../reporters/teleEmitter");
|
|
25
|
+
class UIModeReporter extends import_teleEmitter.TeleReporterEmitter {
|
|
26
|
+
constructor(options) {
|
|
27
|
+
super(options._send, { omitBuffers: true });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var uiModeReporter_default = UIModeReporter;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 vcs_exports = {};
|
|
30
|
+
__export(vcs_exports, {
|
|
31
|
+
detectChangedTestFiles: () => detectChangedTestFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(vcs_exports);
|
|
34
|
+
var import_child_process = __toESM(require("child_process"));
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_compilationCache = require("../transform/compilationCache");
|
|
37
|
+
async function detectChangedTestFiles(baseCommit, configDir) {
|
|
38
|
+
function gitFileList(command) {
|
|
39
|
+
try {
|
|
40
|
+
return import_child_process.default.execSync(
|
|
41
|
+
`git ${command}`,
|
|
42
|
+
{ encoding: "utf-8", stdio: "pipe", cwd: configDir }
|
|
43
|
+
).split("\n").filter(Boolean);
|
|
44
|
+
} catch (_error) {
|
|
45
|
+
const error = _error;
|
|
46
|
+
const unknownRevision = error.output.some((line) => line?.includes("unknown revision"));
|
|
47
|
+
if (unknownRevision) {
|
|
48
|
+
const isShallowClone = import_child_process.default.execSync("git rev-parse --is-shallow-repository", { encoding: "utf-8", stdio: "pipe", cwd: configDir }).trim() === "true";
|
|
49
|
+
if (isShallowClone) {
|
|
50
|
+
throw new Error([
|
|
51
|
+
`The repository is a shallow clone and does not have '${baseCommit}' available locally.`,
|
|
52
|
+
`Note that GitHub Actions checkout is shallow by default: https://github.com/actions/checkout`
|
|
53
|
+
].join("\n"));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw new Error([
|
|
57
|
+
`Cannot detect changed files for --only-changed mode:`,
|
|
58
|
+
`git ${command}`,
|
|
59
|
+
"",
|
|
60
|
+
...error.output
|
|
61
|
+
].join("\n"));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const untrackedFiles = gitFileList(`ls-files --others --exclude-standard`).map((file) => import_path.default.join(configDir, file));
|
|
65
|
+
const [gitRoot] = gitFileList("rev-parse --show-toplevel");
|
|
66
|
+
const trackedFilesWithChanges = gitFileList(`diff ${baseCommit} --name-only`).map((file) => import_path.default.join(gitRoot, file));
|
|
67
|
+
return new Set((0, import_compilationCache.affectedTestFiles)([...untrackedFiles, ...trackedFilesWithChanges]));
|
|
68
|
+
}
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
detectChangedTestFiles
|
|
72
|
+
});
|