@willbooster/agent-skills 1.20.2 → 1.21.1
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/dist/cli.js +3 -3
- package/package.json +4 -8
- package/skills/playwright-cli/SKILL.md +157 -150
- package/skills/playwright-cli/references/element-attributes.md +6 -6
- package/skills/playwright-cli/references/playwright-tests.md +1 -1
- package/skills/playwright-cli/references/request-mocking.md +11 -11
- package/skills/playwright-cli/references/running-code.md +28 -28
- package/skills/playwright-cli/references/session-management.md +80 -40
- package/skills/playwright-cli/references/storage-state.md +41 -41
- package/skills/playwright-cli/references/test-generation.md +8 -8
- package/skills/playwright-cli/references/tracing.md +22 -22
- package/skills/playwright-cli/references/video-recording.md +13 -13
|
@@ -11,22 +11,22 @@ This code appears in the output and can be copied directly into your test files.
|
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
# Start a session
|
|
14
|
-
bunx @playwright/cli@
|
|
14
|
+
bunx @playwright/cli@0.1.8 open https://example.com/login
|
|
15
15
|
|
|
16
16
|
# Take a snapshot to see elements
|
|
17
|
-
bunx @playwright/cli@
|
|
17
|
+
bunx @playwright/cli@0.1.8 snapshot
|
|
18
18
|
# Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
|
|
19
19
|
|
|
20
20
|
# Fill form fields - generates code automatically
|
|
21
|
-
bunx @playwright/cli@
|
|
21
|
+
bunx @playwright/cli@0.1.8 fill e1 "user@example.com"
|
|
22
22
|
# Ran Playwright code:
|
|
23
23
|
# await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
|
|
24
24
|
|
|
25
|
-
bunx @playwright/cli@
|
|
25
|
+
bunx @playwright/cli@0.1.8 fill e2 "password123"
|
|
26
26
|
# Ran Playwright code:
|
|
27
27
|
# await page.getByRole('textbox', { name: 'Password' }).fill('password123');
|
|
28
28
|
|
|
29
|
-
bunx @playwright/cli@
|
|
29
|
+
bunx @playwright/cli@0.1.8 click e3
|
|
30
30
|
# Ran Playwright code:
|
|
31
31
|
# await page.getByRole('button', { name: 'Sign In' }).click();
|
|
32
32
|
```
|
|
@@ -69,10 +69,10 @@ await page.locator('#submit-btn').click();
|
|
|
69
69
|
Take snapshots to understand the page structure before recording actions:
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
bunx @playwright/cli@
|
|
73
|
-
bunx @playwright/cli@
|
|
72
|
+
bunx @playwright/cli@0.1.8 open https://example.com
|
|
73
|
+
bunx @playwright/cli@0.1.8 snapshot
|
|
74
74
|
# Review the element structure
|
|
75
|
-
bunx @playwright/cli@
|
|
75
|
+
bunx @playwright/cli@0.1.8 click e5
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### 3. Add Assertions Manually
|
|
@@ -6,15 +6,15 @@ Capture detailed execution traces for debugging and analysis. Traces include DOM
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Start trace recording
|
|
9
|
-
bunx @playwright/cli@
|
|
9
|
+
bunx @playwright/cli@0.1.8 tracing-start
|
|
10
10
|
|
|
11
11
|
# Perform actions
|
|
12
|
-
bunx @playwright/cli@
|
|
13
|
-
bunx @playwright/cli@
|
|
14
|
-
bunx @playwright/cli@
|
|
12
|
+
bunx @playwright/cli@0.1.8 open https://example.com
|
|
13
|
+
bunx @playwright/cli@0.1.8 click e1
|
|
14
|
+
bunx @playwright/cli@0.1.8 fill e2 "test"
|
|
15
15
|
|
|
16
16
|
# Stop trace recording
|
|
17
|
-
bunx @playwright/cli@
|
|
17
|
+
bunx @playwright/cli@0.1.8 tracing-stop
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Trace Output Files
|
|
@@ -67,22 +67,22 @@ When you start tracing, Playwright creates a `traces/` directory with several fi
|
|
|
67
67
|
### Debugging Failed Actions
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
bunx @playwright/cli@
|
|
71
|
-
bunx @playwright/cli@
|
|
70
|
+
bunx @playwright/cli@0.1.8 tracing-start
|
|
71
|
+
bunx @playwright/cli@0.1.8 open https://app.example.com
|
|
72
72
|
|
|
73
73
|
# This click fails - why?
|
|
74
|
-
bunx @playwright/cli@
|
|
74
|
+
bunx @playwright/cli@0.1.8 click e5
|
|
75
75
|
|
|
76
|
-
bunx @playwright/cli@
|
|
76
|
+
bunx @playwright/cli@0.1.8 tracing-stop
|
|
77
77
|
# Open trace to see DOM state when click was attempted
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
### Analyzing Performance
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
bunx @playwright/cli@
|
|
84
|
-
bunx @playwright/cli@
|
|
85
|
-
bunx @playwright/cli@
|
|
83
|
+
bunx @playwright/cli@0.1.8 tracing-start
|
|
84
|
+
bunx @playwright/cli@0.1.8 open https://slow-site.com
|
|
85
|
+
bunx @playwright/cli@0.1.8 tracing-stop
|
|
86
86
|
|
|
87
87
|
# View network waterfall to identify slow resources
|
|
88
88
|
```
|
|
@@ -91,15 +91,15 @@ bunx @playwright/cli@latest tracing-stop
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# Record a complete user flow for documentation
|
|
94
|
-
bunx @playwright/cli@
|
|
94
|
+
bunx @playwright/cli@0.1.8 tracing-start
|
|
95
95
|
|
|
96
|
-
bunx @playwright/cli@
|
|
97
|
-
bunx @playwright/cli@
|
|
98
|
-
bunx @playwright/cli@
|
|
99
|
-
bunx @playwright/cli@
|
|
100
|
-
bunx @playwright/cli@
|
|
96
|
+
bunx @playwright/cli@0.1.8 open https://app.example.com/checkout
|
|
97
|
+
bunx @playwright/cli@0.1.8 fill e1 "4111111111111111"
|
|
98
|
+
bunx @playwright/cli@0.1.8 fill e2 "12/25"
|
|
99
|
+
bunx @playwright/cli@0.1.8 fill e3 "123"
|
|
100
|
+
bunx @playwright/cli@0.1.8 click e4
|
|
101
101
|
|
|
102
|
-
bunx @playwright/cli@
|
|
102
|
+
bunx @playwright/cli@0.1.8 tracing-stop
|
|
103
103
|
# Trace shows exact sequence of events
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -120,10 +120,10 @@ bunx @playwright/cli@latest tracing-stop
|
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
122
|
# Trace the entire flow, not just the failing step
|
|
123
|
-
bunx @playwright/cli@
|
|
124
|
-
bunx @playwright/cli@
|
|
123
|
+
bunx @playwright/cli@0.1.8 tracing-start
|
|
124
|
+
bunx @playwright/cli@0.1.8 open https://example.com
|
|
125
125
|
# ... all steps leading to the issue ...
|
|
126
|
-
bunx @playwright/cli@
|
|
126
|
+
bunx @playwright/cli@0.1.8 tracing-stop
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### 2. Clean Up Old Traces
|
|
@@ -6,25 +6,25 @@ Capture browser automation sessions as video for debugging, documentation, or ve
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Open browser first
|
|
9
|
-
bunx @playwright/cli@
|
|
9
|
+
bunx @playwright/cli@0.1.8 open
|
|
10
10
|
|
|
11
11
|
# Start recording
|
|
12
|
-
bunx @playwright/cli@
|
|
12
|
+
bunx @playwright/cli@0.1.8 video-start demo.webm
|
|
13
13
|
|
|
14
14
|
# Add a chapter marker for section transitions
|
|
15
|
-
bunx @playwright/cli@
|
|
15
|
+
bunx @playwright/cli@0.1.8 video-chapter "Getting Started" --description="Opening the homepage" --duration=2000
|
|
16
16
|
|
|
17
17
|
# Navigate and perform actions
|
|
18
|
-
bunx @playwright/cli@
|
|
19
|
-
bunx @playwright/cli@
|
|
20
|
-
bunx @playwright/cli@
|
|
18
|
+
bunx @playwright/cli@0.1.8 goto https://example.com
|
|
19
|
+
bunx @playwright/cli@0.1.8 snapshot
|
|
20
|
+
bunx @playwright/cli@0.1.8 click e1
|
|
21
21
|
|
|
22
22
|
# Add another chapter
|
|
23
|
-
bunx @playwright/cli@
|
|
24
|
-
bunx @playwright/cli@
|
|
23
|
+
bunx @playwright/cli@0.1.8 video-chapter "Filling Form" --description="Entering test data" --duration=2000
|
|
24
|
+
bunx @playwright/cli@0.1.8 fill e2 "test input"
|
|
25
25
|
|
|
26
26
|
# Stop and save
|
|
27
|
-
bunx @playwright/cli@
|
|
27
|
+
bunx @playwright/cli@0.1.8 video-stop
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Best Practices
|
|
@@ -33,8 +33,8 @@ bunx @playwright/cli@latest video-stop
|
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
# Include context in filename
|
|
36
|
-
bunx @playwright/cli@
|
|
37
|
-
bunx @playwright/cli@
|
|
36
|
+
bunx @playwright/cli@0.1.8 video-start recordings/login-flow-2024-01-15.webm
|
|
37
|
+
bunx @playwright/cli@0.1.8 video-start recordings/checkout-test-run-42.webm
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
### 2. Record entire hero scripts.
|
|
@@ -42,9 +42,9 @@ bunx @playwright/cli@latest video-start recordings/checkout-test-run-42.webm
|
|
|
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
43
|
It allows pulling appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.
|
|
44
44
|
|
|
45
|
-
1. Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request
|
|
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.
|
|
47
|
-
3. Use playwright-cli run-code --
|
|
47
|
+
3. Use playwright-cli run-code --filename your-script.js
|
|
48
48
|
|
|
49
49
|
**Important**: Overlays are `pointer-events: none` — they do not interfere with page interactions. You can safely keep sticky overlays visible while clicking, filling, or performing any actions on the page.
|
|
50
50
|
|