@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,198 @@
|
|
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 gitCommitInfoPlugin_exports = {};
|
30
|
+
__export(gitCommitInfoPlugin_exports, {
|
31
|
+
addGitCommitInfoPlugin: () => addGitCommitInfoPlugin
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(gitCommitInfoPlugin_exports);
|
34
|
+
var fs = __toESM(require("fs"));
|
35
|
+
var import_utils = require("playwright-core/lib/utils");
|
36
|
+
const GIT_OPERATIONS_TIMEOUT_MS = 3e3;
|
37
|
+
const addGitCommitInfoPlugin = (fullConfig) => {
|
38
|
+
fullConfig.plugins.push({ factory: gitCommitInfoPlugin.bind(null, fullConfig) });
|
39
|
+
};
|
40
|
+
function print(s, ...args) {
|
41
|
+
console.log("GitCommitInfo: " + s, ...args);
|
42
|
+
}
|
43
|
+
function debug(s, ...args) {
|
44
|
+
if (!process.env.DEBUG_GIT_COMMIT_INFO)
|
45
|
+
return;
|
46
|
+
print(s, ...args);
|
47
|
+
}
|
48
|
+
const gitCommitInfoPlugin = (fullConfig) => {
|
49
|
+
return {
|
50
|
+
name: "playwright:git-commit-info",
|
51
|
+
setup: async (config, configDir) => {
|
52
|
+
const metadata = config.metadata;
|
53
|
+
const ci = await ciInfo();
|
54
|
+
if (!metadata.ci && ci) {
|
55
|
+
debug("ci info", ci);
|
56
|
+
metadata.ci = ci;
|
57
|
+
}
|
58
|
+
if (fullConfig.captureGitInfo?.commit || fullConfig.captureGitInfo?.commit === void 0 && ci) {
|
59
|
+
const git = await gitCommitInfo(configDir).catch((e) => print("failed to get git commit info", e));
|
60
|
+
if (git) {
|
61
|
+
debug("commit info", git);
|
62
|
+
metadata.gitCommit = git;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
if (fullConfig.captureGitInfo?.diff || fullConfig.captureGitInfo?.diff === void 0 && ci) {
|
66
|
+
const diffResult = await gitDiff(configDir, ci).catch((e) => print("failed to get git diff", e));
|
67
|
+
if (diffResult) {
|
68
|
+
debug(`diff length ${diffResult.length}`);
|
69
|
+
metadata.gitDiff = diffResult;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
};
|
74
|
+
};
|
75
|
+
async function ciInfo() {
|
76
|
+
if (process.env.GITHUB_ACTIONS) {
|
77
|
+
let pr;
|
78
|
+
try {
|
79
|
+
const json = JSON.parse(await fs.promises.readFile(process.env.GITHUB_EVENT_PATH, "utf8"));
|
80
|
+
pr = { title: json.pull_request.title, number: json.pull_request.number, baseHash: json.pull_request.base.sha };
|
81
|
+
} catch {
|
82
|
+
}
|
83
|
+
return {
|
84
|
+
commitHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/commit/${process.env.GITHUB_SHA}`,
|
85
|
+
commitHash: process.env.GITHUB_SHA,
|
86
|
+
prHref: pr ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/pull/${pr.number}` : void 0,
|
87
|
+
prTitle: pr?.title,
|
88
|
+
prBaseHash: pr?.baseHash,
|
89
|
+
buildHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
|
90
|
+
};
|
91
|
+
}
|
92
|
+
if (process.env.GITLAB_CI) {
|
93
|
+
return {
|
94
|
+
commitHref: `${process.env.CI_PROJECT_URL}/-/commit/${process.env.CI_COMMIT_SHA}`,
|
95
|
+
commitHash: process.env.CI_COMMIT_SHA,
|
96
|
+
buildHref: process.env.CI_JOB_URL,
|
97
|
+
branch: process.env.CI_COMMIT_REF_NAME
|
98
|
+
};
|
99
|
+
}
|
100
|
+
if (process.env.JENKINS_URL && process.env.BUILD_URL) {
|
101
|
+
return {
|
102
|
+
commitHref: process.env.BUILD_URL,
|
103
|
+
commitHash: process.env.GIT_COMMIT,
|
104
|
+
branch: process.env.GIT_BRANCH
|
105
|
+
};
|
106
|
+
}
|
107
|
+
}
|
108
|
+
async function gitCommitInfo(gitDir) {
|
109
|
+
const separator = `---786eec917292---`;
|
110
|
+
const tokens = [
|
111
|
+
"%H",
|
112
|
+
// commit hash
|
113
|
+
"%h",
|
114
|
+
// abbreviated commit hash
|
115
|
+
"%s",
|
116
|
+
// subject
|
117
|
+
"%B",
|
118
|
+
// raw body (unwrapped subject and body)
|
119
|
+
"%an",
|
120
|
+
// author name
|
121
|
+
"%ae",
|
122
|
+
// author email
|
123
|
+
"%at",
|
124
|
+
// author date, UNIX timestamp
|
125
|
+
"%cn",
|
126
|
+
// committer name
|
127
|
+
"%ce",
|
128
|
+
// committer email
|
129
|
+
"%ct",
|
130
|
+
// committer date, UNIX timestamp
|
131
|
+
""
|
132
|
+
// branch
|
133
|
+
];
|
134
|
+
const output = await runGit(`git log -1 --pretty=format:"${tokens.join(separator)}" && git rev-parse --abbrev-ref HEAD`, gitDir);
|
135
|
+
if (!output)
|
136
|
+
return void 0;
|
137
|
+
const [hash, shortHash, subject, body, authorName, authorEmail, authorTime, committerName, committerEmail, committerTime, branch] = output.split(separator);
|
138
|
+
return {
|
139
|
+
shortHash,
|
140
|
+
hash,
|
141
|
+
subject,
|
142
|
+
body,
|
143
|
+
author: {
|
144
|
+
name: authorName,
|
145
|
+
email: authorEmail,
|
146
|
+
time: +authorTime * 1e3
|
147
|
+
},
|
148
|
+
committer: {
|
149
|
+
name: committerName,
|
150
|
+
email: committerEmail,
|
151
|
+
time: +committerTime * 1e3
|
152
|
+
},
|
153
|
+
branch: branch.trim()
|
154
|
+
};
|
155
|
+
}
|
156
|
+
async function gitDiff(gitDir, ci) {
|
157
|
+
const diffLimit = 1e5;
|
158
|
+
if (ci?.prBaseHash) {
|
159
|
+
await runGit(`git fetch origin ${ci.prBaseHash} --depth=1 --no-auto-maintenance --no-auto-gc --no-tags --no-recurse-submodules`, gitDir);
|
160
|
+
const diff2 = await runGit(`git diff ${ci.prBaseHash} HEAD`, gitDir);
|
161
|
+
if (diff2)
|
162
|
+
return diff2.substring(0, diffLimit);
|
163
|
+
}
|
164
|
+
if (ci)
|
165
|
+
return;
|
166
|
+
const uncommitted = await runGit("git diff", gitDir);
|
167
|
+
if (uncommitted === void 0) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
if (uncommitted)
|
171
|
+
return uncommitted.substring(0, diffLimit);
|
172
|
+
const diff = await runGit("git diff HEAD~1", gitDir);
|
173
|
+
return diff?.substring(0, diffLimit);
|
174
|
+
}
|
175
|
+
async function runGit(command, cwd) {
|
176
|
+
debug(`running "${command}"`);
|
177
|
+
const start = (0, import_utils.monotonicTime)();
|
178
|
+
const result = await (0, import_utils.spawnAsync)(
|
179
|
+
command,
|
180
|
+
[],
|
181
|
+
{ stdio: "pipe", cwd, timeout: GIT_OPERATIONS_TIMEOUT_MS, shell: true }
|
182
|
+
);
|
183
|
+
if ((0, import_utils.monotonicTime)() - start > GIT_OPERATIONS_TIMEOUT_MS) {
|
184
|
+
print(`timeout of ${GIT_OPERATIONS_TIMEOUT_MS}ms exceeded while running "${command}"`);
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
if (result.code)
|
188
|
+
debug(`failure, code=${result.code}
|
189
|
+
|
190
|
+
${result.stderr}`);
|
191
|
+
else
|
192
|
+
debug(`success`);
|
193
|
+
return result.code ? void 0 : result.stdout.trim();
|
194
|
+
}
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
196
|
+
0 && (module.exports = {
|
197
|
+
addGitCommitInfoPlugin
|
198
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/plugins/gitCommitInfoPlugin.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 * as fs from 'fs';\n\nimport { monotonicTime, spawnAsync } from 'playwright-core/lib/utils';\n\nimport type { TestRunnerPlugin } from './';\nimport type { FullConfig } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { GitCommitInfo, CIInfo, MetadataWithCommitInfo } from '../isomorphic/types';\n\nconst GIT_OPERATIONS_TIMEOUT_MS = 3000;\n\nexport const addGitCommitInfoPlugin = (fullConfig: FullConfigInternal) => {\n fullConfig.plugins.push({ factory: gitCommitInfoPlugin.bind(null, fullConfig) });\n};\n\nfunction print(s: string, ...args: any[]) {\n // eslint-disable-next-line no-console\n console.log('GitCommitInfo: ' + s, ...args);\n}\n\nfunction debug(s: string, ...args: any[]) {\n if (!process.env.DEBUG_GIT_COMMIT_INFO)\n return;\n print(s, ...args);\n}\n\nconst gitCommitInfoPlugin = (fullConfig: FullConfigInternal): TestRunnerPlugin => {\n return {\n name: 'playwright:git-commit-info',\n\n setup: async (config: FullConfig, configDir: string) => {\n const metadata = config.metadata as MetadataWithCommitInfo;\n const ci = await ciInfo();\n if (!metadata.ci && ci) {\n debug('ci info', ci);\n metadata.ci = ci;\n }\n\n if (fullConfig.captureGitInfo?.commit || (fullConfig.captureGitInfo?.commit === undefined && ci)) {\n const git = await gitCommitInfo(configDir).catch(e => print('failed to get git commit info', e));\n if (git) {\n debug('commit info', git);\n metadata.gitCommit = git;\n }\n }\n\n if (fullConfig.captureGitInfo?.diff || (fullConfig.captureGitInfo?.diff === undefined && ci)) {\n const diffResult = await gitDiff(configDir, ci).catch(e => print('failed to get git diff', e));\n if (diffResult) {\n debug(`diff length ${diffResult.length}`);\n metadata.gitDiff = diffResult;\n }\n }\n },\n };\n};\n\nasync function ciInfo(): Promise<CIInfo | undefined> {\n if (process.env.GITHUB_ACTIONS) {\n let pr: { title: string, number: number, baseHash: string } | undefined;\n try {\n const json = JSON.parse(await fs.promises.readFile(process.env.GITHUB_EVENT_PATH!, 'utf8'));\n pr = { title: json.pull_request.title, number: json.pull_request.number, baseHash: json.pull_request.base.sha };\n } catch {\n }\n\n return {\n commitHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/commit/${process.env.GITHUB_SHA}`,\n commitHash: process.env.GITHUB_SHA,\n prHref: pr ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/pull/${pr.number}` : undefined,\n prTitle: pr?.title,\n prBaseHash: pr?.baseHash,\n buildHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,\n };\n }\n\n if (process.env.GITLAB_CI) {\n return {\n commitHref: `${process.env.CI_PROJECT_URL}/-/commit/${process.env.CI_COMMIT_SHA}`,\n commitHash: process.env.CI_COMMIT_SHA,\n buildHref: process.env.CI_JOB_URL,\n branch: process.env.CI_COMMIT_REF_NAME,\n };\n }\n\n if (process.env.JENKINS_URL && process.env.BUILD_URL) {\n return {\n commitHref: process.env.BUILD_URL,\n commitHash: process.env.GIT_COMMIT,\n branch: process.env.GIT_BRANCH,\n };\n }\n\n // Open to PRs.\n}\n\nasync function gitCommitInfo(gitDir: string): Promise<GitCommitInfo | undefined> {\n const separator = `---786eec917292---`;\n const tokens = [\n '%H', // commit hash\n '%h', // abbreviated commit hash\n '%s', // subject\n '%B', // raw body (unwrapped subject and body)\n '%an', // author name\n '%ae', // author email\n '%at', // author date, UNIX timestamp\n '%cn', // committer name\n '%ce', // committer email\n '%ct', // committer date, UNIX timestamp\n '', // branch\n ];\n const output = await runGit(`git log -1 --pretty=format:\"${tokens.join(separator)}\" && git rev-parse --abbrev-ref HEAD`, gitDir);\n if (!output)\n return undefined;\n const [hash, shortHash, subject, body, authorName, authorEmail, authorTime, committerName, committerEmail, committerTime, branch] = output.split(separator);\n\n return {\n shortHash,\n hash,\n subject,\n body,\n author: {\n name: authorName,\n email: authorEmail,\n time: +authorTime * 1000,\n },\n committer: {\n name: committerName,\n email: committerEmail,\n time: +committerTime * 1000,\n },\n branch: branch.trim(),\n };\n}\n\nasync function gitDiff(gitDir: string, ci?: CIInfo): Promise<string | undefined> {\n const diffLimit = 100_000;\n if (ci?.prBaseHash) {\n // https://git-scm.com/docs/git-fetch\n await runGit(`git fetch origin ${ci.prBaseHash} --depth=1 --no-auto-maintenance --no-auto-gc --no-tags --no-recurse-submodules`, gitDir);\n const diff = await runGit(`git diff ${ci.prBaseHash} HEAD`, gitDir);\n if (diff)\n return diff.substring(0, diffLimit);\n }\n\n // Do not attempt to diff on CI commit.\n if (ci)\n return;\n\n // Check dirty state first.\n const uncommitted = await runGit('git diff', gitDir);\n if (uncommitted === undefined) {\n // Failed to run git diff.\n return;\n }\n if (uncommitted)\n return uncommitted.substring(0, diffLimit);\n\n // Assume non-shallow checkout on local.\n const diff = await runGit('git diff HEAD~1', gitDir);\n return diff?.substring(0, diffLimit);\n}\n\nasync function runGit(command: string, cwd: string): Promise<string | undefined> {\n debug(`running \"${command}\"`);\n const start = monotonicTime();\n const result = await spawnAsync(\n command,\n [],\n { stdio: 'pipe', cwd, timeout: GIT_OPERATIONS_TIMEOUT_MS, shell: true }\n );\n if (monotonicTime() - start > GIT_OPERATIONS_TIMEOUT_MS) {\n print(`timeout of ${GIT_OPERATIONS_TIMEOUT_MS}ms exceeded while running \"${command}\"`);\n return;\n }\n if (result.code)\n debug(`failure, code=${result.code}\\n\\n${result.stderr}`);\n else\n debug(`success`);\n return result.code ? undefined : result.stdout.trim();\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,SAAoB;AAEpB,mBAA0C;AAO1C,MAAM,4BAA4B;AAE3B,MAAM,yBAAyB,CAAC,eAAmC;AACxE,aAAW,QAAQ,KAAK,EAAE,SAAS,oBAAoB,KAAK,MAAM,UAAU,EAAE,CAAC;AACjF;AAEA,SAAS,MAAM,MAAc,MAAa;AAExC,UAAQ,IAAI,oBAAoB,GAAG,GAAG,IAAI;AAC5C;AAEA,SAAS,MAAM,MAAc,MAAa;AACxC,MAAI,CAAC,QAAQ,IAAI;AACf;AACF,QAAM,GAAG,GAAG,IAAI;AAClB;AAEA,MAAM,sBAAsB,CAAC,eAAqD;AAChF,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,OAAO,OAAO,QAAoB,cAAsB;AACtD,YAAM,WAAW,OAAO;AACxB,YAAM,KAAK,MAAM,OAAO;AACxB,UAAI,CAAC,SAAS,MAAM,IAAI;AACtB,cAAM,WAAW,EAAE;AACnB,iBAAS,KAAK;AAAA,MAChB;AAEA,UAAI,WAAW,gBAAgB,UAAW,WAAW,gBAAgB,WAAW,UAAa,IAAK;AAChG,cAAM,MAAM,MAAM,cAAc,SAAS,EAAE,MAAM,OAAK,MAAM,iCAAiC,CAAC,CAAC;AAC/F,YAAI,KAAK;AACP,gBAAM,eAAe,GAAG;AACxB,mBAAS,YAAY;AAAA,QACvB;AAAA,MACF;AAEA,UAAI,WAAW,gBAAgB,QAAS,WAAW,gBAAgB,SAAS,UAAa,IAAK;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,MAAI;AACF,WAAO,YAAY,UAAU,GAAG,SAAS;AAG3C,QAAM,OAAO,MAAM,OAAO,mBAAmB,MAAM;AACnD,SAAO,MAAM,UAAU,GAAG,SAAS;AACrC;AAEA,eAAe,OAAO,SAAiB,KAA0C;AAC/E,QAAM,YAAY,OAAO,GAAG;AAC5B,QAAM,YAAQ,4BAAc;AAC5B,QAAM,SAAS,UAAM;AAAA,IACjB;AAAA,IACA,CAAC;AAAA,IACD,EAAE,OAAO,QAAQ,KAAK,SAAS,2BAA2B,OAAO,KAAK;AAAA,EAC1E;AACA,UAAI,4BAAc,IAAI,QAAQ,2BAA2B;AACvD,UAAM,cAAc,yBAAyB,8BAA8B,OAAO,GAAG;AACrF;AAAA,EACF;AACA,MAAI,OAAO;AACT,UAAM,iBAAiB,OAAO,IAAI;AAAA;AAAA,EAAO,OAAO,MAAM,EAAE;AAAA;AAExD,UAAM,SAAS;AACjB,SAAO,OAAO,OAAO,SAAY,OAAO,OAAO,KAAK;AACtD;",
|
6
|
+
"names": ["diff"]
|
7
|
+
}
|
@@ -0,0 +1,28 @@
|
|
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 plugins_exports = {};
|
20
|
+
__export(plugins_exports, {
|
21
|
+
webServer: () => import_webServerPlugin.webServer
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(plugins_exports);
|
24
|
+
var import_webServerPlugin = require("./webServerPlugin");
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
26
|
+
0 && (module.exports = {
|
27
|
+
webServer
|
28
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/plugins/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 type { FullConfig, Suite } from '../../types/testReporter';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\nexport interface TestRunnerPlugin {\n name: string;\n setup?(config: FullConfig, configDir: string, reporter: ReporterV2): Promise<void>;\n populateDependencies?(): Promise<void>;\n startDevServer?(): Promise<() => Promise<void>>;\n clearCache?(): Promise<void>;\n begin?(suite: Suite): Promise<void>;\n end?(): Promise<void>;\n teardown?(): Promise<void>;\n}\n\nexport type TestRunnerPluginRegistration = {\n factory: TestRunnerPlugin | (() => TestRunnerPlugin | Promise<TestRunnerPlugin>);\n instance?: TestRunnerPlugin;\n devServerCleanup?: any;\n};\n\nexport { webServer } from './webServerPlugin';\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,6BAA0B;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,209 @@
|
|
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 webServerPlugin_exports = {};
|
30
|
+
__export(webServerPlugin_exports, {
|
31
|
+
WebServerPlugin: () => WebServerPlugin,
|
32
|
+
webServer: () => webServer,
|
33
|
+
webServerPluginsForConfig: () => webServerPluginsForConfig
|
34
|
+
});
|
35
|
+
module.exports = __toCommonJS(webServerPlugin_exports);
|
36
|
+
var import_net = __toESM(require("net"));
|
37
|
+
var import_path = __toESM(require("path"));
|
38
|
+
var import_utils = require("playwright-core/lib/utils");
|
39
|
+
var import_utils2 = require("playwright-core/lib/utils");
|
40
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
41
|
+
const DEFAULT_ENVIRONMENT_VARIABLES = {
|
42
|
+
"BROWSER": "none",
|
43
|
+
// Disable that create-react-app will open the page in the browser
|
44
|
+
"FORCE_COLOR": "1",
|
45
|
+
"DEBUG_COLORS": "1"
|
46
|
+
};
|
47
|
+
const debugWebServer = (0, import_utilsBundle.debug)("pw:webserver");
|
48
|
+
class WebServerPlugin {
|
49
|
+
constructor(options, checkPortOnly) {
|
50
|
+
this.name = "playwright:webserver";
|
51
|
+
this._options = options;
|
52
|
+
this._checkPortOnly = checkPortOnly;
|
53
|
+
}
|
54
|
+
async setup(config, configDir, reporter) {
|
55
|
+
this._reporter = reporter;
|
56
|
+
this._isAvailableCallback = this._options.url ? getIsAvailableFunction(this._options.url, this._checkPortOnly, !!this._options.ignoreHTTPSErrors, this._reporter.onStdErr?.bind(this._reporter)) : void 0;
|
57
|
+
this._options.cwd = this._options.cwd ? import_path.default.resolve(configDir, this._options.cwd) : configDir;
|
58
|
+
try {
|
59
|
+
await this._startProcess();
|
60
|
+
await this._waitForProcess();
|
61
|
+
} catch (error) {
|
62
|
+
await this.teardown();
|
63
|
+
throw error;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
async teardown() {
|
67
|
+
debugWebServer(`Terminating the WebServer`);
|
68
|
+
await this._killProcess?.();
|
69
|
+
debugWebServer(`Terminated the WebServer`);
|
70
|
+
}
|
71
|
+
async _startProcess() {
|
72
|
+
let processExitedReject = (error) => {
|
73
|
+
};
|
74
|
+
this._processExitedPromise = new Promise((_, reject) => processExitedReject = reject);
|
75
|
+
const isAlreadyAvailable = await this._isAvailableCallback?.();
|
76
|
+
if (isAlreadyAvailable) {
|
77
|
+
debugWebServer(`WebServer is already available`);
|
78
|
+
if (this._options.reuseExistingServer)
|
79
|
+
return;
|
80
|
+
const port = new URL(this._options.url).port;
|
81
|
+
throw new Error(`${this._options.url ?? `http://localhost${port ? ":" + port : ""}`} is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.`);
|
82
|
+
}
|
83
|
+
if (!this._options.command)
|
84
|
+
throw new Error("config.webServer.command cannot be empty");
|
85
|
+
debugWebServer(`Starting WebServer process ${this._options.command}...`);
|
86
|
+
const { launchedProcess, gracefullyClose } = await (0, import_utils.launchProcess)({
|
87
|
+
command: this._options.command,
|
88
|
+
env: {
|
89
|
+
...DEFAULT_ENVIRONMENT_VARIABLES,
|
90
|
+
...process.env,
|
91
|
+
...this._options.env
|
92
|
+
},
|
93
|
+
cwd: this._options.cwd,
|
94
|
+
stdio: "stdin",
|
95
|
+
shell: true,
|
96
|
+
attemptToGracefullyClose: async () => {
|
97
|
+
if (process.platform === "win32")
|
98
|
+
throw new Error("Graceful shutdown is not supported on Windows");
|
99
|
+
if (!this._options.gracefulShutdown)
|
100
|
+
throw new Error("skip graceful shutdown");
|
101
|
+
const { signal, timeout = 0 } = this._options.gracefulShutdown;
|
102
|
+
process.kill(-launchedProcess.pid, signal);
|
103
|
+
return new Promise((resolve, reject) => {
|
104
|
+
const timer = timeout !== 0 ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout`)), timeout) : void 0;
|
105
|
+
launchedProcess.once("close", (...args) => {
|
106
|
+
clearTimeout(timer);
|
107
|
+
resolve();
|
108
|
+
});
|
109
|
+
});
|
110
|
+
},
|
111
|
+
log: () => {
|
112
|
+
},
|
113
|
+
onExit: (code) => processExitedReject(new Error(code ? `Process from config.webServer was not able to start. Exit code: ${code}` : "Process from config.webServer exited early.")),
|
114
|
+
tempDirectories: []
|
115
|
+
});
|
116
|
+
this._killProcess = gracefullyClose;
|
117
|
+
debugWebServer(`Process started`);
|
118
|
+
launchedProcess.stderr.on("data", (data) => {
|
119
|
+
if (debugWebServer.enabled || (this._options.stderr === "pipe" || !this._options.stderr))
|
120
|
+
this._reporter.onStdErr?.(prefixOutputLines(data.toString(), this._options.name));
|
121
|
+
});
|
122
|
+
launchedProcess.stdout.on("data", (data) => {
|
123
|
+
if (debugWebServer.enabled || this._options.stdout === "pipe")
|
124
|
+
this._reporter.onStdOut?.(prefixOutputLines(data.toString(), this._options.name));
|
125
|
+
});
|
126
|
+
}
|
127
|
+
async _waitForProcess() {
|
128
|
+
if (!this._isAvailableCallback) {
|
129
|
+
this._processExitedPromise.catch(() => {
|
130
|
+
});
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
debugWebServer(`Waiting for availability...`);
|
134
|
+
const launchTimeout = this._options.timeout || 60 * 1e3;
|
135
|
+
const cancellationToken = { canceled: false };
|
136
|
+
const { timedOut } = await Promise.race([
|
137
|
+
(0, import_utils.raceAgainstDeadline)(() => waitFor(this._isAvailableCallback, cancellationToken), (0, import_utils.monotonicTime)() + launchTimeout),
|
138
|
+
this._processExitedPromise
|
139
|
+
]);
|
140
|
+
cancellationToken.canceled = true;
|
141
|
+
if (timedOut)
|
142
|
+
throw new Error(`Timed out waiting ${launchTimeout}ms from config.webServer.`);
|
143
|
+
debugWebServer(`WebServer available`);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
async function isPortUsed(port) {
|
147
|
+
const innerIsPortUsed = (host) => new Promise((resolve) => {
|
148
|
+
const conn = import_net.default.connect(port, host).on("error", () => {
|
149
|
+
resolve(false);
|
150
|
+
}).on("connect", () => {
|
151
|
+
conn.end();
|
152
|
+
resolve(true);
|
153
|
+
});
|
154
|
+
});
|
155
|
+
return await innerIsPortUsed("127.0.0.1") || await innerIsPortUsed("::1");
|
156
|
+
}
|
157
|
+
async function waitFor(waitFn, cancellationToken) {
|
158
|
+
const logScale = [100, 250, 500];
|
159
|
+
while (!cancellationToken.canceled) {
|
160
|
+
const connected = await waitFn();
|
161
|
+
if (connected)
|
162
|
+
return;
|
163
|
+
const delay = logScale.shift() || 1e3;
|
164
|
+
debugWebServer(`Waiting ${delay}ms`);
|
165
|
+
await new Promise((x) => setTimeout(x, delay));
|
166
|
+
}
|
167
|
+
}
|
168
|
+
function getIsAvailableFunction(url, checkPortOnly, ignoreHTTPSErrors, onStdErr) {
|
169
|
+
const urlObject = new URL(url);
|
170
|
+
if (!checkPortOnly)
|
171
|
+
return () => (0, import_utils.isURLAvailable)(urlObject, ignoreHTTPSErrors, debugWebServer, onStdErr);
|
172
|
+
const port = urlObject.port;
|
173
|
+
return () => isPortUsed(+port);
|
174
|
+
}
|
175
|
+
const webServer = (options) => {
|
176
|
+
return new WebServerPlugin(options, false);
|
177
|
+
};
|
178
|
+
const webServerPluginsForConfig = (config) => {
|
179
|
+
const shouldSetBaseUrl = !!config.config.webServer;
|
180
|
+
const webServerPlugins = [];
|
181
|
+
for (const webServerConfig of config.webServers) {
|
182
|
+
if (webServerConfig.port && webServerConfig.url)
|
183
|
+
throw new Error(`Either 'port' or 'url' should be specified in config.webServer.`);
|
184
|
+
let url;
|
185
|
+
if (webServerConfig.port || webServerConfig.url) {
|
186
|
+
url = webServerConfig.url || `http://localhost:${webServerConfig.port}`;
|
187
|
+
if (shouldSetBaseUrl && !webServerConfig.url)
|
188
|
+
process.env.PLAYWRIGHT_TEST_BASE_URL = url;
|
189
|
+
}
|
190
|
+
webServerPlugins.push(new WebServerPlugin({ ...webServerConfig, url }, webServerConfig.port !== void 0));
|
191
|
+
}
|
192
|
+
return webServerPlugins;
|
193
|
+
};
|
194
|
+
function prefixOutputLines(output, prefixName = "WebServer") {
|
195
|
+
const lastIsNewLine = output[output.length - 1] === "\n";
|
196
|
+
let lines = output.split("\n");
|
197
|
+
if (lastIsNewLine)
|
198
|
+
lines.pop();
|
199
|
+
lines = lines.map((line) => import_utils2.colors.dim(`[${prefixName}] `) + line);
|
200
|
+
if (lastIsNewLine)
|
201
|
+
lines.push("");
|
202
|
+
return lines.join("\n");
|
203
|
+
}
|
204
|
+
// Annotate the CommonJS export names for ESM import in node:
|
205
|
+
0 && (module.exports = {
|
206
|
+
WebServerPlugin,
|
207
|
+
webServer,
|
208
|
+
webServerPluginsForConfig
|
209
|
+
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/plugins/webServerPlugin.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 */\nimport net from 'net';\nimport path from 'path';\n\nimport { launchProcess, isURLAvailable, monotonicTime, raceAgainstDeadline } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\nimport { debug } from 'playwright-core/lib/utilsBundle';\n\nimport type { TestRunnerPlugin } from '.';\nimport type { FullConfig } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\n\nexport type WebServerPluginOptions = {\n command: string;\n url?: string;\n ignoreHTTPSErrors?: boolean;\n timeout?: number;\n gracefulShutdown?: { signal: 'SIGINT' | 'SIGTERM', timeout?: number };\n reuseExistingServer?: boolean;\n cwd?: string;\n env?: { [key: string]: string; };\n stdout?: 'pipe' | 'ignore';\n stderr?: 'pipe' | 'ignore';\n name?: string;\n};\n\nconst DEFAULT_ENVIRONMENT_VARIABLES = {\n 'BROWSER': 'none', // Disable that create-react-app will open the page in the browser\n 'FORCE_COLOR': '1',\n 'DEBUG_COLORS': '1',\n};\n\nconst debugWebServer = debug('pw:webserver');\n\nexport class WebServerPlugin implements TestRunnerPlugin {\n private _isAvailableCallback?: () => Promise<boolean>;\n private _killProcess?: () => Promise<void>;\n private _processExitedPromise!: Promise<any>;\n private _options: WebServerPluginOptions;\n private _checkPortOnly: boolean;\n private _reporter?: ReporterV2;\n name = 'playwright:webserver';\n\n constructor(options: WebServerPluginOptions, checkPortOnly: boolean) {\n this._options = options;\n this._checkPortOnly = checkPortOnly;\n }\n\n public async setup(config: FullConfig, configDir: string, reporter: ReporterV2) {\n this._reporter = reporter;\n this._isAvailableCallback = this._options.url ? getIsAvailableFunction(this._options.url, this._checkPortOnly, !!this._options.ignoreHTTPSErrors, this._reporter.onStdErr?.bind(this._reporter)) : undefined;\n this._options.cwd = this._options.cwd ? path.resolve(configDir, this._options.cwd) : configDir;\n try {\n await this._startProcess();\n await this._waitForProcess();\n } catch (error) {\n await this.teardown();\n throw error;\n }\n }\n\n public async teardown() {\n debugWebServer(`Terminating the WebServer`);\n await this._killProcess?.();\n debugWebServer(`Terminated the WebServer`);\n }\n\n private async _startProcess(): Promise<void> {\n let processExitedReject = (error: Error) => { };\n this._processExitedPromise = new Promise((_, reject) => processExitedReject = reject);\n\n const isAlreadyAvailable = await this._isAvailableCallback?.();\n if (isAlreadyAvailable) {\n debugWebServer(`WebServer is already available`);\n if (this._options.reuseExistingServer)\n return;\n const port = new URL(this._options.url!).port;\n throw new Error(`${this._options.url ?? `http://localhost${port ? ':' + port : ''}`} is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.`);\n }\n\n if (!this._options.command)\n throw new Error('config.webServer.command cannot be empty');\n\n debugWebServer(`Starting WebServer process ${this._options.command}...`);\n const { launchedProcess, gracefullyClose } = await launchProcess({\n command: this._options.command,\n env: {\n ...DEFAULT_ENVIRONMENT_VARIABLES,\n ...process.env,\n ...this._options.env,\n },\n cwd: this._options.cwd,\n stdio: 'stdin',\n shell: true,\n attemptToGracefullyClose: async () => {\n if (process.platform === 'win32')\n throw new Error('Graceful shutdown is not supported on Windows');\n if (!this._options.gracefulShutdown)\n throw new Error('skip graceful shutdown');\n\n const { signal, timeout = 0 } = this._options.gracefulShutdown;\n\n // proper usage of SIGINT is to send it to the entire process group, see https://www.cons.org/cracauer/sigint.html\n // there's no such convention for SIGTERM, so we decide what we want. signaling the process group for consistency.\n process.kill(-launchedProcess.pid!, signal);\n\n return new Promise<void>((resolve, reject) => {\n const timer = timeout !== 0\n ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout`)), timeout)\n : undefined;\n launchedProcess.once('close', (...args) => {\n clearTimeout(timer);\n resolve();\n });\n });\n },\n log: () => {},\n onExit: code => processExitedReject(new Error(code ? `Process from config.webServer was not able to start. Exit code: ${code}` : 'Process from config.webServer exited early.')),\n tempDirectories: [],\n });\n this._killProcess = gracefullyClose;\n\n debugWebServer(`Process started`);\n\n launchedProcess.stderr!.on('data', data => {\n if (debugWebServer.enabled || (this._options.stderr === 'pipe' || !this._options.stderr))\n this._reporter!.onStdErr?.(prefixOutputLines(data.toString(), this._options.name));\n });\n launchedProcess.stdout!.on('data', data => {\n if (debugWebServer.enabled || this._options.stdout === 'pipe')\n this._reporter!.onStdOut?.(prefixOutputLines(data.toString(), this._options.name));\n });\n }\n\n private async _waitForProcess() {\n if (!this._isAvailableCallback) {\n this._processExitedPromise.catch(() => {});\n return;\n }\n debugWebServer(`Waiting for availability...`);\n const launchTimeout = this._options.timeout || 60 * 1000;\n const cancellationToken = { canceled: false };\n const { timedOut } = (await Promise.race([\n raceAgainstDeadline(() => waitFor(this._isAvailableCallback!, cancellationToken), monotonicTime() + launchTimeout),\n this._processExitedPromise,\n ]));\n cancellationToken.canceled = true;\n if (timedOut)\n throw new Error(`Timed out waiting ${launchTimeout}ms from config.webServer.`);\n debugWebServer(`WebServer available`);\n }\n}\n\nasync function isPortUsed(port: number): Promise<boolean> {\n const innerIsPortUsed = (host: string) => new Promise<boolean>(resolve => {\n const conn = net\n .connect(port, host)\n .on('error', () => {\n resolve(false);\n })\n .on('connect', () => {\n conn.end();\n resolve(true);\n });\n });\n return await innerIsPortUsed('127.0.0.1') || await innerIsPortUsed('::1');\n}\n\nasync function waitFor(waitFn: () => Promise<boolean>, cancellationToken: { canceled: boolean }) {\n const logScale = [100, 250, 500];\n while (!cancellationToken.canceled) {\n const connected = await waitFn();\n if (connected)\n return;\n const delay = logScale.shift() || 1000;\n debugWebServer(`Waiting ${delay}ms`);\n await new Promise(x => setTimeout(x, delay));\n }\n}\n\nfunction getIsAvailableFunction(url: string, checkPortOnly: boolean, ignoreHTTPSErrors: boolean, onStdErr: ReporterV2['onStdErr']) {\n const urlObject = new URL(url);\n if (!checkPortOnly)\n return () => isURLAvailable(urlObject, ignoreHTTPSErrors, debugWebServer, onStdErr);\n const port = urlObject.port;\n return () => isPortUsed(+port);\n}\n\nexport const webServer = (options: WebServerPluginOptions): TestRunnerPlugin => {\n return new WebServerPlugin(options, false);\n};\n\nexport const webServerPluginsForConfig = (config: FullConfigInternal): TestRunnerPlugin[] => {\n const shouldSetBaseUrl = !!config.config.webServer;\n const webServerPlugins = [];\n for (const webServerConfig of config.webServers) {\n if (webServerConfig.port && webServerConfig.url)\n throw new Error(`Either 'port' or 'url' should be specified in config.webServer.`);\n\n let url: string | undefined;\n if (webServerConfig.port || webServerConfig.url) {\n url = webServerConfig.url || `http://localhost:${webServerConfig.port}`;\n\n // We only set base url when only the port is given. That's a legacy mode we have regrets about.\n if (shouldSetBaseUrl && !webServerConfig.url)\n process.env.PLAYWRIGHT_TEST_BASE_URL = url;\n }\n webServerPlugins.push(new WebServerPlugin({ ...webServerConfig, url }, webServerConfig.port !== undefined));\n }\n\n return webServerPlugins;\n};\n\nfunction prefixOutputLines(output: string, prefixName: string = 'WebServer'): string {\n const lastIsNewLine = output[output.length - 1] === '\\n';\n let lines = output.split('\\n');\n if (lastIsNewLine)\n lines.pop();\n lines = lines.map(line => colors.dim(`[${prefixName}] `) + line);\n if (lastIsNewLine)\n lines.push('');\n return lines.join('\\n');\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,iBAAgB;AAChB,kBAAiB;AAEjB,mBAAkF;AAClF,IAAAA,gBA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