@playwright/mcp 0.0.29 → 0.0.31
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/README.md +174 -292
- package/config.d.ts +3 -17
- package/lib/browserContextFactory.js +3 -35
- package/lib/config.js +64 -6
- package/lib/connection.js +2 -3
- package/lib/context.js +39 -29
- package/lib/{resources/resource.js → log.js} +6 -1
- package/lib/pageSnapshot.js +1 -1
- package/lib/program.js +14 -12
- package/lib/tab.js +37 -3
- package/lib/tools/common.js +4 -4
- package/lib/tools/console.js +1 -1
- package/lib/tools/dialogs.js +4 -4
- package/lib/tools/evaluate.js +62 -0
- package/lib/tools/files.js +5 -5
- package/lib/tools/install.js +1 -1
- package/lib/tools/keyboard.js +50 -4
- package/lib/tools/{vision.js → mouse.js} +14 -81
- package/lib/tools/navigate.js +12 -12
- package/lib/tools/screenshot.js +1 -1
- package/lib/tools/snapshot.js +18 -50
- package/lib/tools/tabs.js +14 -14
- package/lib/tools/utils.js +9 -1
- package/lib/tools/wait.js +6 -6
- package/lib/tools.js +12 -26
- package/lib/transport.js +40 -33
- package/package.json +7 -3
- package/lib/browserServer.js +0 -151
- package/lib/tools/testing.js +0 -60
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ A Model Context Protocol (MCP) server that provides browser automation capabilit
|
|
|
10
10
|
|
|
11
11
|
### Requirements
|
|
12
12
|
- Node.js 18 or newer
|
|
13
|
-
- VS Code, Cursor, Windsurf, Claude Desktop or any other MCP client
|
|
13
|
+
- VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client
|
|
14
14
|
|
|
15
15
|
<!--
|
|
16
16
|
// Generate using:
|
|
@@ -19,7 +19,9 @@ node utils/generate-links.js
|
|
|
19
19
|
|
|
20
20
|
### Getting started
|
|
21
21
|
|
|
22
|
-
First, install the Playwright MCP server with your client.
|
|
22
|
+
First, install the Playwright MCP server with your client.
|
|
23
|
+
|
|
24
|
+
**Standard config** works in most of the tools:
|
|
23
25
|
|
|
24
26
|
```js
|
|
25
27
|
{
|
|
@@ -37,20 +39,25 @@ First, install the Playwright MCP server with your client. A typical configurati
|
|
|
37
39
|
[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
<details
|
|
42
|
+
<details>
|
|
43
|
+
<summary>Claude Code</summary>
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
Use the Claude Code CLI to add the Playwright MCP server:
|
|
43
46
|
|
|
44
47
|
```bash
|
|
45
|
-
|
|
46
|
-
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
|
|
48
|
+
claude mcp add playwright npx @playwright/mcp@latest
|
|
47
49
|
```
|
|
50
|
+
</details>
|
|
51
|
+
|
|
52
|
+
<details>
|
|
53
|
+
<summary>Claude Desktop</summary>
|
|
54
|
+
|
|
55
|
+
Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.
|
|
48
56
|
|
|
49
|
-
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
|
|
50
57
|
</details>
|
|
51
58
|
|
|
52
59
|
<details>
|
|
53
|
-
<summary
|
|
60
|
+
<summary>Cursor</summary>
|
|
54
61
|
|
|
55
62
|
#### Click the button to install:
|
|
56
63
|
|
|
@@ -60,77 +67,53 @@ After installation, the Playwright MCP server will be available for use with you
|
|
|
60
67
|
|
|
61
68
|
Go to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, use `command` type with the command `npx @playwright/mcp`. You can also verify config or add command like arguments via clicking `Edit`.
|
|
62
69
|
|
|
63
|
-
```js
|
|
64
|
-
{
|
|
65
|
-
"mcpServers": {
|
|
66
|
-
"playwright": {
|
|
67
|
-
"command": "npx",
|
|
68
|
-
"args": [
|
|
69
|
-
"@playwright/mcp@latest"
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
70
|
</details>
|
|
76
71
|
|
|
77
72
|
<details>
|
|
78
|
-
<summary
|
|
73
|
+
<summary>Gemini CLI</summary>
|
|
79
74
|
|
|
80
|
-
Follow
|
|
75
|
+
Follow the MCP install [guide](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md#configure-the-mcp-server-in-settingsjson), use the standard config above.
|
|
81
76
|
|
|
82
|
-
```js
|
|
83
|
-
{
|
|
84
|
-
"mcpServers": {
|
|
85
|
-
"playwright": {
|
|
86
|
-
"command": "npx",
|
|
87
|
-
"args": [
|
|
88
|
-
"@playwright/mcp@latest"
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
77
|
</details>
|
|
95
78
|
|
|
96
79
|
<details>
|
|
97
|
-
<summary
|
|
80
|
+
<summary>Goose</summary>
|
|
98
81
|
|
|
99
|
-
|
|
82
|
+
#### Click the button to install:
|
|
100
83
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"args": [
|
|
107
|
-
"@playwright/mcp@latest"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
84
|
+
[](https://block.github.io/goose/extension?cmd=npx&arg=%40playwright%2Fmcp%40latest&id=playwright&name=Playwright&description=Interact%20with%20web%20pages%20through%20structured%20accessibility%20snapshots%20using%20Playwright)
|
|
85
|
+
|
|
86
|
+
#### Or install manually:
|
|
87
|
+
|
|
88
|
+
Go to `Advanced settings` -> `Extensions` -> `Add custom extension`. Name to your liking, use type `STDIO`, and set the `command` to `npx @playwright/mcp`. Click "Add Extension".
|
|
113
89
|
</details>
|
|
114
90
|
|
|
115
91
|
<details>
|
|
116
|
-
<summary
|
|
92
|
+
<summary>Qodo Gen</summary>
|
|
117
93
|
|
|
118
|
-
Open [Qodo Gen](https://docs.qodo.ai/qodo-documentation/qodo-gen) chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the
|
|
94
|
+
Open [Qodo Gen](https://docs.qodo.ai/qodo-documentation/qodo-gen) chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
|
|
119
95
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
96
|
+
Click <code>Save</code>.
|
|
97
|
+
</details>
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary>VS Code</summary>
|
|
101
|
+
|
|
102
|
+
You can also install the Playwright MCP server using the VS Code CLI:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# For VS Code
|
|
106
|
+
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
|
|
131
107
|
```
|
|
132
108
|
|
|
133
|
-
|
|
109
|
+
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
|
|
110
|
+
</details>
|
|
111
|
+
|
|
112
|
+
<details>
|
|
113
|
+
<summary>Windsurf</summary>
|
|
114
|
+
|
|
115
|
+
Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use the standard config above.
|
|
116
|
+
|
|
134
117
|
</details>
|
|
135
118
|
|
|
136
119
|
### Configuration
|
|
@@ -151,10 +134,8 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
151
134
|
--block-service-workers block service workers
|
|
152
135
|
--browser <browser> browser or chrome channel to use, possible
|
|
153
136
|
values: chrome, firefox, webkit, msedge.
|
|
154
|
-
--
|
|
155
|
-
|
|
156
|
-
possible values: tabs, pdf, history, wait, files,
|
|
157
|
-
install. Default is all.
|
|
137
|
+
--caps <caps> comma-separated list of additional capabilities
|
|
138
|
+
to enable, possible values: vision, pdf.
|
|
158
139
|
--cdp-endpoint <endpoint> CDP endpoint to connect to.
|
|
159
140
|
--config <path> path to the configuration file.
|
|
160
141
|
--device <device> device to emulate, for example: "iPhone 15"
|
|
@@ -166,9 +147,7 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
166
147
|
--isolated keep the browser profile in memory, do not save
|
|
167
148
|
it to disk.
|
|
168
149
|
--image-responses <mode> whether to send image responses to the client.
|
|
169
|
-
Can be "allow"
|
|
170
|
-
"auto", which sends images if the client can
|
|
171
|
-
display them.
|
|
150
|
+
Can be "allow" or "omit", Defaults to "allow".
|
|
172
151
|
--no-sandbox disable the sandbox for all process types that
|
|
173
152
|
are normally sandboxed.
|
|
174
153
|
--output-dir <path> path to the directory for output files.
|
|
@@ -186,8 +165,6 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
186
165
|
specified, a temporary directory will be created.
|
|
187
166
|
--viewport-size <size> specify browser viewport size in pixels, for
|
|
188
167
|
example "1280, 720"
|
|
189
|
-
--vision Run server that uses screenshots (Aria snapshots
|
|
190
|
-
are used by default)
|
|
191
168
|
```
|
|
192
169
|
|
|
193
170
|
<!--- End of options generated section -->
|
|
@@ -288,21 +265,14 @@ npx @playwright/mcp@latest --config path/to/config.json
|
|
|
288
265
|
host?: string; // Host to bind to (default: localhost)
|
|
289
266
|
},
|
|
290
267
|
|
|
291
|
-
// List of
|
|
268
|
+
// List of additional capabilities
|
|
292
269
|
capabilities?: Array<
|
|
293
|
-
'core' | // Core browser automation
|
|
294
270
|
'tabs' | // Tab management
|
|
295
|
-
'pdf' | // PDF generation
|
|
296
|
-
'history' | // Browser history
|
|
297
|
-
'wait' | // Wait utilities
|
|
298
|
-
'files' | // File handling
|
|
299
271
|
'install' | // Browser installation
|
|
300
|
-
'
|
|
272
|
+
'pdf' | // PDF generation
|
|
273
|
+
'vision' | // Coordinate-based interactions
|
|
301
274
|
>;
|
|
302
275
|
|
|
303
|
-
// Enable vision mode (screenshots instead of accessibility snapshots)
|
|
304
|
-
vision?: boolean;
|
|
305
|
-
|
|
306
276
|
// Directory for output files
|
|
307
277
|
outputDir?: string;
|
|
308
278
|
|
|
@@ -316,9 +286,10 @@ npx @playwright/mcp@latest --config path/to/config.json
|
|
|
316
286
|
};
|
|
317
287
|
|
|
318
288
|
/**
|
|
319
|
-
*
|
|
289
|
+
* Whether to send image responses to the client. Can be "allow" or "omit".
|
|
290
|
+
* Defaults to "allow".
|
|
320
291
|
*/
|
|
321
|
-
|
|
292
|
+
imageResponses?: 'allow' | 'omit';
|
|
322
293
|
}
|
|
323
294
|
```
|
|
324
295
|
</details>
|
|
@@ -391,42 +362,10 @@ http.createServer(async (req, res) => {
|
|
|
391
362
|
|
|
392
363
|
### Tools
|
|
393
364
|
|
|
394
|
-
The tools are available in two modes:
|
|
395
|
-
|
|
396
|
-
1. **Snapshot Mode** (default): Uses accessibility snapshots for better performance and reliability
|
|
397
|
-
2. **Vision Mode**: Uses screenshots for visual-based interactions
|
|
398
|
-
|
|
399
|
-
To use Vision Mode, add the `--vision` flag when starting the server:
|
|
400
|
-
|
|
401
|
-
```js
|
|
402
|
-
{
|
|
403
|
-
"mcpServers": {
|
|
404
|
-
"playwright": {
|
|
405
|
-
"command": "npx",
|
|
406
|
-
"args": [
|
|
407
|
-
"@playwright/mcp@latest",
|
|
408
|
-
"--vision"
|
|
409
|
-
]
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
Vision Mode works best with the computer use models that are able to interact with elements using
|
|
416
|
-
X Y coordinate space, based on the provided screenshot.
|
|
417
|
-
|
|
418
365
|
<!--- Tools generated by update-readme.js -->
|
|
419
366
|
|
|
420
367
|
<details>
|
|
421
|
-
<summary><b>
|
|
422
|
-
|
|
423
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
424
|
-
|
|
425
|
-
- **browser_snapshot**
|
|
426
|
-
- Title: Page snapshot
|
|
427
|
-
- Description: Capture accessibility snapshot of the current page, this is better than screenshot
|
|
428
|
-
- Parameters: None
|
|
429
|
-
- Read-only: **true**
|
|
368
|
+
<summary><b>Core automation</b></summary>
|
|
430
369
|
|
|
431
370
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
432
371
|
|
|
@@ -436,76 +375,51 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
436
375
|
- Parameters:
|
|
437
376
|
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
438
377
|
- `ref` (string): Exact target element reference from the page snapshot
|
|
378
|
+
- `doubleClick` (boolean, optional): Whether to perform a double click instead of a single click
|
|
379
|
+
- `button` (string, optional): Button to click, defaults to left
|
|
439
380
|
- Read-only: **false**
|
|
440
381
|
|
|
441
382
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
442
383
|
|
|
443
|
-
- **
|
|
444
|
-
- Title:
|
|
445
|
-
- Description:
|
|
446
|
-
- Parameters:
|
|
447
|
-
- `startElement` (string): Human-readable source element description used to obtain the permission to interact with the element
|
|
448
|
-
- `startRef` (string): Exact source element reference from the page snapshot
|
|
449
|
-
- `endElement` (string): Human-readable target element description used to obtain the permission to interact with the element
|
|
450
|
-
- `endRef` (string): Exact target element reference from the page snapshot
|
|
451
|
-
- Read-only: **false**
|
|
452
|
-
|
|
453
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
454
|
-
|
|
455
|
-
- **browser_hover**
|
|
456
|
-
- Title: Hover mouse
|
|
457
|
-
- Description: Hover over element on page
|
|
458
|
-
- Parameters:
|
|
459
|
-
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
460
|
-
- `ref` (string): Exact target element reference from the page snapshot
|
|
384
|
+
- **browser_close**
|
|
385
|
+
- Title: Close browser
|
|
386
|
+
- Description: Close the page
|
|
387
|
+
- Parameters: None
|
|
461
388
|
- Read-only: **true**
|
|
462
389
|
|
|
463
390
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
464
391
|
|
|
465
|
-
- **
|
|
466
|
-
- Title:
|
|
467
|
-
- Description:
|
|
468
|
-
- Parameters:
|
|
469
|
-
|
|
470
|
-
- `ref` (string): Exact target element reference from the page snapshot
|
|
471
|
-
- `text` (string): Text to type into the element
|
|
472
|
-
- `submit` (boolean, optional): Whether to submit entered text (press Enter after)
|
|
473
|
-
- `slowly` (boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.
|
|
474
|
-
- Read-only: **false**
|
|
392
|
+
- **browser_console_messages**
|
|
393
|
+
- Title: Get console messages
|
|
394
|
+
- Description: Returns all console messages
|
|
395
|
+
- Parameters: None
|
|
396
|
+
- Read-only: **true**
|
|
475
397
|
|
|
476
398
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
477
399
|
|
|
478
|
-
- **
|
|
479
|
-
- Title:
|
|
480
|
-
- Description:
|
|
400
|
+
- **browser_drag**
|
|
401
|
+
- Title: Drag mouse
|
|
402
|
+
- Description: Perform drag and drop between two elements
|
|
481
403
|
- Parameters:
|
|
482
|
-
- `
|
|
483
|
-
- `
|
|
484
|
-
- `
|
|
404
|
+
- `startElement` (string): Human-readable source element description used to obtain the permission to interact with the element
|
|
405
|
+
- `startRef` (string): Exact source element reference from the page snapshot
|
|
406
|
+
- `endElement` (string): Human-readable target element description used to obtain the permission to interact with the element
|
|
407
|
+
- `endRef` (string): Exact target element reference from the page snapshot
|
|
485
408
|
- Read-only: **false**
|
|
486
409
|
|
|
487
410
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
488
411
|
|
|
489
|
-
- **
|
|
490
|
-
- Title:
|
|
491
|
-
- Description:
|
|
412
|
+
- **browser_evaluate**
|
|
413
|
+
- Title: Evaluate JavaScript
|
|
414
|
+
- Description: Evaluate JavaScript expression on page or element
|
|
492
415
|
- Parameters:
|
|
493
|
-
- `
|
|
416
|
+
- `function` (string): () => { /* code */ } or (element) => { /* code */ } when element is provided
|
|
417
|
+
- `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
|
|
418
|
+
- `ref` (string, optional): Exact target element reference from the page snapshot
|
|
494
419
|
- Read-only: **false**
|
|
495
420
|
|
|
496
421
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
497
422
|
|
|
498
|
-
- **browser_wait_for**
|
|
499
|
-
- Title: Wait for
|
|
500
|
-
- Description: Wait for text to appear or disappear or a specified time to pass
|
|
501
|
-
- Parameters:
|
|
502
|
-
- `time` (number, optional): The time to wait in seconds
|
|
503
|
-
- `text` (string, optional): The text to wait for
|
|
504
|
-
- `textGone` (string, optional): The text to wait for to disappear
|
|
505
|
-
- Read-only: **true**
|
|
506
|
-
|
|
507
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
508
|
-
|
|
509
423
|
- **browser_file_upload**
|
|
510
424
|
- Title: Upload files
|
|
511
425
|
- Description: Upload one or multiple files
|
|
@@ -523,10 +437,15 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
523
437
|
- `promptText` (string, optional): The text of the prompt in case of a prompt dialog.
|
|
524
438
|
- Read-only: **false**
|
|
525
439
|
|
|
526
|
-
|
|
440
|
+
<!-- NOTE: This has been generated via update-readme.js -->
|
|
527
441
|
|
|
528
|
-
|
|
529
|
-
|
|
442
|
+
- **browser_hover**
|
|
443
|
+
- Title: Hover mouse
|
|
444
|
+
- Description: Hover over element on page
|
|
445
|
+
- Parameters:
|
|
446
|
+
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
447
|
+
- `ref` (string): Exact target element reference from the page snapshot
|
|
448
|
+
- Read-only: **true**
|
|
530
449
|
|
|
531
450
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
532
451
|
|
|
@@ -553,83 +472,101 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
553
472
|
- Parameters: None
|
|
554
473
|
- Read-only: **true**
|
|
555
474
|
|
|
556
|
-
|
|
475
|
+
<!-- NOTE: This has been generated via update-readme.js -->
|
|
557
476
|
|
|
558
|
-
|
|
559
|
-
|
|
477
|
+
- **browser_network_requests**
|
|
478
|
+
- Title: List network requests
|
|
479
|
+
- Description: Returns all network requests since loading the page
|
|
480
|
+
- Parameters: None
|
|
481
|
+
- Read-only: **true**
|
|
560
482
|
|
|
561
483
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
562
484
|
|
|
563
|
-
- **
|
|
564
|
-
- Title:
|
|
565
|
-
- Description:
|
|
485
|
+
- **browser_press_key**
|
|
486
|
+
- Title: Press a key
|
|
487
|
+
- Description: Press a key on the keyboard
|
|
566
488
|
- Parameters:
|
|
567
|
-
- `
|
|
568
|
-
|
|
569
|
-
- `element` (string, optional): Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.
|
|
570
|
-
- `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.
|
|
571
|
-
- Read-only: **true**
|
|
489
|
+
- `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
|
|
490
|
+
- Read-only: **false**
|
|
572
491
|
|
|
573
492
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
574
493
|
|
|
575
|
-
- **
|
|
576
|
-
- Title:
|
|
577
|
-
- Description:
|
|
494
|
+
- **browser_resize**
|
|
495
|
+
- Title: Resize browser window
|
|
496
|
+
- Description: Resize the browser window
|
|
578
497
|
- Parameters:
|
|
579
|
-
- `
|
|
498
|
+
- `width` (number): Width of the browser window
|
|
499
|
+
- `height` (number): Height of the browser window
|
|
580
500
|
- Read-only: **true**
|
|
581
501
|
|
|
582
502
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
583
503
|
|
|
584
|
-
- **
|
|
585
|
-
- Title:
|
|
586
|
-
- Description:
|
|
587
|
-
- Parameters:
|
|
588
|
-
|
|
504
|
+
- **browser_select_option**
|
|
505
|
+
- Title: Select option
|
|
506
|
+
- Description: Select an option in a dropdown
|
|
507
|
+
- Parameters:
|
|
508
|
+
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
509
|
+
- `ref` (string): Exact target element reference from the page snapshot
|
|
510
|
+
- `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.
|
|
511
|
+
- Read-only: **false**
|
|
589
512
|
|
|
590
513
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
591
514
|
|
|
592
|
-
- **
|
|
593
|
-
- Title:
|
|
594
|
-
- Description:
|
|
515
|
+
- **browser_snapshot**
|
|
516
|
+
- Title: Page snapshot
|
|
517
|
+
- Description: Capture accessibility snapshot of the current page, this is better than screenshot
|
|
595
518
|
- Parameters: None
|
|
596
519
|
- Read-only: **true**
|
|
597
520
|
|
|
598
|
-
</details>
|
|
599
|
-
|
|
600
|
-
<details>
|
|
601
|
-
<summary><b>Utilities</b></summary>
|
|
602
|
-
|
|
603
521
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
604
522
|
|
|
605
|
-
- **
|
|
606
|
-
- Title:
|
|
607
|
-
- Description:
|
|
608
|
-
- Parameters:
|
|
609
|
-
|
|
523
|
+
- **browser_take_screenshot**
|
|
524
|
+
- Title: Take a screenshot
|
|
525
|
+
- Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
|
|
526
|
+
- Parameters:
|
|
527
|
+
- `raw` (boolean, optional): Whether to return without compression (in PNG format). Default is false, which returns a JPEG image.
|
|
528
|
+
- `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified.
|
|
529
|
+
- `element` (string, optional): Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.
|
|
530
|
+
- `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.
|
|
531
|
+
- Read-only: **true**
|
|
610
532
|
|
|
611
533
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
612
534
|
|
|
613
|
-
- **
|
|
614
|
-
- Title:
|
|
615
|
-
- Description:
|
|
616
|
-
- Parameters:
|
|
617
|
-
|
|
535
|
+
- **browser_type**
|
|
536
|
+
- Title: Type text
|
|
537
|
+
- Description: Type text into editable element
|
|
538
|
+
- Parameters:
|
|
539
|
+
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
540
|
+
- `ref` (string): Exact target element reference from the page snapshot
|
|
541
|
+
- `text` (string): Text to type into the element
|
|
542
|
+
- `submit` (boolean, optional): Whether to submit entered text (press Enter after)
|
|
543
|
+
- `slowly` (boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.
|
|
544
|
+
- Read-only: **false**
|
|
618
545
|
|
|
619
546
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
620
547
|
|
|
621
|
-
- **
|
|
622
|
-
- Title:
|
|
623
|
-
- Description:
|
|
548
|
+
- **browser_wait_for**
|
|
549
|
+
- Title: Wait for
|
|
550
|
+
- Description: Wait for text to appear or disappear or a specified time to pass
|
|
624
551
|
- Parameters:
|
|
625
|
-
- `
|
|
626
|
-
- `
|
|
552
|
+
- `time` (number, optional): The time to wait in seconds
|
|
553
|
+
- `text` (string, optional): The text to wait for
|
|
554
|
+
- `textGone` (string, optional): The text to wait for to disappear
|
|
627
555
|
- Read-only: **true**
|
|
628
556
|
|
|
629
557
|
</details>
|
|
630
558
|
|
|
631
559
|
<details>
|
|
632
|
-
<summary><b>
|
|
560
|
+
<summary><b>Tab management</b></summary>
|
|
561
|
+
|
|
562
|
+
<!-- NOTE: This has been generated via update-readme.js -->
|
|
563
|
+
|
|
564
|
+
- **browser_tab_close**
|
|
565
|
+
- Title: Close a tab
|
|
566
|
+
- Description: Close a tab
|
|
567
|
+
- Parameters:
|
|
568
|
+
- `index` (number, optional): The index of the tab to close. Closes current tab if not provided.
|
|
569
|
+
- Read-only: **false**
|
|
633
570
|
|
|
634
571
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
635
572
|
|
|
@@ -657,60 +594,29 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
657
594
|
- `index` (number): The index of the tab to select
|
|
658
595
|
- Read-only: **true**
|
|
659
596
|
|
|
660
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
661
|
-
|
|
662
|
-
- **browser_tab_close**
|
|
663
|
-
- Title: Close a tab
|
|
664
|
-
- Description: Close a tab
|
|
665
|
-
- Parameters:
|
|
666
|
-
- `index` (number, optional): The index of the tab to close. Closes current tab if not provided.
|
|
667
|
-
- Read-only: **false**
|
|
668
|
-
|
|
669
597
|
</details>
|
|
670
598
|
|
|
671
599
|
<details>
|
|
672
|
-
<summary><b>
|
|
600
|
+
<summary><b>Browser installation</b></summary>
|
|
673
601
|
|
|
674
602
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
675
603
|
|
|
676
|
-
- **
|
|
677
|
-
- Title:
|
|
678
|
-
- Description:
|
|
679
|
-
- Parameters:
|
|
680
|
-
|
|
681
|
-
- `description` (string): The description of the test
|
|
682
|
-
- `steps` (array): The steps of the test
|
|
683
|
-
- Read-only: **true**
|
|
604
|
+
- **browser_install**
|
|
605
|
+
- Title: Install the browser specified in the config
|
|
606
|
+
- Description: Install the browser specified in the config. Call this if you get an error about the browser not being installed.
|
|
607
|
+
- Parameters: None
|
|
608
|
+
- Read-only: **false**
|
|
684
609
|
|
|
685
610
|
</details>
|
|
686
611
|
|
|
687
612
|
<details>
|
|
688
|
-
<summary><b>
|
|
689
|
-
|
|
690
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
691
|
-
|
|
692
|
-
- **browser_screen_capture**
|
|
693
|
-
- Title: Take a screenshot
|
|
694
|
-
- Description: Take a screenshot of the current page
|
|
695
|
-
- Parameters: None
|
|
696
|
-
- Read-only: **true**
|
|
697
|
-
|
|
698
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
699
|
-
|
|
700
|
-
- **browser_screen_move_mouse**
|
|
701
|
-
- Title: Move mouse
|
|
702
|
-
- Description: Move mouse to a given position
|
|
703
|
-
- Parameters:
|
|
704
|
-
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
705
|
-
- `x` (number): X coordinate
|
|
706
|
-
- `y` (number): Y coordinate
|
|
707
|
-
- Read-only: **true**
|
|
613
|
+
<summary><b>Coordinate-based (opt-in via --caps=vision)</b></summary>
|
|
708
614
|
|
|
709
615
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
710
616
|
|
|
711
|
-
- **
|
|
617
|
+
- **browser_mouse_click_xy**
|
|
712
618
|
- Title: Click
|
|
713
|
-
- Description: Click left mouse button
|
|
619
|
+
- Description: Click left mouse button at a given position
|
|
714
620
|
- Parameters:
|
|
715
621
|
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
716
622
|
- `x` (number): X coordinate
|
|
@@ -719,9 +625,9 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
719
625
|
|
|
720
626
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
721
627
|
|
|
722
|
-
- **
|
|
628
|
+
- **browser_mouse_drag_xy**
|
|
723
629
|
- Title: Drag mouse
|
|
724
|
-
- Description: Drag left mouse button
|
|
630
|
+
- Description: Drag left mouse button to a given position
|
|
725
631
|
- Parameters:
|
|
726
632
|
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
727
633
|
- `startX` (number): Start X coordinate
|
|
@@ -732,52 +638,28 @@ X Y coordinate space, based on the provided screenshot.
|
|
|
732
638
|
|
|
733
639
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
734
640
|
|
|
735
|
-
- **
|
|
736
|
-
- Title:
|
|
737
|
-
- Description:
|
|
738
|
-
- Parameters:
|
|
739
|
-
- `text` (string): Text to type into the element
|
|
740
|
-
- `submit` (boolean, optional): Whether to submit entered text (press Enter after)
|
|
741
|
-
- Read-only: **false**
|
|
742
|
-
|
|
743
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
744
|
-
|
|
745
|
-
- **browser_press_key**
|
|
746
|
-
- Title: Press a key
|
|
747
|
-
- Description: Press a key on the keyboard
|
|
748
|
-
- Parameters:
|
|
749
|
-
- `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
|
|
750
|
-
- Read-only: **false**
|
|
751
|
-
|
|
752
|
-
<!-- NOTE: This has been generated via update-readme.js -->
|
|
753
|
-
|
|
754
|
-
- **browser_wait_for**
|
|
755
|
-
- Title: Wait for
|
|
756
|
-
- Description: Wait for text to appear or disappear or a specified time to pass
|
|
641
|
+
- **browser_mouse_move_xy**
|
|
642
|
+
- Title: Move mouse
|
|
643
|
+
- Description: Move mouse to a given position
|
|
757
644
|
- Parameters:
|
|
758
|
-
- `
|
|
759
|
-
- `
|
|
760
|
-
- `
|
|
645
|
+
- `element` (string): Human-readable element description used to obtain permission to interact with the element
|
|
646
|
+
- `x` (number): X coordinate
|
|
647
|
+
- `y` (number): Y coordinate
|
|
761
648
|
- Read-only: **true**
|
|
762
649
|
|
|
763
|
-
|
|
650
|
+
</details>
|
|
764
651
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
- Description: Upload one or multiple files
|
|
768
|
-
- Parameters:
|
|
769
|
-
- `paths` (array): The absolute paths to the files to upload. Can be a single file or multiple files.
|
|
770
|
-
- Read-only: **false**
|
|
652
|
+
<details>
|
|
653
|
+
<summary><b>PDF generation (opt-in via --caps=pdf)</b></summary>
|
|
771
654
|
|
|
772
655
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
773
656
|
|
|
774
|
-
- **
|
|
775
|
-
- Title:
|
|
776
|
-
- Description:
|
|
657
|
+
- **browser_pdf_save**
|
|
658
|
+
- Title: Save as PDF
|
|
659
|
+
- Description: Save page as PDF
|
|
777
660
|
- Parameters:
|
|
778
|
-
- `
|
|
779
|
-
|
|
780
|
-
- Read-only: **false**
|
|
661
|
+
- `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.
|
|
662
|
+
- Read-only: **true**
|
|
781
663
|
|
|
782
664
|
</details>
|
|
783
665
|
|