@nickduy/agent-studio 0.1.5 → 0.1.6
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/lib/cli.mjs +1 -1
- package/package.json +1 -1
- package/template/skills/playwright-cli/SKILL.md +493 -493
- package/template/skills/playwright-cli/references/element-attributes.md +23 -23
- package/template/skills/playwright-cli/references/playwright-tests.md +39 -39
- package/template/skills/playwright-cli/references/pr-attachments.md +60 -60
- package/template/skills/playwright-cli/references/request-mocking.md +87 -87
- package/template/skills/playwright-cli/references/running-code.md +247 -247
- package/template/skills/playwright-cli/references/session-management.md +227 -227
- package/template/skills/playwright-cli/references/storage-state.md +278 -278
- package/template/skills/playwright-cli/references/test-generation.md +433 -433
- package/template/skills/playwright-cli/references/tracing.md +146 -146
- package/template/skills/playwright-cli/references/video-recording.md +216 -216
- package/web/assets/index-BKe0FsZ9.css +1 -0
- package/web/assets/{index-CDDFG9KU.js → index-D2uEISZR.js} +48 -48
- package/web/index.html +3 -3
- package/web/assets/index-67XUfTqy.css +0 -1
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
# Tracing
|
|
2
|
-
|
|
3
|
-
Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.
|
|
4
|
-
|
|
5
|
-
## Basic Usage
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Open the browser (tracing needs an open browser)
|
|
9
|
-
playwright-cli open
|
|
10
|
-
|
|
11
|
-
# Start trace recording
|
|
12
|
-
playwright-cli tracing-start
|
|
13
|
-
|
|
14
|
-
# Perform actions
|
|
15
|
-
playwright-cli goto https://example.com
|
|
16
|
-
playwright-cli click e1
|
|
17
|
-
playwright-cli fill e2 "test"
|
|
18
|
-
|
|
19
|
-
# Stop trace recording
|
|
20
|
-
playwright-cli tracing-stop
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Trace Output Files
|
|
24
|
-
|
|
25
|
-
When you start tracing, Playwright creates a `.playwright-cli/traces/` directory with several files:
|
|
26
|
-
|
|
27
|
-
### `trace-{timestamp}.trace`
|
|
28
|
-
|
|
29
|
-
**Action log** - The main trace file containing:
|
|
30
|
-
- Every action performed (clicks, fills, navigations)
|
|
31
|
-
- DOM snapshots before and after each action
|
|
32
|
-
- Screenshots at each step
|
|
33
|
-
- Timing information
|
|
34
|
-
- Console messages
|
|
35
|
-
- Source locations
|
|
36
|
-
|
|
37
|
-
### `trace-{timestamp}.network`
|
|
38
|
-
|
|
39
|
-
**Network log** - Complete network activity:
|
|
40
|
-
- All HTTP requests and responses
|
|
41
|
-
- Request headers and bodies
|
|
42
|
-
- Response headers and bodies
|
|
43
|
-
- Timing (DNS, connect, TLS, TTFB, download)
|
|
44
|
-
- Resource sizes
|
|
45
|
-
- Failed requests and errors
|
|
46
|
-
|
|
47
|
-
### `resources/`
|
|
48
|
-
|
|
49
|
-
**Resources directory** - Cached resources:
|
|
50
|
-
- Images, fonts, stylesheets, scripts
|
|
51
|
-
- Response bodies for replay
|
|
52
|
-
- Assets needed to reconstruct page state
|
|
53
|
-
|
|
54
|
-
## What Traces Capture
|
|
55
|
-
|
|
56
|
-
| Category | Details |
|
|
57
|
-
|----------|---------|
|
|
58
|
-
| **Actions** | Clicks, fills, hovers, keyboard input, navigations |
|
|
59
|
-
| **DOM** | Full DOM snapshot before/after each action |
|
|
60
|
-
| **Screenshots** | Visual state at each step |
|
|
61
|
-
| **Network** | All requests, responses, headers, bodies, timing |
|
|
62
|
-
| **Console** | All console.log, warn, error messages |
|
|
63
|
-
| **Timing** | Precise timing for each operation |
|
|
64
|
-
|
|
65
|
-
## Use Cases
|
|
66
|
-
|
|
67
|
-
### Debugging Failed Actions
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
playwright-cli open
|
|
71
|
-
playwright-cli tracing-start
|
|
72
|
-
playwright-cli goto https://app.example.com
|
|
73
|
-
|
|
74
|
-
# This click fails - why?
|
|
75
|
-
playwright-cli click e5
|
|
76
|
-
|
|
77
|
-
playwright-cli tracing-stop
|
|
78
|
-
# Open trace to see DOM state when click was attempted
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Analyzing Performance
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
playwright-cli open
|
|
85
|
-
playwright-cli tracing-start
|
|
86
|
-
playwright-cli goto https://slow-site.com
|
|
87
|
-
playwright-cli tracing-stop
|
|
88
|
-
|
|
89
|
-
# View network waterfall to identify slow resources
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Capturing Evidence
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# Record a complete user flow for documentation
|
|
96
|
-
playwright-cli open
|
|
97
|
-
playwright-cli tracing-start
|
|
98
|
-
|
|
99
|
-
playwright-cli goto https://app.example.com/checkout
|
|
100
|
-
playwright-cli fill e1 "4111111111111111"
|
|
101
|
-
playwright-cli fill e2 "12/25"
|
|
102
|
-
playwright-cli fill e3 "123"
|
|
103
|
-
playwright-cli click e4
|
|
104
|
-
|
|
105
|
-
playwright-cli tracing-stop
|
|
106
|
-
# Trace shows exact sequence of events
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Trace vs Video vs Screenshot
|
|
110
|
-
|
|
111
|
-
| Feature | Trace | Video | Screenshot |
|
|
112
|
-
|---------|-------|-------|------------|
|
|
113
|
-
| **Format** | .trace file | .webm video | .png/.jpeg image |
|
|
114
|
-
| **DOM inspection** | Yes | No | No |
|
|
115
|
-
| **Network details** | Yes | No | No |
|
|
116
|
-
| **Step-by-step replay** | Yes | Continuous | Single frame |
|
|
117
|
-
| **File size** | Medium | Large | Small |
|
|
118
|
-
| **Best for** | Debugging | Demos | Quick capture |
|
|
119
|
-
|
|
120
|
-
## Best Practices
|
|
121
|
-
|
|
122
|
-
### 1. Start Tracing Before the Problem
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# Trace the entire flow, not just the failing step
|
|
126
|
-
playwright-cli open
|
|
127
|
-
playwright-cli tracing-start
|
|
128
|
-
playwright-cli goto https://example.com
|
|
129
|
-
# ... all steps leading to the issue ...
|
|
130
|
-
playwright-cli tracing-stop
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 2. Clean Up Old Traces
|
|
134
|
-
|
|
135
|
-
Traces can consume significant disk space:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# Remove traces older than 7 days
|
|
139
|
-
find .playwright-cli/traces -mtime +7 -delete
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Limitations
|
|
143
|
-
|
|
144
|
-
- Traces add overhead to automation
|
|
145
|
-
- Large traces can consume significant disk space
|
|
146
|
-
- Some dynamic content may not replay perfectly
|
|
1
|
+
# Tracing
|
|
2
|
+
|
|
3
|
+
Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Open the browser (tracing needs an open browser)
|
|
9
|
+
playwright-cli open
|
|
10
|
+
|
|
11
|
+
# Start trace recording
|
|
12
|
+
playwright-cli tracing-start
|
|
13
|
+
|
|
14
|
+
# Perform actions
|
|
15
|
+
playwright-cli goto https://example.com
|
|
16
|
+
playwright-cli click e1
|
|
17
|
+
playwright-cli fill e2 "test"
|
|
18
|
+
|
|
19
|
+
# Stop trace recording
|
|
20
|
+
playwright-cli tracing-stop
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Trace Output Files
|
|
24
|
+
|
|
25
|
+
When you start tracing, Playwright creates a `.playwright-cli/traces/` directory with several files:
|
|
26
|
+
|
|
27
|
+
### `trace-{timestamp}.trace`
|
|
28
|
+
|
|
29
|
+
**Action log** - The main trace file containing:
|
|
30
|
+
- Every action performed (clicks, fills, navigations)
|
|
31
|
+
- DOM snapshots before and after each action
|
|
32
|
+
- Screenshots at each step
|
|
33
|
+
- Timing information
|
|
34
|
+
- Console messages
|
|
35
|
+
- Source locations
|
|
36
|
+
|
|
37
|
+
### `trace-{timestamp}.network`
|
|
38
|
+
|
|
39
|
+
**Network log** - Complete network activity:
|
|
40
|
+
- All HTTP requests and responses
|
|
41
|
+
- Request headers and bodies
|
|
42
|
+
- Response headers and bodies
|
|
43
|
+
- Timing (DNS, connect, TLS, TTFB, download)
|
|
44
|
+
- Resource sizes
|
|
45
|
+
- Failed requests and errors
|
|
46
|
+
|
|
47
|
+
### `resources/`
|
|
48
|
+
|
|
49
|
+
**Resources directory** - Cached resources:
|
|
50
|
+
- Images, fonts, stylesheets, scripts
|
|
51
|
+
- Response bodies for replay
|
|
52
|
+
- Assets needed to reconstruct page state
|
|
53
|
+
|
|
54
|
+
## What Traces Capture
|
|
55
|
+
|
|
56
|
+
| Category | Details |
|
|
57
|
+
|----------|---------|
|
|
58
|
+
| **Actions** | Clicks, fills, hovers, keyboard input, navigations |
|
|
59
|
+
| **DOM** | Full DOM snapshot before/after each action |
|
|
60
|
+
| **Screenshots** | Visual state at each step |
|
|
61
|
+
| **Network** | All requests, responses, headers, bodies, timing |
|
|
62
|
+
| **Console** | All console.log, warn, error messages |
|
|
63
|
+
| **Timing** | Precise timing for each operation |
|
|
64
|
+
|
|
65
|
+
## Use Cases
|
|
66
|
+
|
|
67
|
+
### Debugging Failed Actions
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
playwright-cli open
|
|
71
|
+
playwright-cli tracing-start
|
|
72
|
+
playwright-cli goto https://app.example.com
|
|
73
|
+
|
|
74
|
+
# This click fails - why?
|
|
75
|
+
playwright-cli click e5
|
|
76
|
+
|
|
77
|
+
playwright-cli tracing-stop
|
|
78
|
+
# Open trace to see DOM state when click was attempted
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Analyzing Performance
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
playwright-cli open
|
|
85
|
+
playwright-cli tracing-start
|
|
86
|
+
playwright-cli goto https://slow-site.com
|
|
87
|
+
playwright-cli tracing-stop
|
|
88
|
+
|
|
89
|
+
# View network waterfall to identify slow resources
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Capturing Evidence
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Record a complete user flow for documentation
|
|
96
|
+
playwright-cli open
|
|
97
|
+
playwright-cli tracing-start
|
|
98
|
+
|
|
99
|
+
playwright-cli goto https://app.example.com/checkout
|
|
100
|
+
playwright-cli fill e1 "4111111111111111"
|
|
101
|
+
playwright-cli fill e2 "12/25"
|
|
102
|
+
playwright-cli fill e3 "123"
|
|
103
|
+
playwright-cli click e4
|
|
104
|
+
|
|
105
|
+
playwright-cli tracing-stop
|
|
106
|
+
# Trace shows exact sequence of events
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Trace vs Video vs Screenshot
|
|
110
|
+
|
|
111
|
+
| Feature | Trace | Video | Screenshot |
|
|
112
|
+
|---------|-------|-------|------------|
|
|
113
|
+
| **Format** | .trace file | .webm video | .png/.jpeg image |
|
|
114
|
+
| **DOM inspection** | Yes | No | No |
|
|
115
|
+
| **Network details** | Yes | No | No |
|
|
116
|
+
| **Step-by-step replay** | Yes | Continuous | Single frame |
|
|
117
|
+
| **File size** | Medium | Large | Small |
|
|
118
|
+
| **Best for** | Debugging | Demos | Quick capture |
|
|
119
|
+
|
|
120
|
+
## Best Practices
|
|
121
|
+
|
|
122
|
+
### 1. Start Tracing Before the Problem
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Trace the entire flow, not just the failing step
|
|
126
|
+
playwright-cli open
|
|
127
|
+
playwright-cli tracing-start
|
|
128
|
+
playwright-cli goto https://example.com
|
|
129
|
+
# ... all steps leading to the issue ...
|
|
130
|
+
playwright-cli tracing-stop
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 2. Clean Up Old Traces
|
|
134
|
+
|
|
135
|
+
Traces can consume significant disk space:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Remove traces older than 7 days
|
|
139
|
+
find .playwright-cli/traces -mtime +7 -delete
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Limitations
|
|
143
|
+
|
|
144
|
+
- Traces add overhead to automation
|
|
145
|
+
- Large traces can consume significant disk space
|
|
146
|
+
- Some dynamic content may not replay perfectly
|