Skip to content

Commit 4e37405

Browse files
authored
chore: roll Playwright to 1.59.0-alpha-1774912654000 (#330)
1 parent a0b79f6 commit 4e37405

File tree

7 files changed

+214
-49
lines changed

7 files changed

+214
-49
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ playwright-cli type <text> # type text into editable element
137137
playwright-cli click <ref> [button] # perform click on a web page
138138
playwright-cli dblclick <ref> [button] # perform double click on a web page
139139
playwright-cli fill <ref> <text> # fill text into editable element
140+
playwright-cli fill <ref> <text> --submit # fill and press Enter
140141
playwright-cli drag <startRef> <endRef> # perform drag and drop between two elements
141142
playwright-cli hover <ref> # hover over element on page
142143
playwright-cli select <ref> <val> # select an option in a dropdown
@@ -145,6 +146,8 @@ playwright-cli check <ref> # check a checkbox or radio button
145146
playwright-cli uncheck <ref> # uncheck a checkbox or radio button
146147
playwright-cli snapshot # capture page snapshot to obtain element ref
147148
playwright-cli snapshot --filename=f # save snapshot to specific file
149+
playwright-cli snapshot <ref> # snapshot a specific element
150+
playwright-cli snapshot --depth=N # limit snapshot depth for efficiency
148151
playwright-cli eval <func> [ref] # evaluate javascript expression on page or element
149152
playwright-cli dialog-accept [prompt] # accept a dialog
150153
playwright-cli dialog-dismiss # dismiss a dialog
@@ -236,10 +239,12 @@ playwright-cli unroute [pattern] # remove route(s)
236239
playwright-cli console [min-level] # list console messages
237240
playwright-cli network # list all network requests since loading the page
238241
playwright-cli run-code <code> # run playwright code snippet
242+
playwright-cli run-code --filename=f # run playwright code from a file
239243
playwright-cli tracing-start # start trace recording
240244
playwright-cli tracing-stop # stop trace recording
241-
playwright-cli video-start # start video recording
242-
playwright-cli video-stop [filename] # stop video recording
245+
playwright-cli video-start [filename] # start video recording
246+
playwright-cli video-chapter <title> # add a chapter marker to the video
247+
playwright-cli video-stop # stop video recording
243248
```
244249
245250
### Open parameters
@@ -267,9 +272,22 @@ After each command, playwright-cli provides a snapshot of the current browser st
267272
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
268273
```
269274
270-
You can also take a snapshot on demand using `playwright-cli snapshot` command.
275+
You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
271276
272-
If `--filename` is not provided, a new snapshot file is created with a timestamp. Default to automatic file naming, use `--filename=` when artifact is a part of the workflow result.
277+
```bash
278+
# default - save to a file with timestamp-based name
279+
playwright-cli snapshot
280+
281+
# save to file, use when snapshot is a part of the workflow result
282+
playwright-cli snapshot --filename=after-click.yaml
283+
284+
# snapshot an element instead of the whole page
285+
playwright-cli snapshot "#main"
286+
287+
# limit snapshot depth for efficiency, take a partial snapshot afterwards
288+
playwright-cli snapshot --depth=4
289+
playwright-cli snapshot e34
290+
```
273291
274292
### Targeting elements
275293
@@ -283,17 +301,17 @@ playwright-cli snapshot
283301
playwright-cli click e15
284302
```
285303
286-
You can also use css or role selectors, for example when explicitly asked for it.
304+
You can also use css selectors or Playwright locators.
287305
288306
```bash
289307
# css selector
290308
playwright-cli click "#main > button.submit"
291309

292-
# role selector
293-
playwright-cli click "role=button[name=Submit]"
310+
# role locator
311+
playwright-cli click "getByRole('button', { name: 'Submit' })"
294312

295-
# chaining css and role selectors
296-
playwright-cli click "#footer >> role=button[name=Submit]"
313+
# test id
314+
playwright-cli click "getByTestId('submit-button')"
297315
```
298316
299317
### Sessions
@@ -526,3 +544,4 @@ The installed skill includes detailed reference guides for common tasks:
526544
* **Test generation** — generate Playwright tests from interactions
527545
* **Tracing** — record and inspect execution traces
528546
* **Video recording** — capture browser session videos
547+
* **Inspecting element attributes** — get element id, class, or any attribute not visible in the snapshot

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,12 +18,12 @@
1818
"test": "playwright test"
1919
},
2020
"devDependencies": {
21-
"@playwright/test": "1.59.0-alpha-1773608981000",
21+
"@playwright/test": "1.59.0-alpha-1774912654000",
2222
"@types/node": "^25.2.1"
2323
},
2424
"dependencies": {
2525
"minimist": "^1.2.5",
26-
"playwright": "1.59.0-alpha-1773608981000"
26+
"playwright": "1.59.0-alpha-1774912654000"
2727
},
2828
"bin": {
2929
"playwright-cli": "playwright-cli.js"

skills/playwright-cli/SKILL.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ playwright-cli goto https://playwright.dev
3535
playwright-cli type "search query"
3636
playwright-cli click e3
3737
playwright-cli dblclick e7
38-
playwright-cli fill e5 "user@example.com"
38+
# --submit presses Enter after filling the element
39+
playwright-cli fill e5 "user@example.com" --submit
3940
playwright-cli drag e2 e8
4041
playwright-cli hover e4
4142
playwright-cli select e9 "option-value"
4243
playwright-cli upload ./document.pdf
4344
playwright-cli check e12
4445
playwright-cli uncheck e12
4546
playwright-cli snapshot
46-
playwright-cli snapshot --filename=after-click.yaml
4747
playwright-cli eval "document.title"
4848
playwright-cli eval "el => el.textContent" e5
49+
# get element id, class, or any attribute not visible in the snapshot
50+
playwright-cli eval "el => el.id" e5
51+
playwright-cli eval "el => el.getAttribute('data-testid')" e5
4952
playwright-cli dialog-accept
5053
playwright-cli dialog-accept "confirmation text"
5154
playwright-cli dialog-dismiss
@@ -149,10 +152,12 @@ playwright-cli console
149152
playwright-cli console warning
150153
playwright-cli network
151154
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
155+
playwright-cli run-code --filename=script.js
152156
playwright-cli tracing-start
153157
playwright-cli tracing-stop
154-
playwright-cli video-start
155-
playwright-cli video-stop video.webm
158+
playwright-cli video-start video.webm
159+
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
160+
playwright-cli video-stop
156161
```
157162
158163
## Open parameters
@@ -192,9 +197,22 @@ After each command, playwright-cli provides a snapshot of the current browser st
192197
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
193198
```
194199
195-
You can also take a snapshot on demand using `playwright-cli snapshot` command.
200+
You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
201+
202+
```bash
203+
# default - save to a file with timestamp-based name
204+
playwright-cli snapshot
205+
206+
# save to file, use when snapshot is a part of the workflow result
207+
playwright-cli snapshot --filename=after-click.yaml
208+
209+
# snapshot an element instead of the whole page
210+
playwright-cli snapshot "#main"
196211

197-
If `--filename` is not provided, a new snapshot file is created with a timestamp. Default to automatic file naming, use `--filename=` when artifact is a part of the workflow result.
212+
# limit snapshot depth for efficiency, take a partial snapshot afterwards
213+
playwright-cli snapshot --depth=4
214+
playwright-cli snapshot e34
215+
```
198216
199217
## Targeting elements
200218
@@ -208,17 +226,17 @@ playwright-cli snapshot
208226
playwright-cli click e15
209227
```
210228
211-
You can also use css or role selectors, for example when explicitly asked for it.
229+
You can also use css selectors or Playwright locators.
212230
213231
```bash
214232
# css selector
215233
playwright-cli click "#main > button.submit"
216234

217-
# role selector
218-
playwright-cli click "role=button[name=Submit]"
235+
# role locator
236+
playwright-cli click "getByRole('button', { name: 'Submit' })"
219237

220-
# chaining css and role selectors
221-
playwright-cli click "#footer >> role=button[name=Submit]"
238+
# test id
239+
playwright-cli click "getByTestId('submit-button')"
222240
```
223241
224242
## Browser Sessions
@@ -307,3 +325,4 @@ playwright-cli close
307325
* **Test generation** [references/test-generation.md](references/test-generation.md)
308326
* **Tracing** [references/tracing.md](references/tracing.md)
309327
* **Video recording** [references/video-recording.md](references/video-recording.md)
328+
* **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Inspecting Element Attributes
2+
3+
When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
4+
5+
## Examples
6+
7+
```bash
8+
playwright-cli snapshot
9+
# snapshot shows a button as e7 but doesn't reveal its id or data attributes
10+
11+
# get the element's id
12+
playwright-cli eval "el => el.id" e7
13+
14+
# get all CSS classes
15+
playwright-cli eval "el => el.className" e7
16+
17+
# get a specific attribute
18+
playwright-cli eval "el => el.getAttribute('data-testid')" e7
19+
playwright-cli eval "el => el.getAttribute('aria-label')" e7
20+
21+
# get a computed style property
22+
playwright-cli eval "el => getComputedStyle(el).display" e7
23+
```

skills/playwright-cli/references/playwright-tests.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
1212

1313
# Debugging Playwright Tests
1414

15-
To debug a failing test, run it with Playwright as usual, but set `PWPAUSE=cli` environment variable. This command will pause the test at the point of failure, and print the debugging instructions.
15+
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
1616

1717
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed.
1818

19-
Once instructions are printed, use `playwright-cli` to explore the page. Debugging instructions include a browser name that should be used in `playwright-cli` to attach to the page under test.
19+
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
2020

2121
```bash
2222
# Run the test
23-
PLAYWRIGHT_HTML_OPEN=never PWPAUSE=cli npx playwright test
23+
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
24+
# ...
25+
# ... debugging instructions for "tw-abcdef" session ...
2426
# ...
2527

26-
# Explore the page and interact if needed
27-
playwright-cli --session=test open --attach=test-worker-abcdef
28-
playwright-cli --session=test snapshot
29-
playwright-cli --session=test click e14
28+
# Attach to the test
29+
playwright-cli attach tw-abcdef
3030
```
3131

32-
Keep the test running in the background while you explore and look for a fix. After fixing the test, stop the background test run.
32+
Keep the test running in the background while you explore and look for a fix.
33+
The test is paused at the start, so you should step over or pause at a particular location
34+
where the problem is most likely to be.
3335

3436
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
3537
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
38+
39+
After fixing the test, stop the background test run. Rerun to check that test passes.

0 commit comments

Comments
 (0)