venetian 0.1.3-aarch64-linux → 0.2.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 +4 -4
- data/README.md +70 -1
- data/exe/aarch64-linux/node +0 -0
- data/exe/aarch64-linux/package/api.json +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_mac.sh +1 -1
- data/exe/aarch64-linux/package/browsers.json +14 -14
- data/exe/aarch64-linux/package/index.js +1 -16
- data/exe/aarch64-linux/package/lib/bootstrap.js +11 -0
- data/exe/aarch64-linux/package/lib/coreBundle.js +26319 -22732
- data/exe/aarch64-linux/package/lib/server/deviceDescriptorsSource.json +1142 -182
- data/exe/aarch64-linux/package/lib/serverRegistry.js +1 -1
- data/exe/aarch64-linux/package/lib/tools/cli-client/help.json +17 -3
- data/exe/aarch64-linux/package/lib/tools/cli-client/output.js +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/program.js +29 -5
- data/exe/aarch64-linux/package/lib/tools/cli-client/registry.js +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/session.js +6 -17
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/SKILL.md +16 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/spec-driven-testing.md +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/storage-state.md +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/video-recording.md +1 -1
- data/exe/aarch64-linux/package/lib/utilsBundle.js +2825 -1507
- data/exe/aarch64-linux/package/lib/utilsBundle.js.LICENSE +61 -7
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/{index-DpEq2p62.js → index-C_5TMfeg.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/dashboard/index.html +1 -1
- data/exe/aarch64-linux/package/lib/vite/htmlReport/report.js +3 -3
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/{codeMirrorModule-BHYmBp6h.js → codeMirrorModule-DeBYQozu.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/{index-DA10QRaq.js → index-Bq-mQf8S.js} +91 -91
- data/exe/aarch64-linux/package/lib/vite/recorder/index.html +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{codeMirrorModule-Ds_H_9Yq.js → codeMirrorModule-LEHpjmcn.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-BNmKHKpQ.js +264 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/{defaultSettingsView.BDKsFU3c.css → defaultSettingsView.CjdS-WJx.css} +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.DMMX1gXU.js +2 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.html +3 -3
- data/exe/aarch64-linux/package/lib/vite/traceViewer/sw.bundle.js +2 -2
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Ut8wwJNp.js +6 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.html +4 -4
- data/exe/aarch64-linux/package/package.json +1 -1
- data/exe/aarch64-linux/package/protocol.yml +153 -46
- data/exe/aarch64-linux/package/types/protocol.d.ts +95 -31
- data/exe/aarch64-linux/package/types/types.d.ts +478 -551
- data/lib/venetian/browser_installer.rb +20 -1
- data/lib/venetian/executable.rb +28 -11
- data/lib/venetian/railtie.rb +7 -0
- data/lib/venetian/system_test_case_extension.rb +43 -0
- data/lib/venetian/version.rb +2 -2
- data/lib/venetian.rb +4 -3
- metadata +14 -13
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-D31xz8zv.js +0 -262
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.BCnMPevh.js +0 -2
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Btcz36p_.css +0 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.C2Efnu2P.js +0 -6
|
@@ -7210,7 +7210,7 @@ var ServerRegistry = class extends import_events.EventEmitter {
|
|
|
7210
7210
|
return null;
|
|
7211
7211
|
}
|
|
7212
7212
|
_browsersDir() {
|
|
7213
|
-
return process.env.
|
|
7213
|
+
return process.env.PWTEST_SERVER_REGISTRY || registryDirectory;
|
|
7214
7214
|
}
|
|
7215
7215
|
_startWatcher() {
|
|
7216
7216
|
const dir = this._browsersDir();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"global": "Usage: playwright-cli <command> [args] [options]\nUsage: playwright-cli -s=<session> <command> [args] [options]\n\nCore:\n open [url] open the browser\n attach [name] attach to a running playwright browser\n close close the browser\n detach detach from an attached browser\n goto <url> navigate to a url\n type <text> type text into editable element\n click <target> [button] perform click on a web page\n dblclick <target> [button] perform double click on a web page\n fill <target> <text> fill text into editable element\n drag <startTarget> <endTarget> perform drag and drop between two elements\n drop <target> drop files or data onto an element\n hover <target> hover over element on page\n select <target> <val> select an option in a dropdown\n upload <file> upload one or multiple files\n check <target> check a checkbox or radio button\n uncheck <target> uncheck a checkbox or radio button\n snapshot [target] capture page snapshot to obtain element ref\n eval <func> [target] evaluate javascript expression on page or element\n dialog-accept [prompt] accept a dialog\n dialog-dismiss dismiss a dialog\n resize <w> <h> resize the browser window\n delete-data delete session data\n\nNavigation:\n go-back go back to the previous page\n go-forward go forward to the next page\n reload reload the current page\n\nKeyboard:\n press <key> press a key on the keyboard, `a`, `arrowleft`\n keydown <key> press a key down on the keyboard\n keyup <key> press a key up on the keyboard\n\nMouse:\n mousemove <x> <y> move mouse to a given position\n mousedown [button] press mouse down\n mouseup [button] press mouse up\n mousewheel <dx> <dy> scroll mouse wheel\n\nSave as:\n screenshot [target] screenshot of the current page or element\n pdf save page as pdf\n\nTabs:\n tab-list list all tabs\n tab-new [url] create a new tab\n tab-close [index] close a browser tab\n tab-select <index> select a browser tab\n\nStorage:\n state-load <filename> loads browser storage (authentication) state from a file\n state-save [filename] saves the current storage (authentication) state to a file\n cookie-list list all cookies (optionally filtered by domain/path)\n cookie-get <name> get a specific cookie by name\n cookie-set <name> <value> set a cookie with optional flags\n cookie-delete <name> delete a specific cookie\n cookie-clear clear all cookies\n localstorage-list list all localstorage key-value pairs\n localstorage-get <key> get a localstorage item by key\n localstorage-set <key> <value> set a localstorage item\n localstorage-delete <key> delete a localstorage item\n localstorage-clear clear all localstorage\n sessionstorage-list list all sessionstorage key-value pairs\n sessionstorage-get <key> get a sessionstorage item by key\n sessionstorage-set <key> <value> set a sessionstorage item\n sessionstorage-delete <key> delete a sessionstorage item\n sessionstorage-clear clear all sessionstorage\n\nNetwork:\n requests list all network requests since loading the page. each request is numbered for use with the `request` command.\n request <index> show full details (headers, body, response) of a single network request by its number from the `requests` command.\n request-headers <index> print only the request headers for a single network request by its number from the `requests` command.\n request-body <index> print only the request body for a single network request by its number from the `requests` command.\n response-headers <index> print only the response headers for a single network request by its number from the `requests` command.\n response-body <index> print the response body for a single network request by its number from the `requests` command. textual bodies are inlined; binary bodies are saved to a file and the path is printed.\n route <pattern> mock network requests matching a url pattern\n route-list list all active network routes\n unroute [pattern] remove routes matching a pattern (or all routes)\n network-state-set <state> set the browser network state to online or offline\n\nDevTools:\n console [min-level] list console messages\n run-code [code] run playwright code snippet\n tracing-start start trace recording\n tracing-stop stop trace recording\n video-start [filename] start video recording\n video-stop stop video recording\n video-chapter <title> add a chapter marker to the video recording\n show show playwright dashboard\n pause-at <location> run the test up to a specific location and pause there\n resume resume the test execution\n step-over step over the next call in the test\n generate-locator <target> generate a playwright locator for the given element\n highlight [target] show (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.\n\nInstall:\n install initialize workspace\n install-browser [browser] install browser\n\nBrowser sessions:\n list list browser sessions\n close-all close all browser sessions\n kill-all forcefully kill all browser sessions (for stale/zombie processes)\n\nGlobal options:\n --help [command] print help\n --json output response as JSON\n --raw output only the result value, without status and code\n --version print version",
|
|
2
|
+
"global": "Usage: playwright-cli <command> [args] [options]\nUsage: playwright-cli -s=<session> <command> [args] [options]\n\nCore:\n open [url] open the browser\n attach [name] attach to a running playwright browser\n close close the browser\n detach detach from an attached browser\n goto <url> navigate to a url\n type <text> type text into editable element\n click <target> [button] perform click on a web page\n dblclick <target> [button] perform double click on a web page\n fill <target> <text> fill text into editable element\n drag <startTarget> <endTarget> perform drag and drop between two elements\n drop <target> drop files or data onto an element\n hover <target> hover over element on page\n select <target> <val> select an option in a dropdown\n upload <file> upload one or multiple files\n check <target> check a checkbox or radio button\n uncheck <target> uncheck a checkbox or radio button\n snapshot [target] capture page snapshot to obtain element ref\n eval <func> [target] evaluate javascript expression on page or element\n dialog-accept [prompt] accept a dialog\n dialog-dismiss dismiss a dialog\n resize <w> <h> resize the browser window\n delete-data delete session data\n\nNavigation:\n go-back go back to the previous page\n go-forward go forward to the next page\n reload reload the current page\n\nKeyboard:\n press <key> press a key on the keyboard, `a`, `arrowleft`\n keydown <key> press a key down on the keyboard\n keyup <key> press a key up on the keyboard\n\nMouse:\n mousemove <x> <y> move mouse to a given position\n mousedown [button] press mouse down\n mouseup [button] press mouse up\n mousewheel <dx> <dy> scroll mouse wheel\n\nSave as:\n screenshot [target] screenshot of the current page or element\n pdf save page as pdf\n\nTabs:\n tab-list list all tabs\n tab-new [url] create a new tab\n tab-close [index] close a browser tab\n tab-select <index> select a browser tab\n\nStorage:\n state-load <filename> loads browser storage (authentication) state from a file\n state-save [filename] saves the current storage (authentication) state to a file\n cookie-list list all cookies (optionally filtered by domain/path)\n cookie-get <name> get a specific cookie by name\n cookie-set <name> <value> set a cookie with optional flags\n cookie-delete <name> delete a specific cookie\n cookie-clear clear all cookies\n localstorage-list list all localstorage key-value pairs\n localstorage-get <key> get a localstorage item by key\n localstorage-set <key> <value> set a localstorage item\n localstorage-delete <key> delete a localstorage item\n localstorage-clear clear all localstorage\n sessionstorage-list list all sessionstorage key-value pairs\n sessionstorage-get <key> get a sessionstorage item by key\n sessionstorage-set <key> <value> set a sessionstorage item\n sessionstorage-delete <key> delete a sessionstorage item\n sessionstorage-clear clear all sessionstorage\n\nNetwork:\n requests list all network requests since loading the page. each request is numbered for use with the `request` command.\n request <index> show full details (headers, body, response) of a single network request by its number from the `requests` command.\n request-headers <index> print only the request headers for a single network request by its number from the `requests` command.\n request-body <index> print only the request body for a single network request by its number from the `requests` command.\n response-headers <index> print only the response headers for a single network request by its number from the `requests` command.\n response-body <index> print the response body for a single network request by its number from the `requests` command. textual bodies are inlined; binary bodies are saved to a file and the path is printed.\n route <pattern> mock network requests matching a url pattern\n route-list list all active network routes\n unroute [pattern] remove routes matching a pattern (or all routes)\n network-state-set <state> set the browser network state to online or offline\n\nDevTools:\n console [min-level] list console messages\n run-code [code] run playwright code snippet\n tracing-start start trace recording\n tracing-stop stop trace recording\n video-start [filename] start video recording\n video-stop stop video recording\n video-chapter <title> add a chapter marker to the video recording\n video-show-actions annotate subsequent cli/mcp actions on the page with a callout that names the action and highlights the target element\n video-hide-actions stop annotating actions performed on the page\n show show playwright dashboard\n pause-at <location> run the test up to a specific location and pause there\n resume resume the test execution\n step-over step over the next call in the test\n generate-locator <target> generate a playwright locator for the given element\n highlight [target] show (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.\n\nInstall:\n install initialize workspace\n install-browser [browser] install browser\n\nBrowser sessions:\n list list browser sessions\n close-all close all browser sessions\n kill-all forcefully kill all browser sessions (for stale/zombie processes)\n\nGlobal options:\n --help [command] print help\n --json output response as JSON\n --raw output only the result value, without status and code\n --version print version",
|
|
3
3
|
"commands": {
|
|
4
4
|
"open": {
|
|
5
5
|
"help": "playwright-cli open [url]\n\nOpen the browser\n\nArguments:\n [url] the url to navigate to\nOptions:\n --browser browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.\n --config path to the configuration file, defaults to .playwright/cli.config.json\n --headed run browser in headed mode\n --persistent use persistent browser profile\n --profile path to a persistent user data directory.",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"click": {
|
|
57
|
-
"help": "playwright-cli click <target> [button]\n\nPerform click on a web page\n\nArguments:\n <target> exact target element reference from the page snapshot, or a unique element selector\n [button] button to click, defaults to left\nOptions:\n --modifiers modifier
|
|
57
|
+
"help": "playwright-cli click <target> [button]\n\nPerform click on a web page\n\nArguments:\n <target> exact target element reference from the page snapshot, or a unique element selector\n [button] button to click, defaults to left\nOptions:\n --modifiers modifier key to press (repeatable)",
|
|
58
58
|
"flags": {
|
|
59
59
|
"modifiers": "string"
|
|
60
60
|
},
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dblclick": {
|
|
67
|
-
"help": "playwright-cli dblclick <target> [button]\n\nPerform double click on a web page\n\nArguments:\n <target> exact target element reference from the page snapshot, or a unique element selector\n [button] button to click, defaults to left\nOptions:\n --modifiers modifier
|
|
67
|
+
"help": "playwright-cli dblclick <target> [button]\n\nPerform double click on a web page\n\nArguments:\n <target> exact target element reference from the page snapshot, or a unique element selector\n [button] button to click, defaults to left\nOptions:\n --modifiers modifier key to press (repeatable)",
|
|
68
68
|
"flags": {
|
|
69
69
|
"modifiers": "string"
|
|
70
70
|
},
|
|
@@ -587,6 +587,20 @@
|
|
|
587
587
|
"title"
|
|
588
588
|
]
|
|
589
589
|
},
|
|
590
|
+
"video-show-actions": {
|
|
591
|
+
"help": "playwright-cli video-show-actions \n\nAnnotate subsequent CLI/MCP actions on the page with a callout that names the action and highlights the target element\n\nOptions:\n --duration how long each action annotation stays on screen, in milliseconds. defaults to 500.\n --position where to place the action title: top-left, top, top-right, bottom-left, bottom, bottom-right. defaults to top-right.\n --cursor cursor decoration: \"pointer\" (default) animates a mouse pointer between action points; \"none\" disables it.",
|
|
592
|
+
"flags": {
|
|
593
|
+
"duration": "string",
|
|
594
|
+
"position": "string",
|
|
595
|
+
"cursor": "string"
|
|
596
|
+
},
|
|
597
|
+
"args": []
|
|
598
|
+
},
|
|
599
|
+
"video-hide-actions": {
|
|
600
|
+
"help": "playwright-cli video-hide-actions \n\nStop annotating actions performed on the page\n",
|
|
601
|
+
"flags": {},
|
|
602
|
+
"args": []
|
|
603
|
+
},
|
|
590
604
|
"show": {
|
|
591
605
|
"help": "playwright-cli show \n\nShow Playwright Dashboard\n\nOptions:\n --port start as a blocking http server on this port (use 0 for a random port)\n --host host to bind to when using --port (defaults to localhost)\n --annotate switch the dashboard into annotation mode.\n --kill kill the dashboard daemon.",
|
|
592
606
|
"flags": {
|
|
@@ -63,7 +63,7 @@ class TextOutput {
|
|
|
63
63
|
return process.exit(1);
|
|
64
64
|
}
|
|
65
65
|
errorAttachConflict() {
|
|
66
|
-
console.error(`Error:
|
|
66
|
+
console.error(`Error: only one of [name], --cdp, --endpoint, or --extension can be specified`);
|
|
67
67
|
return process.exit(1);
|
|
68
68
|
}
|
|
69
69
|
errorDetachNotAttached(session) {
|
|
@@ -221,7 +221,7 @@ class JsonOutput {
|
|
|
221
221
|
return process.exit(1);
|
|
222
222
|
}
|
|
223
223
|
errorAttachConflict() {
|
|
224
|
-
this._emit({ isError: true, error: `
|
|
224
|
+
this._emit({ isError: true, error: `only one of [name], --cdp, --endpoint, or --extension can be specified` });
|
|
225
225
|
return process.exit(1);
|
|
226
226
|
}
|
|
227
227
|
errorDetachNotAttached(session) {
|
|
@@ -131,7 +131,8 @@ async function program(options) {
|
|
|
131
131
|
}
|
|
132
132
|
case "attach": {
|
|
133
133
|
const attachTarget = args._[1];
|
|
134
|
-
|
|
134
|
+
const targetCount = (attachTarget ? 1 : 0) + (args.cdp ? 1 : 0) + (args.endpoint ? 1 : 0) + (args.extension ? 1 : 0);
|
|
135
|
+
if (targetCount > 1)
|
|
135
136
|
output.errorAttachConflict();
|
|
136
137
|
if (attachTarget)
|
|
137
138
|
args.endpoint = attachTarget;
|
|
@@ -141,7 +142,7 @@ async function program(options) {
|
|
|
141
142
|
args.extension = true;
|
|
142
143
|
}
|
|
143
144
|
const cdpChannel = typeof args.cdp === "string" && (0, import_channelSessions.isKnownChannel)(args.cdp) ? args.cdp : void 0;
|
|
144
|
-
const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.cdp;
|
|
145
|
+
const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.endpoint ?? args.cdp;
|
|
145
146
|
if (!targetName)
|
|
146
147
|
output.errorAttachNoTarget();
|
|
147
148
|
const attachSessionName = (0, import_registry.explicitSessionName)(args.session) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
|
|
@@ -178,9 +179,11 @@ async function program(options) {
|
|
|
178
179
|
const daemonScript = (0, import_package.libPath)("entry", "dashboardApp.js");
|
|
179
180
|
const daemonArgs = [
|
|
180
181
|
daemonScript,
|
|
181
|
-
`--sessionName=${sessionName}`,
|
|
182
182
|
`--workspaceDir=${clientInfo.workspaceDir ?? ""}`
|
|
183
183
|
];
|
|
184
|
+
const explicit = (0, import_registry.explicitSessionName)(args.session);
|
|
185
|
+
if (explicit)
|
|
186
|
+
daemonArgs.push(`--sessionName=${explicit}`);
|
|
184
187
|
if (args.port !== void 0)
|
|
185
188
|
daemonArgs.push(`--port=${args.port}`);
|
|
186
189
|
if (args.host !== void 0)
|
|
@@ -203,14 +206,35 @@ async function program(options) {
|
|
|
203
206
|
const foreground = args.port !== void 0;
|
|
204
207
|
const child = (0, import_child_process.spawn)(process.execPath, daemonArgs, {
|
|
205
208
|
detached: !foreground,
|
|
206
|
-
stdio: foreground ? "inherit" : "ignore"
|
|
209
|
+
stdio: foreground ? "inherit" : ["pipe", "pipe", "ignore"]
|
|
207
210
|
});
|
|
208
211
|
if (foreground) {
|
|
209
212
|
await new Promise((resolve) => child.on("exit", () => resolve()));
|
|
210
213
|
return;
|
|
211
214
|
}
|
|
215
|
+
const timer = setTimeout(() => child.stdin.destroy(), 6e4);
|
|
212
216
|
child.unref();
|
|
213
|
-
|
|
217
|
+
let daemonPid;
|
|
218
|
+
try {
|
|
219
|
+
await new Promise((resolve, reject) => {
|
|
220
|
+
let outLog = "";
|
|
221
|
+
child.stdout.on("data", (data) => {
|
|
222
|
+
outLog += data.toString();
|
|
223
|
+
const match = outLog.match(/Dashboard is running pid=(\d+)/);
|
|
224
|
+
if (match) {
|
|
225
|
+
daemonPid = Number(match[1]);
|
|
226
|
+
resolve();
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
child.once("exit", (code, signal) => reject(new Error(`Dashboard daemon exited (code=${code}, signal=${signal}) before signaling READY${outLog ? "\n" + outLog : ""}`)));
|
|
230
|
+
});
|
|
231
|
+
} finally {
|
|
232
|
+
clearTimeout(timer);
|
|
233
|
+
child.removeAllListeners("exit");
|
|
234
|
+
child.stdin.destroy();
|
|
235
|
+
child.stdout.destroy();
|
|
236
|
+
}
|
|
237
|
+
output.show(sessionName, daemonPid);
|
|
214
238
|
return;
|
|
215
239
|
}
|
|
216
240
|
default: {
|
|
@@ -117,8 +117,8 @@ class Registry {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
const baseDaemonDir = (() => {
|
|
120
|
-
if (process.env.
|
|
121
|
-
return process.env.
|
|
120
|
+
if (process.env.PWTEST_DAEMON_SESSION_DIR)
|
|
121
|
+
return process.env.PWTEST_DAEMON_SESSION_DIR;
|
|
122
122
|
let localCacheDir;
|
|
123
123
|
if (process.platform === "linux")
|
|
124
124
|
localCacheDir = process.env.XDG_CACHE_HOME || import_path.default.join(import_os.default.homedir(), ".cache");
|
|
@@ -130,8 +130,6 @@ to start the browser session.`);
|
|
|
130
130
|
];
|
|
131
131
|
if (cliArgs.headed)
|
|
132
132
|
args.push("--headed");
|
|
133
|
-
if (cliArgs.extension)
|
|
134
|
-
args.push("--extension");
|
|
135
133
|
if (cliArgs.browser)
|
|
136
134
|
args.push(`--browser=${cliArgs.browser}`);
|
|
137
135
|
if (cliArgs.persistent)
|
|
@@ -140,12 +138,12 @@ to start the browser session.`);
|
|
|
140
138
|
args.push(`--profile=${cliArgs.profile}`);
|
|
141
139
|
if (cliArgs.config)
|
|
142
140
|
args.push(`--config=${cliArgs.config}`);
|
|
143
|
-
if (cliArgs.
|
|
141
|
+
if (cliArgs.extension)
|
|
142
|
+
args.push("--extension");
|
|
143
|
+
else if (cliArgs.cdp)
|
|
144
144
|
args.push(`--cdp=${cliArgs.cdp}`);
|
|
145
|
-
if (cliArgs.endpoint)
|
|
145
|
+
else if (cliArgs.endpoint)
|
|
146
146
|
args.push(`--endpoint=${cliArgs.endpoint}`);
|
|
147
|
-
else if (mode === "attach" && process.env.PLAYWRIGHT_CLI_SESSION)
|
|
148
|
-
args.push(`--endpoint=${process.env.PLAYWRIGHT_CLI_SESSION}`);
|
|
149
147
|
const child = (0, import_child_process.spawn)(process.execPath, args, {
|
|
150
148
|
detached: true,
|
|
151
149
|
stdio: ["ignore", "pipe", err],
|
|
@@ -168,22 +166,13 @@ to start the browser session.`);
|
|
|
168
166
|
await new Promise((resolve, reject) => {
|
|
169
167
|
child.stdout.on("data", (data) => {
|
|
170
168
|
outLog += data.toString();
|
|
171
|
-
if (
|
|
172
|
-
return;
|
|
173
|
-
const errorMatch = outLog.match(/### Error\n([\s\S]*)<EOF>/);
|
|
174
|
-
const error = errorMatch ? errorMatch[1].trim() : void 0;
|
|
175
|
-
if (error) {
|
|
176
|
-
const errLogContent = import_fs.default.readFileSync(errLog, "utf-8");
|
|
177
|
-
rejectWithPid(reject, error + (errLogContent ? "\n" + errLogContent : ""));
|
|
178
|
-
}
|
|
179
|
-
const successMatch = outLog.match(/### Success\nDaemon listening on (.*)\n<EOF>/);
|
|
180
|
-
if (successMatch)
|
|
169
|
+
if (outLog.includes("Daemon listening on"))
|
|
181
170
|
resolve();
|
|
182
171
|
});
|
|
183
172
|
child.on("close", (code) => {
|
|
184
173
|
if (!signalled) {
|
|
185
174
|
const errLogContent = import_fs.default.readFileSync(errLog, "utf-8");
|
|
186
|
-
rejectWithPid(reject, `Daemon process exited with code ${code}` + (errLogContent ? "\n" + errLogContent : ""));
|
|
175
|
+
rejectWithPid(reject, `Daemon process exited with code ${code}` + (outLog ? "\n" + outLog : "") + (errLogContent ? "\n" + errLogContent : ""));
|
|
187
176
|
}
|
|
188
177
|
});
|
|
189
178
|
});
|
|
@@ -163,6 +163,10 @@ playwright-cli video-start video.webm
|
|
|
163
163
|
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
|
|
164
164
|
playwright-cli video-stop
|
|
165
165
|
|
|
166
|
+
# annotate each subsequent action (click, type, ...) with a callout naming the action and highlighting the target
|
|
167
|
+
playwright-cli video-show-actions --duration=600 --position=top-right
|
|
168
|
+
playwright-cli video-hide-actions
|
|
169
|
+
|
|
166
170
|
# launch the dashboard for UI review / design feedback — user annotates the page, you receive the annotated screenshot, snapshot, and notes
|
|
167
171
|
playwright-cli show --annotate
|
|
168
172
|
|
|
@@ -231,6 +235,18 @@ playwright-cli -s=msedge detach
|
|
|
231
235
|
playwright-cli delete-data
|
|
232
236
|
```
|
|
233
237
|
|
|
238
|
+
## URLs with `&` on Windows
|
|
239
|
+
|
|
240
|
+
On Windows, `cmd.exe` and PowerShell treat `&` as a command separator, so URLs with multiple query parameters get truncated before `playwright-cli` runs. Escape `&` with `^&` in `cmd.exe`, or use `--%` in PowerShell:
|
|
241
|
+
|
|
242
|
+
```batch
|
|
243
|
+
playwright-cli goto "https://example.com/?a=1^&b=2"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```powershell
|
|
247
|
+
playwright-cli --% goto "https://example.com/?a=1&b=2"
|
|
248
|
+
```
|
|
249
|
+
|
|
234
250
|
## Snapshots
|
|
235
251
|
|
|
236
252
|
After each command, playwright-cli provides a snapshot of the current browser state.
|
|
@@ -191,7 +191,7 @@ Collect the generated code and write the test file at the path given in the spec
|
|
|
191
191
|
// seed: tests/seed.spec.ts
|
|
192
192
|
import { test, expect } from './fixtures'; // or '@playwright/test' if no fixtures file
|
|
193
193
|
|
|
194
|
-
test.describe('
|
|
194
|
+
test.describe('Signing in and out', () => {
|
|
195
195
|
test('should sign in', async ({ page }) => {
|
|
196
196
|
// 1. Navigate to the application
|
|
197
197
|
// (handled by the seed fixture)
|
|
@@ -261,7 +261,7 @@ The test is paused at the start. Step forward or run to until just before the fa
|
|
|
261
261
|
```bash
|
|
262
262
|
playwright-cli snapshot # did the element change / move / rename?
|
|
263
263
|
playwright-cli console # app-side errors?
|
|
264
|
-
playwright-cli
|
|
264
|
+
playwright-cli requests # failed request? wrong payload?
|
|
265
265
|
playwright-cli show --annotate # ask the user to point somewhere
|
|
266
266
|
```
|
|
267
267
|
|
|
@@ -38,7 +38,7 @@ The saved file contains:
|
|
|
38
38
|
"value": "abc123",
|
|
39
39
|
"domain": "example.com",
|
|
40
40
|
"path": "/",
|
|
41
|
-
"expires":
|
|
41
|
+
"expires": 1893456000,
|
|
42
42
|
"httpOnly": true,
|
|
43
43
|
"secure": true,
|
|
44
44
|
"sameSite": "Lax"
|
|
@@ -92,7 +92,7 @@ playwright-cli cookie-set session abc123
|
|
|
92
92
|
playwright-cli cookie-set session abc123 --domain=example.com --path=/ --httpOnly --secure --sameSite=Lax
|
|
93
93
|
|
|
94
94
|
# Cookie with expiration (Unix timestamp)
|
|
95
|
-
playwright-cli cookie-set remember_me token123 --expires=
|
|
95
|
+
playwright-cli cookie-set remember_me token123 --expires=1893456000
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
### Delete a Cookie
|
|
@@ -40,7 +40,7 @@ playwright-cli video-start recordings/checkout-test-run-42.webm
|
|
|
40
40
|
### 2. Record entire hero scripts.
|
|
41
41
|
|
|
42
42
|
When recording a video for the user or as a proof of work, it is best to create a code snippet and execute it with run-code.
|
|
43
|
-
It allows
|
|
43
|
+
It allows inserting appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.
|
|
44
44
|
|
|
45
45
|
1) Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request their bounding boxes for highlight.
|
|
46
46
|
2) Create a file with the intended script for video (below). Use pressSequentially w/ delay for nice typing, make reasonable pauses.
|