venetian 0.1.0-aarch64-linux
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.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +14 -0
- data/exe/aarch64-linux/LICENSE +2946 -0
- data/exe/aarch64-linux/node +0 -0
- data/exe/aarch64-linux/package/LICENSE +202 -0
- data/exe/aarch64-linux/package/NOTICE +5 -0
- data/exe/aarch64-linux/package/README.md +3 -0
- data/exe/aarch64-linux/package/ThirdPartyNotices.txt +13 -0
- data/exe/aarch64-linux/package/api.json +1 -0
- data/exe/aarch64-linux/package/bin/install_media_pack.ps1 +5 -0
- data/exe/aarch64-linux/package/bin/install_webkit_wsl.ps1 +33 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_linux.sh +42 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_mac.sh +13 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_win.ps1 +24 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_linux.sh +42 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_mac.sh +12 -0
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_win.ps1 +24 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_linux.sh +48 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_mac.sh +11 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_win.ps1 +23 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_linux.sh +48 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_mac.sh +11 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_win.ps1 +23 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_linux.sh +48 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_mac.sh +11 -0
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_win.ps1 +24 -0
- data/exe/aarch64-linux/package/browsers.json +81 -0
- data/exe/aarch64-linux/package/cli.js +21 -0
- data/exe/aarch64-linux/package/index.d.ts +17 -0
- data/exe/aarch64-linux/package/index.js +32 -0
- data/exe/aarch64-linux/package/index.mjs +28 -0
- data/exe/aarch64-linux/package/lib/bootstrap.js +77 -0
- data/exe/aarch64-linux/package/lib/coreBundle.js +69799 -0
- data/exe/aarch64-linux/package/lib/entry/cliDaemon.js +5 -0
- data/exe/aarch64-linux/package/lib/entry/dashboardApp.js +3 -0
- data/exe/aarch64-linux/package/lib/entry/mcp.js +10 -0
- data/exe/aarch64-linux/package/lib/entry/oopBrowserDownload.js +3 -0
- data/exe/aarch64-linux/package/lib/package.js +50 -0
- data/exe/aarch64-linux/package/lib/server/chromium/appIcon.png +0 -0
- data/exe/aarch64-linux/package/lib/server/deviceDescriptorsSource.json +1779 -0
- data/exe/aarch64-linux/package/lib/server/electron/loader.js +115 -0
- data/exe/aarch64-linux/package/lib/serverRegistry.js +7343 -0
- data/exe/aarch64-linux/package/lib/serverRegistry.js.LICENSE +354 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/channelSessions.js +141 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/cli.js +6 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/help.json +679 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/minimist.js +128 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/output.js +343 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/program.js +380 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/registry.js +176 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/session.js +265 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/SKILL.md +388 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/running-code.md +241 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/session-management.md +225 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/spec-driven-testing.md +305 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/test-generation.md +134 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/tracing.md +139 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
- data/exe/aarch64-linux/package/lib/tools/dashboard/appIcon.png +0 -0
- data/exe/aarch64-linux/package/lib/tools/trace/SKILL.md +171 -0
- data/exe/aarch64-linux/package/lib/tools/utils/extension.js +78 -0
- data/exe/aarch64-linux/package/lib/tools/utils/socketConnection.js +108 -0
- data/exe/aarch64-linux/package/lib/utilsBundle.js +85418 -0
- data/exe/aarch64-linux/package/lib/utilsBundle.js.LICENSE +2002 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-BY2S1tHT.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-DpEq2p62.js +52 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/index.html +29 -0
- data/exe/aarch64-linux/package/lib/vite/dashboard/playwright-logo.svg +24 -0
- data/exe/aarch64-linux/package/lib/vite/htmlReport/index.html +16 -0
- data/exe/aarch64-linux/package/lib/vite/htmlReport/report.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/htmlReport/report.js +72 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/codeMirrorModule-BHYmBp6h.js +32 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-4ZiSSCmn.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-DA10QRaq.js +193 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/index.html +29 -0
- data/exe/aarch64-linux/package/lib/vite/recorder/playwright-logo.svg +9 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/codeMirrorModule-Ds_H_9Yq.js +32 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-D31xz8zv.js +262 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/defaultSettingsView.BDKsFU3c.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.BCnMPevh.js +2 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.CzXZzn5A.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.html +44 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/manifest.webmanifest +16 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/playwright-logo.svg +9 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/snapshot.html +10 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/snapshot.v8KI4P3m.js +2 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/sw.bundle.js +5 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.C2Efnu2P.js +6 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.html +18 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- data/exe/aarch64-linux/package/lib/xdg-open +1066 -0
- data/exe/aarch64-linux/package/package.json +34 -0
- data/exe/aarch64-linux/package/protocol.yml +4884 -0
- data/exe/aarch64-linux/package/types/protocol.d.ts +24565 -0
- data/exe/aarch64-linux/package/types/structs.d.ts +45 -0
- data/exe/aarch64-linux/package/types/types.d.ts +24518 -0
- data/exe/playwright +11 -0
- data/lib/tasks/venetian.rake +11 -0
- data/lib/venetian/browser_installer.rb +26 -0
- data/lib/venetian/browser_runner_extensions.rb +17 -0
- data/lib/venetian/executable.rb +154 -0
- data/lib/venetian/gemspec.rb +7 -0
- data/lib/venetian/playwright_create_extensions.rb +11 -0
- data/lib/venetian/railtie.rb +9 -0
- data/lib/venetian/tasks.rb +3 -0
- data/lib/venetian/upstream.rb +45 -0
- data/lib/venetian/version.rb +5 -0
- data/lib/venetian.rb +29 -0
- metadata +185 -0
|
@@ -0,0 +1,128 @@
|
|
|
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 minimist_exports = {};
|
|
20
|
+
__export(minimist_exports, {
|
|
21
|
+
minimist: () => minimist
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(minimist_exports);
|
|
24
|
+
function minimist(args, opts) {
|
|
25
|
+
if (!opts)
|
|
26
|
+
opts = {};
|
|
27
|
+
const bools = {};
|
|
28
|
+
const strings = {};
|
|
29
|
+
for (const key of toArray(opts.boolean))
|
|
30
|
+
bools[key] = true;
|
|
31
|
+
for (const key of toArray(opts.string))
|
|
32
|
+
strings[key] = true;
|
|
33
|
+
const argv = { _: [] };
|
|
34
|
+
function setArg(key, val) {
|
|
35
|
+
if (argv[key] === void 0 || bools[key] || typeof argv[key] === "boolean")
|
|
36
|
+
argv[key] = val;
|
|
37
|
+
else if (Array.isArray(argv[key]))
|
|
38
|
+
argv[key].push(val);
|
|
39
|
+
else
|
|
40
|
+
argv[key] = [argv[key], val];
|
|
41
|
+
}
|
|
42
|
+
let notFlags = [];
|
|
43
|
+
const doubleDashIndex = args.indexOf("--");
|
|
44
|
+
if (doubleDashIndex !== -1) {
|
|
45
|
+
notFlags = args.slice(doubleDashIndex + 1);
|
|
46
|
+
args = args.slice(0, doubleDashIndex);
|
|
47
|
+
}
|
|
48
|
+
for (let i = 0; i < args.length; i++) {
|
|
49
|
+
const arg = args[i];
|
|
50
|
+
let key;
|
|
51
|
+
let next;
|
|
52
|
+
if (/^--.+=/.test(arg)) {
|
|
53
|
+
const m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
54
|
+
key = m[1];
|
|
55
|
+
if (bools[key])
|
|
56
|
+
throw new Error(`boolean option '--${key}' should not be passed with '=value', use '--${key}' or '--no-${key}' instead`);
|
|
57
|
+
setArg(key, m[2]);
|
|
58
|
+
} else if (/^--no-.+/.test(arg)) {
|
|
59
|
+
key = arg.match(/^--no-(.+)/)[1];
|
|
60
|
+
setArg(key, false);
|
|
61
|
+
} else if (/^--.+/.test(arg)) {
|
|
62
|
+
key = arg.match(/^--(.+)/)[1];
|
|
63
|
+
next = args[i + 1];
|
|
64
|
+
if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !bools[key]) {
|
|
65
|
+
setArg(key, next);
|
|
66
|
+
i += 1;
|
|
67
|
+
} else if (/^(true|false)$/.test(next)) {
|
|
68
|
+
setArg(key, next === "true");
|
|
69
|
+
i += 1;
|
|
70
|
+
} else {
|
|
71
|
+
setArg(key, strings[key] ? "" : true);
|
|
72
|
+
}
|
|
73
|
+
} else if (/^-[^-]+/.test(arg)) {
|
|
74
|
+
const letters = arg.slice(1, -1).split("");
|
|
75
|
+
let broken = false;
|
|
76
|
+
for (let j = 0; j < letters.length; j++) {
|
|
77
|
+
next = arg.slice(j + 2);
|
|
78
|
+
if (next === "-") {
|
|
79
|
+
setArg(letters[j], next);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
83
|
+
setArg(letters[j], next.slice(1));
|
|
84
|
+
broken = true;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
88
|
+
setArg(letters[j], next);
|
|
89
|
+
broken = true;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
93
|
+
setArg(letters[j], arg.slice(j + 2));
|
|
94
|
+
broken = true;
|
|
95
|
+
break;
|
|
96
|
+
} else {
|
|
97
|
+
setArg(letters[j], strings[letters[j]] ? "" : true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
key = arg.slice(-1)[0];
|
|
101
|
+
if (!broken && key !== "-") {
|
|
102
|
+
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !bools[key]) {
|
|
103
|
+
setArg(key, args[i + 1]);
|
|
104
|
+
i += 1;
|
|
105
|
+
} else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
106
|
+
setArg(key, args[i + 1] === "true");
|
|
107
|
+
i += 1;
|
|
108
|
+
} else {
|
|
109
|
+
setArg(key, strings[key] ? "" : true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
argv._.push(arg);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for (const k of notFlags)
|
|
117
|
+
argv._.push(k);
|
|
118
|
+
return argv;
|
|
119
|
+
}
|
|
120
|
+
function toArray(value) {
|
|
121
|
+
if (!value)
|
|
122
|
+
return [];
|
|
123
|
+
return Array.isArray(value) ? value : [value];
|
|
124
|
+
}
|
|
125
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
126
|
+
0 && (module.exports = {
|
|
127
|
+
minimist
|
|
128
|
+
});
|
|
@@ -0,0 +1,343 @@
|
|
|
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 output_exports = {};
|
|
30
|
+
__export(output_exports, {
|
|
31
|
+
JsonOutput: () => JsonOutput,
|
|
32
|
+
TextOutput: () => TextOutput
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(output_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_extension = require("../utils/extension");
|
|
37
|
+
class TextOutput {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.json = false;
|
|
40
|
+
}
|
|
41
|
+
version(v) {
|
|
42
|
+
console.log(v);
|
|
43
|
+
}
|
|
44
|
+
help(text) {
|
|
45
|
+
console.log(text);
|
|
46
|
+
}
|
|
47
|
+
errorUnknownCommand(name, globalHelp) {
|
|
48
|
+
console.error(`Unknown command: ${name}
|
|
49
|
+
`);
|
|
50
|
+
console.log(globalHelp);
|
|
51
|
+
return process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
errorUnknownOption(opts, commandHelp) {
|
|
54
|
+
console.error(`Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}`);
|
|
55
|
+
console.log("");
|
|
56
|
+
console.log(commandHelp);
|
|
57
|
+
return process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
errorTooManyArguments(expected, received, commandHelp) {
|
|
60
|
+
console.error(`error: too many arguments: expected ${expected}, received ${received}`);
|
|
61
|
+
console.log("");
|
|
62
|
+
console.log(commandHelp);
|
|
63
|
+
return process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
errorAttachConflict() {
|
|
66
|
+
console.error(`Error: cannot use target name with --cdp, --endpoint, or --extension`);
|
|
67
|
+
return process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
errorDetachNotAttached(session) {
|
|
70
|
+
console.error(`Error: session '${session}' was not attached; use \`playwright-cli${session !== "default" ? ` -s=${session}` : ""} close\` to stop it.`);
|
|
71
|
+
return process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
errorBrowserNotOpenForTool(session) {
|
|
74
|
+
console.log(`The browser '${session}' is not open, please run open first`);
|
|
75
|
+
console.log("");
|
|
76
|
+
console.log(` playwright-cli${session !== "default" ? ` -s=${session}` : ""} open [params]`);
|
|
77
|
+
return process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
errorAttachNoTarget() {
|
|
80
|
+
console.error(`Error: no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.`);
|
|
81
|
+
return process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
list({ all, browsers, servers, channelSessions }) {
|
|
84
|
+
const byWorkspace = /* @__PURE__ */ new Map();
|
|
85
|
+
for (const browser of browsers) {
|
|
86
|
+
let list = byWorkspace.get(browser.workspace);
|
|
87
|
+
if (!list) {
|
|
88
|
+
list = [];
|
|
89
|
+
byWorkspace.set(browser.workspace, list);
|
|
90
|
+
}
|
|
91
|
+
list.push(browser);
|
|
92
|
+
}
|
|
93
|
+
let count = 0;
|
|
94
|
+
for (const [workspaceKey, list] of byWorkspace) {
|
|
95
|
+
if (count === 0)
|
|
96
|
+
console.log("### Browsers");
|
|
97
|
+
if (all)
|
|
98
|
+
console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
|
|
99
|
+
for (const browser of list)
|
|
100
|
+
console.log(renderBrowser(browser));
|
|
101
|
+
count += list.length;
|
|
102
|
+
}
|
|
103
|
+
if (!all) {
|
|
104
|
+
if (!count)
|
|
105
|
+
console.log(" (no browsers)");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (servers?.length) {
|
|
109
|
+
if (count)
|
|
110
|
+
console.log("");
|
|
111
|
+
console.log("### Browser servers available for attach");
|
|
112
|
+
const serversByWorkspace = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const server of servers) {
|
|
114
|
+
let list = serversByWorkspace.get(server.workspaceDir ?? "");
|
|
115
|
+
if (!list) {
|
|
116
|
+
list = [];
|
|
117
|
+
serversByWorkspace.set(server.workspaceDir ?? "", list);
|
|
118
|
+
}
|
|
119
|
+
list.push(server);
|
|
120
|
+
}
|
|
121
|
+
for (const [workspaceKey, list] of serversByWorkspace) {
|
|
122
|
+
if (workspaceKey)
|
|
123
|
+
console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
|
|
124
|
+
for (const server of list)
|
|
125
|
+
console.log(renderServer(server));
|
|
126
|
+
}
|
|
127
|
+
count += servers.length;
|
|
128
|
+
}
|
|
129
|
+
if (!count)
|
|
130
|
+
console.log(" (no browsers)");
|
|
131
|
+
if (channelSessions?.length) {
|
|
132
|
+
console.log("");
|
|
133
|
+
console.log("### Browsers available to attach via CDP");
|
|
134
|
+
for (const session of channelSessions)
|
|
135
|
+
console.log(renderChannelSession(session));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
closeAll(_sessions) {
|
|
139
|
+
}
|
|
140
|
+
deleteData(session, result) {
|
|
141
|
+
if (!result.existed) {
|
|
142
|
+
console.log(`No user data found for browser '${session}'.`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (result.deletedUserDataDir)
|
|
146
|
+
console.log(`Deleted user data for browser '${session}'.`);
|
|
147
|
+
}
|
|
148
|
+
killAll(pids) {
|
|
149
|
+
for (const pid of pids)
|
|
150
|
+
console.log(`Killed daemon process ${pid}`);
|
|
151
|
+
if (pids.length === 0)
|
|
152
|
+
console.log("No daemon processes found.");
|
|
153
|
+
else
|
|
154
|
+
console.log(`Killed ${pids.length} daemon process${pids.length === 1 ? "" : "es"}.`);
|
|
155
|
+
}
|
|
156
|
+
open(session, pid, toolResult) {
|
|
157
|
+
console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
|
|
158
|
+
if (toolResult)
|
|
159
|
+
console.log(toolResult);
|
|
160
|
+
}
|
|
161
|
+
attach(session, pid, endpoint, toolResult) {
|
|
162
|
+
if (endpoint) {
|
|
163
|
+
console.log(`### Session \`${session}\` created, attached to \`${endpoint}\`.`);
|
|
164
|
+
console.log(`Run commands with: playwright-cli --s=${session} <command>`);
|
|
165
|
+
console.log("");
|
|
166
|
+
} else {
|
|
167
|
+
console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
|
|
168
|
+
}
|
|
169
|
+
if (toolResult)
|
|
170
|
+
console.log(toolResult);
|
|
171
|
+
}
|
|
172
|
+
close(session, wasOpen) {
|
|
173
|
+
if (!wasOpen) {
|
|
174
|
+
console.log(`Browser '${session}' is not open.`);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
console.log(`Browser '${session}' closed
|
|
178
|
+
`);
|
|
179
|
+
}
|
|
180
|
+
detach(session, wasAttached) {
|
|
181
|
+
if (!wasAttached) {
|
|
182
|
+
console.log(`Browser '${session}' is not attached.`);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
console.log(`Browser '${session}' detached
|
|
186
|
+
`);
|
|
187
|
+
}
|
|
188
|
+
installed() {
|
|
189
|
+
}
|
|
190
|
+
show(_session, pid) {
|
|
191
|
+
if (process.env.PWTEST_PRINT_DASHBOARD_PID_FOR_TEST)
|
|
192
|
+
console.log(`### Dashboard opened with pid ${pid}.`);
|
|
193
|
+
}
|
|
194
|
+
toolResult(text) {
|
|
195
|
+
console.log(text);
|
|
196
|
+
}
|
|
197
|
+
installStdio() {
|
|
198
|
+
return "inherit";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class JsonOutput {
|
|
202
|
+
constructor() {
|
|
203
|
+
this.json = true;
|
|
204
|
+
}
|
|
205
|
+
version(v) {
|
|
206
|
+
this._emit({ version: v });
|
|
207
|
+
}
|
|
208
|
+
help(text) {
|
|
209
|
+
this._emit({ help: text });
|
|
210
|
+
}
|
|
211
|
+
errorUnknownCommand(name, _globalHelp) {
|
|
212
|
+
this._emit({ isError: true, error: `Unknown command: ${name}` });
|
|
213
|
+
return process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
errorUnknownOption(opts, _commandHelp) {
|
|
216
|
+
this._emit({ isError: true, error: `Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}` });
|
|
217
|
+
return process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
errorTooManyArguments(expected, received, _commandHelp) {
|
|
220
|
+
this._emit({ isError: true, error: `error: too many arguments: expected ${expected}, received ${received}` });
|
|
221
|
+
return process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
errorAttachConflict() {
|
|
224
|
+
this._emit({ isError: true, error: `cannot use target name with --cdp, --endpoint, or --extension` });
|
|
225
|
+
return process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
errorDetachNotAttached(session) {
|
|
228
|
+
this._emit({ isError: true, error: `session '${session}' was not attached; use close to stop it.` });
|
|
229
|
+
return process.exit(1);
|
|
230
|
+
}
|
|
231
|
+
errorBrowserNotOpenForTool(session) {
|
|
232
|
+
this._emit({ isError: true, error: `The browser '${session}' is not open, please run open first` });
|
|
233
|
+
return process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
errorAttachNoTarget() {
|
|
236
|
+
this._emit({ isError: true, error: `no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.` });
|
|
237
|
+
return process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
list({ all, browsers, servers, channelSessions }) {
|
|
240
|
+
const payload = { browsers };
|
|
241
|
+
if (all) {
|
|
242
|
+
payload.servers = servers ?? [];
|
|
243
|
+
payload.channelSessions = channelSessions ?? [];
|
|
244
|
+
}
|
|
245
|
+
this._emit(payload);
|
|
246
|
+
}
|
|
247
|
+
closeAll(sessions) {
|
|
248
|
+
this._emit({ closed: sessions });
|
|
249
|
+
}
|
|
250
|
+
deleteData(session, result) {
|
|
251
|
+
this._emit({ session, deleted: result.existed });
|
|
252
|
+
}
|
|
253
|
+
killAll(pids) {
|
|
254
|
+
this._emit({ killed: pids.length, pids });
|
|
255
|
+
}
|
|
256
|
+
open(session, pid, toolResult) {
|
|
257
|
+
this._emit({ session, pid, result: parseJsonText(toolResult) });
|
|
258
|
+
}
|
|
259
|
+
attach(session, pid, endpoint, toolResult) {
|
|
260
|
+
this._emit({
|
|
261
|
+
session,
|
|
262
|
+
pid,
|
|
263
|
+
...endpoint ? { endpoint } : {},
|
|
264
|
+
result: parseJsonText(toolResult)
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
close(session, wasOpen) {
|
|
268
|
+
this._emit({ session, status: wasOpen ? "closed" : "not-open" });
|
|
269
|
+
}
|
|
270
|
+
detach(session, wasAttached) {
|
|
271
|
+
this._emit({ session, status: wasAttached ? "detached" : "not-attached" });
|
|
272
|
+
}
|
|
273
|
+
installed() {
|
|
274
|
+
this._emit({ installed: true });
|
|
275
|
+
}
|
|
276
|
+
show(session, pid) {
|
|
277
|
+
this._emit({ session, pid });
|
|
278
|
+
}
|
|
279
|
+
toolResult(text) {
|
|
280
|
+
console.log(text);
|
|
281
|
+
}
|
|
282
|
+
installStdio() {
|
|
283
|
+
return "ignore";
|
|
284
|
+
}
|
|
285
|
+
_emit(value) {
|
|
286
|
+
console.log(JSON.stringify(value, null, 2));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function parseJsonText(text) {
|
|
290
|
+
try {
|
|
291
|
+
return JSON.parse(text);
|
|
292
|
+
} catch {
|
|
293
|
+
return text;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function renderBrowser(browser) {
|
|
297
|
+
const lines = [`- ${browser.name}:`];
|
|
298
|
+
lines.push(` - status: ${browser.status}`);
|
|
299
|
+
if (browser.status === "open" && !browser.compatible)
|
|
300
|
+
lines.push(` - version: v${browser.version} [incompatible please re-open]`);
|
|
301
|
+
if (browser.browserType)
|
|
302
|
+
lines.push(` - browser-type: ${browser.browserType}${browser.attached ? " (attached)" : ""}`);
|
|
303
|
+
if (!browser.attached) {
|
|
304
|
+
if (browser.userDataDir === null)
|
|
305
|
+
lines.push(` - user-data-dir: <in-memory>`);
|
|
306
|
+
else
|
|
307
|
+
lines.push(` - user-data-dir: ${browser.userDataDir}`);
|
|
308
|
+
if (browser.headed !== void 0)
|
|
309
|
+
lines.push(` - headed: ${browser.headed}`);
|
|
310
|
+
}
|
|
311
|
+
return lines.join("\n");
|
|
312
|
+
}
|
|
313
|
+
function renderServer(server) {
|
|
314
|
+
const lines = [`- browser "${server.title}":`];
|
|
315
|
+
lines.push(` - browser: ${server.browser.browserName}`);
|
|
316
|
+
lines.push(` - version: v${server.playwrightVersion}`);
|
|
317
|
+
if (server.browser.userDataDir)
|
|
318
|
+
lines.push(` - data-dir: ${server.browser.userDataDir}`);
|
|
319
|
+
else
|
|
320
|
+
lines.push(` - data-dir: <in-memory>`);
|
|
321
|
+
lines.push(` - run \`playwright-cli attach "${server.title}"\` to attach`);
|
|
322
|
+
return lines.join("\n");
|
|
323
|
+
}
|
|
324
|
+
function renderChannelSession(session) {
|
|
325
|
+
const lines = [`- ${session.channel}:`];
|
|
326
|
+
lines.push(` - data-dir: ${session.userDataDir}`);
|
|
327
|
+
if (session.extensionInstalled)
|
|
328
|
+
lines.push(` - attach (extension): \`playwright-cli attach --extension=${session.channel}\``);
|
|
329
|
+
else
|
|
330
|
+
lines.push(` - attach (extension): install at ${import_extension.playwrightExtensionInstallUrl}`);
|
|
331
|
+
if (session.endpoint) {
|
|
332
|
+
lines.push(` - attach (remote debugging): \`playwright-cli attach --cdp=${session.channel}\``);
|
|
333
|
+
} else {
|
|
334
|
+
const inspectScheme = session.channel.startsWith("msedge") ? "edge" : "chrome";
|
|
335
|
+
lines.push(` - attach (remote debugging): enable at ${inspectScheme}://inspect/#remote-debugging`);
|
|
336
|
+
}
|
|
337
|
+
return lines.join("\n");
|
|
338
|
+
}
|
|
339
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
340
|
+
0 && (module.exports = {
|
|
341
|
+
JsonOutput,
|
|
342
|
+
TextOutput
|
|
343
|
+
});
|