Skip to content

Commit e001925

Browse files
authored
chore: roll Playwright to 1.60.0-alpha-2026-04-24 (#379)
1 parent 0406ada commit e001925

6 files changed

Lines changed: 119 additions & 18 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ playwright-cli dblclick <ref> [button] # perform double click on a web page
139139
playwright-cli fill <ref> <text> # fill text into editable element
140140
playwright-cli fill <ref> <text> --submit # fill and press Enter
141141
playwright-cli drag <startRef> <endRef> # perform drag and drop between two elements
142+
playwright-cli drop <ref> --path=<file> # drop files onto an element (from outside the page)
143+
playwright-cli drop <ref> --data="k=v" # drop data onto an element
142144
playwright-cli hover <ref> # hover over element on page
143145
playwright-cli select <ref> <val> # select an option in a dropdown
144146
playwright-cli upload <file> # upload one or multiple files
@@ -245,6 +247,13 @@ playwright-cli tracing-stop # stop trace recording
245247
playwright-cli video-start [filename] # start video recording
246248
playwright-cli video-chapter <title> # add a chapter marker to the video
247249
playwright-cli video-stop # stop video recording
250+
playwright-cli show # open the visual dashboard
251+
playwright-cli show --annotate # open dashboard and prompt user for input
252+
playwright-cli generate-locator <ref> # generate a playwright locator for an element
253+
playwright-cli highlight <ref> # show a persistent highlight overlay
254+
playwright-cli highlight <ref> --style= # highlight with a custom CSS style
255+
playwright-cli highlight <ref> --hide # hide highlight on a specific element
256+
playwright-cli highlight --hide # hide all page highlights
248257
```
249258
250259
### Open parameters
@@ -289,6 +298,9 @@ playwright-cli snapshot "#main"
289298
# limit snapshot depth for efficiency, take a partial snapshot afterwards
290299
playwright-cli snapshot --depth=4
291300
playwright-cli snapshot e34
301+
302+
# include each element's bounding box as [box=x,y,width,height]
303+
playwright-cli snapshot --boxes
292304
```
293305
294306
### Targeting elements

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"test": "playwright test"
1919
},
2020
"devDependencies": {
21-
"@playwright/test": "1.60.0-alpha-2026-04-14",
21+
"@playwright/test": "1.60.0-alpha-2026-04-24",
2222
"@types/node": "^25.2.1"
2323
},
2424
"dependencies": {
25-
"playwright": "1.60.0-alpha-2026-04-14"
25+
"playwright": "1.60.0-alpha-2026-04-24"
2626
},
2727
"bin": {
2828
"playwright-cli": "playwright-cli.js"

skills/playwright-cli/SKILL.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ playwright-cli dblclick e7
3838
# --submit presses Enter after filling the element
3939
playwright-cli fill e5 "user@example.com" --submit
4040
playwright-cli drag e2 e8
41+
# drop files or data onto an element (from outside the page)
42+
playwright-cli drop e4 --path=./image.png
43+
playwright-cli drop e4 --data="text/plain=hello world"
4144
playwright-cli hover e4
4245
playwright-cli select e9 "option-value"
4346
playwright-cli upload ./document.pdf
@@ -158,6 +161,19 @@ playwright-cli tracing-stop
158161
playwright-cli video-start video.webm
159162
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
160163
playwright-cli video-stop
164+
165+
# launch the dashboard with annotation prompt to ask the user for input
166+
playwright-cli show --annotate
167+
168+
# generate a Playwright locator for an element from its ref or selector
169+
playwright-cli generate-locator e5 --raw
170+
171+
# show a persistent highlight overlay for an element, optionally with a custom style
172+
playwright-cli highlight e5
173+
playwright-cli highlight e5 --style="outline: 3px dashed red"
174+
# hide a single element highlight, or all page highlights when no target is given
175+
playwright-cli highlight e5 --hide
176+
playwright-cli highlight --hide
161177
```
162178
163179
## Raw output
@@ -175,6 +191,11 @@ TOKEN=$(playwright-cli --raw cookie-get session_id)
175191
playwright-cli --raw localstorage-get theme
176192
```
177193
194+
For structured output wrapping every reply as JSON, pass --json
195+
```bash
196+
playwright-cli list --json
197+
```
198+
178199
## Open parameters
179200
```bash
180201
# Use specific browser when creating session
@@ -235,6 +256,9 @@ playwright-cli snapshot "#main"
235256
# limit snapshot depth for efficiency, take a partial snapshot afterwards
236257
playwright-cli snapshot --depth=4
237258
playwright-cli snapshot e34
259+
260+
# include each element's bounding box as [box=x,y,width,height]
261+
playwright-cli snapshot --boxes
238262
```
239263

240264
## Targeting elements
@@ -338,6 +362,15 @@ playwright-cli tracing-stop
338362
playwright-cli close
339363
```
340364

365+
## Example: Interactive session
366+
367+
Ask the user to annotate the UI. User can provide contextual tasks or ask contextual questions using annotations:
368+
369+
```bash
370+
playwright-cli open https://example.com
371+
playwright-cli show --annotate
372+
```
373+
341374
## Specific tasks
342375

343376
* **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)

skills/playwright-cli/references/running-code.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ playwright-cli run-code "async page => {
1111
}"
1212
```
1313

14+
You can also load the function from a file:
15+
16+
```bash
17+
playwright-cli run-code --filename=./my-script.js
18+
```
19+
20+
21+
The code must be a single function expression, it is wrapped in `(...)` and evaluated.
22+
import/export/require syntax is not supported.
23+
1424
## Geolocation
1525

1626
```bash

skills/playwright-cli/references/test-generation.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,58 @@ playwright-cli click e5
7777

7878
### 3. Add Assertions Manually
7979

80-
Generated code captures actions but not assertions. Add expectations in your test:
80+
Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
81+
82+
- `toBeVisible()` — element is rendered and visible
83+
- `toHaveText(text)` — element text content matches
84+
- `toHaveValue(value) / toBeEmpty()` — input/select value matches
85+
- `toBeChecked() / toBeUnchecked()` — checkbox state matches
86+
- `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
87+
88+
Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
89+
90+
When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
91+
92+
Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
93+
94+
```bash
95+
# Get a stable locator for an element ref to use in the assertion
96+
playwright-cli --raw generate-locator e5
97+
# getByRole('button', { name: 'Submit' })
98+
99+
# Capture expected text content for toHaveText
100+
playwright-cli --raw eval "el => el.textContent" e5
101+
102+
# Capture expected input value for toHaveValue/toBeEmpty
103+
playwright-cli --raw eval "el => el.value" e5
104+
105+
# Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
106+
# (whole page, or use a ref to scope to a region)
107+
playwright-cli --raw snapshot
108+
playwright-cli --raw snapshot e5
109+
```
81110

82111
```typescript
83112
// Generated action
84113
await page.getByRole('button', { name: 'Submit' }).click();
85114

86-
// Manual assertion
87-
await expect(page.getByText('Success')).toBeVisible();
115+
// Manual assertions using the outputs above:
116+
await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
117+
await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
118+
await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
119+
await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
120+
121+
// toMatchAriaSnapshot on the whole page, finds a matching region
122+
await expect(page).toMatchAriaSnapshot(`
123+
- heading "Welcome, user"
124+
- link /\\d+ new messages?/
125+
- button "Sign out"
126+
`);
127+
128+
// toMatchAriaSnapshot scoped to a region
129+
await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
130+
- link "Home"
131+
- link /\\d+ new messages?/
132+
- link "Profile"
133+
`);
88134
```

0 commit comments

Comments
 (0)