Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ playwright-cli snapshot <ref> # snapshot a specific element
playwright-cli snapshot --depth=N # limit snapshot depth for efficiency
playwright-cli find <text> # search the snapshot for text, returns matching nodes
playwright-cli find --regex <pattern> # search the snapshot with a regexp
playwright-cli find <text> --filename=f # save matches to a file
playwright-cli eval <func> [ref] # evaluate javascript expression on page or element
playwright-cli dialog-accept [prompt] # accept a dialog
playwright-cli dialog-dismiss # dismiss a dialog
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "1.64.0-alpha-1789764292000",
"@playwright/test": "1.64.0-alpha-1790635538000",
"@types/node": "^25.2.1"
},
"dependencies": {
"playwright": "1.64.0-alpha-1789764292000",
"playwright-core": "1.64.0-alpha-1789764292000"
"playwright": "1.64.0-alpha-1790635538000",
"playwright-core": "1.64.0-alpha-1790635538000"
},
"bin": {
"playwright-cli": "playwright-cli.js"
Expand Down
11 changes: 8 additions & 3 deletions skills/playwright-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: playwright-cli
description: Automate browser interactions, test web pages and work with Playwright tests.
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
allowed-tools: Bash(playwright-cli:*) Bash(npx playwright:*) Bash(npx --no-install playwright:*)
---

# Browser Automation with playwright-cli
Expand Down Expand Up @@ -52,6 +52,8 @@ playwright-cli find "Sign in"
playwright-cli find --regex "Sign (in|up)"
# wrap the regexp in slashes to add flags, e.g. /i for case-insensitive
playwright-cli find --regex "/sign (in|up)/i"
# save results to a file when a query produces too many matches
playwright-cli find "Add" --filename=results.md
playwright-cli eval "document.title"
playwright-cli eval "el => el.textContent" e5
# get element id, class, or any attribute not visible in the snapshot
Expand Down Expand Up @@ -210,7 +212,8 @@ playwright-cli highlight --hide
### WebMCP

Some pages register their own tools for agents through the experimental WebMCP API. When a page
has them, the page status says so, and the snapshot lists them at the top:
has them, the page status says so, and the snapshot lists them at the top. Run `webmcp-list` to
get the same list and schemas without taking a snapshot:

```
- Page URL: https://example.com/
Expand All @@ -227,7 +230,7 @@ has them, the page status says so, and the snapshot lists them at the top:
Prefer these tools over driving the UI when one matches the task: the page implements them, so a
single call replaces a sequence of clicks and fills — and it cannot be blocked by a cookie banner or
a newsletter modal.
Run `webmcp-call <name> --params '{...}'` to call the tool. Run `webmcp-list` to only list the tools and schemas.
Run `webmcp-call <name> --params '{...}'` to call the tool.

```bash
playwright-cli webmcp-call search --params '{"query":"cats"}'
Expand Down Expand Up @@ -394,6 +397,8 @@ playwright-cli kill-all

## Installation

Package installation and custom `npm` scripts may require separate approval.

If global `playwright-cli` command is not available, try a local version via `npx playwright cli`:

```bash
Expand Down
4 changes: 4 additions & 0 deletions skills/playwright-cli/references/running-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ playwright-cli run-code --filename=./my-script.js
The code must be a single function expression, it is wrapped in `(...)` and evaluated.
import/export/require syntax is not supported.

The code runs in an isolated context, not in a full Node.js environment. `require`, `process` and Node modules are not
available. Timers (`setTimeout`, `setInterval`), `fetch`, `URL`, `Buffer`, `crypto`, `AbortController`, `TextEncoder`
and `TextDecoder` are available.

## Geolocation

```bash
Expand Down
2 changes: 1 addition & 1 deletion skills/playwright-cli/references/test-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Rules:

### 2.3 Generate multiple scenarios

Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.
Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. Make sure each test run is stopped before starting the next one.

### 2.4 Run generated tests

Expand Down
Loading