@assertrx/dino 1.0.0
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/README.md +293 -0
- package/extensions/dino.ts +70 -0
- package/extensions/mabl-mcp.ts +306 -0
- package/extensions/playwright-mcp.ts +142 -0
- package/package.json +47 -0
- package/prompts/create-pr.md +110 -0
- package/prompts/generate-bdd-from-url.md +65 -0
- package/prompts/generate-pom-from-url-cli.md +48 -0
- package/prompts/generate-pom-from-url.md +45 -0
- package/prompts/generate-spec-from-feature.md +64 -0
- package/prompts/heal-playwright-failures.md +106 -0
- package/prompts/setup-playwright.md +81 -0
- package/scripts/start-dino.cmd +8 -0
- package/scripts/start-dino.mjs +226 -0
- package/scripts/start-dino.ps1 +9 -0
- package/scripts/start-dino.sh +10 -0
- package/skills/acli/SKILL.md +292 -0
- package/skills/bdd-gherkin/SKILL.md +552 -0
- package/skills/build-review-interface/SKILL.md +96 -0
- package/skills/error-analysis/SKILL.md +164 -0
- package/skills/eval-audit/SKILL.md +183 -0
- package/skills/evaluate-rag/SKILL.md +177 -0
- package/skills/generate-synthetic-data/SKILL.md +131 -0
- package/skills/mabl-mcp/SKILL.md +79 -0
- package/skills/playwright-cli/SKILL.md +246 -0
- package/skills/playwright-cli/advanced-workflows.md +679 -0
- package/skills/playwright-cli/core-commands.md +375 -0
- package/skills/playwright-cli/device-emulation.md +475 -0
- package/skills/playwright-cli/request-mocking.md +373 -0
- package/skills/playwright-cli/running-custom-code.md +553 -0
- package/skills/playwright-cli/screenshots-and-media.md +457 -0
- package/skills/playwright-cli/session-management.md +425 -0
- package/skills/playwright-cli/storage-and-auth.md +487 -0
- package/skills/playwright-cli/test-generation.md +336 -0
- package/skills/playwright-cli/tracing-and-debugging.md +501 -0
- package/skills/playwright-core/SKILL.md +101 -0
- package/skills/playwright-core/accessibility.md +1517 -0
- package/skills/playwright-core/angular.md +1086 -0
- package/skills/playwright-core/api-testing.md +1623 -0
- package/skills/playwright-core/assertions-and-waiting.md +703 -0
- package/skills/playwright-core/auth-flows.md +1081 -0
- package/skills/playwright-core/authentication.md +1409 -0
- package/skills/playwright-core/browser-apis.md +673 -0
- package/skills/playwright-core/browser-extensions.md +319 -0
- package/skills/playwright-core/canvas-and-webgl.md +494 -0
- package/skills/playwright-core/clock-and-time-mocking.md +427 -0
- package/skills/playwright-core/common-pitfalls.md +1318 -0
- package/skills/playwright-core/component-testing.md +1179 -0
- package/skills/playwright-core/configuration.md +731 -0
- package/skills/playwright-core/crud-testing.md +945 -0
- package/skills/playwright-core/debugging.md +827 -0
- package/skills/playwright-core/drag-and-drop.md +992 -0
- package/skills/playwright-core/electron-testing.md +622 -0
- package/skills/playwright-core/error-and-edge-cases.md +1181 -0
- package/skills/playwright-core/error-index.md +1903 -0
- package/skills/playwright-core/file-operations.md +749 -0
- package/skills/playwright-core/file-upload-download.md +1012 -0
- package/skills/playwright-core/fixtures-and-hooks.md +1072 -0
- package/skills/playwright-core/flaky-tests.md +883 -0
- package/skills/playwright-core/forms-and-validation.md +1056 -0
- package/skills/playwright-core/i18n-and-localization.md +622 -0
- package/skills/playwright-core/iframes-and-shadow-dom.md +488 -0
- package/skills/playwright-core/locator-strategy.md +588 -0
- package/skills/playwright-core/locators.md +743 -0
- package/skills/playwright-core/mobile-and-responsive.md +1669 -0
- package/skills/playwright-core/multi-context-and-popups.md +581 -0
- package/skills/playwright-core/multi-user-and-collaboration.md +477 -0
- package/skills/playwright-core/network-mocking.md +1395 -0
- package/skills/playwright-core/nextjs.md +1013 -0
- package/skills/playwright-core/performance-testing.md +608 -0
- package/skills/playwright-core/react.md +1082 -0
- package/skills/playwright-core/search-and-filter.md +1366 -0
- package/skills/playwright-core/security-testing.md +624 -0
- package/skills/playwright-core/service-workers-and-pwa.md +524 -0
- package/skills/playwright-core/test-architecture.md +569 -0
- package/skills/playwright-core/test-data-management.md +1209 -0
- package/skills/playwright-core/test-organization.md +947 -0
- package/skills/playwright-core/third-party-integrations.md +754 -0
- package/skills/playwright-core/trace-analysis.md +161 -0
- package/skills/playwright-core/visual-regression.md +1027 -0
- package/skills/playwright-core/vue.md +1162 -0
- package/skills/playwright-core/websockets-and-realtime.md +623 -0
- package/skills/playwright-core/when-to-mock.md +827 -0
- package/skills/playwright-pom/SKILL.md +94 -0
- package/skills/playwright-pom/page-object-model.md +921 -0
- package/skills/playwright-pom/pom-vs-fixtures-vs-helpers.md +937 -0
- package/skills/validate-evaluator/SKILL.md +215 -0
- package/skills/write-judge-prompt/SKILL.md +144 -0
- package/themes/dino.json +66 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# Core Commands
|
|
2
|
+
|
|
3
|
+
> **When to use**: Starting browser automation sessions, navigating pages, interacting with elements, filling forms, and performing basic browser operations via the CLI.
|
|
4
|
+
> **Prerequisites**: `playwright-cli install --skills && playwright-cli install-browser`
|
|
5
|
+
|
|
6
|
+
## Quick Reference
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
playwright-cli open https://example.com # Launch + navigate
|
|
10
|
+
playwright-cli snapshot # See all interactive elements
|
|
11
|
+
playwright-cli fill e1 "user@example.com" # Fill an input field
|
|
12
|
+
playwright-cli click e3 # Click a button
|
|
13
|
+
playwright-cli screenshot --filename=pg.png # Capture the page
|
|
14
|
+
playwright-cli close # Done
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## The Snapshot Workflow
|
|
18
|
+
|
|
19
|
+
Every interaction starts with a **snapshot**. The snapshot command renders the page's accessibility tree and assigns short refs (like `e1`, `e2`, `e3`) to each interactive element.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
playwright-cli open https://example.com/login
|
|
23
|
+
playwright-cli snapshot
|
|
24
|
+
# Output:
|
|
25
|
+
# e1 [textbox "Email"]
|
|
26
|
+
# e2 [textbox "Password"]
|
|
27
|
+
# e3 [button "Sign In"]
|
|
28
|
+
# e4 [link "Forgot password?"]
|
|
29
|
+
# e5 [link "Create account"]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Use refs to target elements precisely:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
playwright-cli fill e1 "user@example.com"
|
|
36
|
+
playwright-cli fill e2 "secretpassword"
|
|
37
|
+
playwright-cli click e3
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Always re-snapshot after page changes** — refs are only valid for the current page state. After navigation, form submission, or dynamic content updates, take a new snapshot.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
playwright-cli click e3 # Submit form
|
|
44
|
+
playwright-cli snapshot # Re-snapshot to see new page elements
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Saving Snapshots
|
|
48
|
+
|
|
49
|
+
Save snapshots to YAML files for later reference or comparison:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
playwright-cli snapshot --filename=before-submit.yaml
|
|
53
|
+
playwright-cli click e3
|
|
54
|
+
playwright-cli snapshot --filename=after-submit.yaml
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Opening & Closing Browsers
|
|
58
|
+
|
|
59
|
+
### Basic Launch
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Open browser with blank page
|
|
63
|
+
playwright-cli open
|
|
64
|
+
|
|
65
|
+
# Open and navigate immediately
|
|
66
|
+
playwright-cli open https://example.com
|
|
67
|
+
|
|
68
|
+
# Open with specific browser engine
|
|
69
|
+
playwright-cli open --browser=chrome # Google Chrome
|
|
70
|
+
playwright-cli open --browser=firefox # Mozilla Firefox
|
|
71
|
+
playwright-cli open --browser=webkit # Safari/WebKit
|
|
72
|
+
playwright-cli open --browser=msedge # Microsoft Edge
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Persistent Profiles
|
|
76
|
+
|
|
77
|
+
By default, each session runs in-memory — no cookies or storage persist after closing. Use `--persistent` to keep state across restarts:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Auto-generated profile directory
|
|
81
|
+
playwright-cli open https://example.com --persistent
|
|
82
|
+
|
|
83
|
+
# Custom profile directory
|
|
84
|
+
playwright-cli open https://example.com --profile=/tmp/my-profile
|
|
85
|
+
|
|
86
|
+
# With a config file
|
|
87
|
+
playwright-cli open https://example.com --config=my-config.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Browser Extension Mode
|
|
91
|
+
|
|
92
|
+
Connect to an existing browser via extension instead of launching a new one:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
playwright-cli open --extension
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Closing
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
playwright-cli close # Close the current browser
|
|
102
|
+
playwright-cli close-all # Close all open browsers
|
|
103
|
+
playwright-cli kill-all # Force kill zombie processes
|
|
104
|
+
playwright-cli delete-data # Delete stored profile data
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Navigation
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
playwright-cli goto https://example.com/dashboard # Navigate to URL
|
|
111
|
+
playwright-cli go-back # Browser back
|
|
112
|
+
playwright-cli go-forward # Browser forward
|
|
113
|
+
playwright-cli reload # Refresh page
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Waiting for Navigation
|
|
117
|
+
|
|
118
|
+
After actions that trigger navigation (form submits, link clicks), the CLI waits for the page to reach `load` state before returning. If you need to wait for specific conditions, use `run-code`:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
playwright-cli run-code "async page => {
|
|
122
|
+
await page.waitForURL('**/dashboard');
|
|
123
|
+
}"
|
|
124
|
+
|
|
125
|
+
# Wait for network to settle
|
|
126
|
+
playwright-cli run-code "async page => {
|
|
127
|
+
await page.waitForLoadState('networkidle');
|
|
128
|
+
}"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Element Interaction
|
|
132
|
+
|
|
133
|
+
### Clicking
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
playwright-cli click e3 # Standard left click
|
|
137
|
+
playwright-cli dblclick e7 # Double click
|
|
138
|
+
playwright-cli hover e4 # Hover without clicking
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Form Input
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# fill: clears existing value, then types the full value at once
|
|
145
|
+
playwright-cli fill e5 "user@example.com"
|
|
146
|
+
|
|
147
|
+
# type: sends keystrokes one by one (triggers keydown/keypress/keyup per char)
|
|
148
|
+
playwright-cli type "search query"
|
|
149
|
+
|
|
150
|
+
# select: choose dropdown option by value
|
|
151
|
+
playwright-cli select e9 "option-value"
|
|
152
|
+
|
|
153
|
+
# check/uncheck: toggle checkboxes
|
|
154
|
+
playwright-cli check e12
|
|
155
|
+
playwright-cli uncheck e12
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**When to use `fill` vs `type`**:
|
|
159
|
+
|
|
160
|
+
| Command | Behavior | Use when |
|
|
161
|
+
|---------|----------|----------|
|
|
162
|
+
| `fill` | Clears field, sets value at once | Forms, login fields, standard inputs |
|
|
163
|
+
| `type` | Sends individual keystrokes | Autocomplete, search-as-you-type, custom inputs that listen for keydown events |
|
|
164
|
+
|
|
165
|
+
### File Upload
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
playwright-cli upload e8 ./document.pdf
|
|
169
|
+
playwright-cli upload e8 ./photo1.jpg ./photo2.jpg # Multiple files
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Drag and Drop
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
playwright-cli drag e2 e8 # Drag element e2 onto element e8
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Viewport Resizing
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
playwright-cli resize 1920 1080 # Desktop
|
|
182
|
+
playwright-cli resize 375 812 # iPhone X viewport
|
|
183
|
+
playwright-cli resize 768 1024 # iPad viewport
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Keyboard Input
|
|
187
|
+
|
|
188
|
+
### Single Key Presses
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
playwright-cli press Enter
|
|
192
|
+
playwright-cli press Tab
|
|
193
|
+
playwright-cli press Escape
|
|
194
|
+
playwright-cli press Backspace
|
|
195
|
+
playwright-cli press Delete
|
|
196
|
+
playwright-cli press Space
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Arrow Keys
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
playwright-cli press ArrowUp
|
|
203
|
+
playwright-cli press ArrowDown
|
|
204
|
+
playwright-cli press ArrowLeft
|
|
205
|
+
playwright-cli press ArrowRight
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Modifier Key Combos
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
playwright-cli press Control+a # Select all
|
|
212
|
+
playwright-cli press Control+c # Copy
|
|
213
|
+
playwright-cli press Control+v # Paste
|
|
214
|
+
playwright-cli press Control+z # Undo
|
|
215
|
+
playwright-cli press Meta+a # Select all (macOS Cmd+A)
|
|
216
|
+
playwright-cli press Shift+Tab # Reverse tab
|
|
217
|
+
playwright-cli press Alt+Enter # Alt+Enter
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Hold and Release Keys
|
|
221
|
+
|
|
222
|
+
For drag operations or multi-key sequences:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
playwright-cli keydown Shift
|
|
226
|
+
playwright-cli click e5 # Shift+click
|
|
227
|
+
playwright-cli click e8 # Shift+click (range selection)
|
|
228
|
+
playwright-cli keyup Shift
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Mouse Control
|
|
232
|
+
|
|
233
|
+
For pixel-precise operations (canvas, maps, custom widgets):
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
playwright-cli mousemove 150 300 # Move cursor to coordinates
|
|
237
|
+
playwright-cli mousedown # Press left button
|
|
238
|
+
playwright-cli mouseup # Release left button
|
|
239
|
+
playwright-cli mousedown right # Right click down
|
|
240
|
+
playwright-cli mouseup right # Right click up
|
|
241
|
+
playwright-cli mousewheel 0 100 # Scroll down 100px
|
|
242
|
+
playwright-cli mousewheel 0 -100 # Scroll up 100px
|
|
243
|
+
playwright-cli mousewheel 100 0 # Scroll right 100px
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Drawing on Canvas
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
playwright-cli open https://example.com/canvas-app
|
|
250
|
+
playwright-cli mousemove 100 100
|
|
251
|
+
playwright-cli mousedown
|
|
252
|
+
playwright-cli mousemove 200 200
|
|
253
|
+
playwright-cli mousemove 300 150
|
|
254
|
+
playwright-cli mouseup
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Dialog Handling
|
|
258
|
+
|
|
259
|
+
Dialogs (`alert`, `confirm`, `prompt`) block browser interaction. Handle them immediately:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
# Accept an alert or confirm dialog
|
|
263
|
+
playwright-cli dialog-accept
|
|
264
|
+
|
|
265
|
+
# Accept a prompt dialog with input text
|
|
266
|
+
playwright-cli dialog-accept "my response"
|
|
267
|
+
|
|
268
|
+
# Dismiss/cancel a dialog
|
|
269
|
+
playwright-cli dialog-dismiss
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Tip**: If you expect a dialog to appear from a click, configure handling via `run-code` before triggering the action:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
playwright-cli run-code "async page => {
|
|
276
|
+
page.on('dialog', dialog => dialog.accept('confirmed'));
|
|
277
|
+
}"
|
|
278
|
+
playwright-cli click e5 # This triggers the dialog
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## JavaScript Evaluation
|
|
282
|
+
|
|
283
|
+
Execute JavaScript expressions directly in the page context:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Simple expressions
|
|
287
|
+
playwright-cli eval "document.title"
|
|
288
|
+
playwright-cli eval "window.location.href"
|
|
289
|
+
playwright-cli eval "document.querySelectorAll('li').length"
|
|
290
|
+
|
|
291
|
+
# Evaluate on a specific element
|
|
292
|
+
playwright-cli eval "el => el.textContent" e5
|
|
293
|
+
playwright-cli eval "el => el.getAttribute('href')" e3
|
|
294
|
+
playwright-cli eval "el => el.getBoundingClientRect()" e1
|
|
295
|
+
|
|
296
|
+
# Complex evaluation
|
|
297
|
+
playwright-cli eval "JSON.stringify(performance.timing)"
|
|
298
|
+
playwright-cli eval "window.innerWidth + 'x' + window.innerHeight"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Example Workflows
|
|
302
|
+
|
|
303
|
+
### Login Flow
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
playwright-cli open https://app.example.com/login
|
|
307
|
+
playwright-cli snapshot
|
|
308
|
+
|
|
309
|
+
playwright-cli fill e1 "admin@example.com"
|
|
310
|
+
playwright-cli fill e2 "password123"
|
|
311
|
+
playwright-cli click e3
|
|
312
|
+
playwright-cli snapshot # See the dashboard
|
|
313
|
+
playwright-cli screenshot --filename=dashboard.png
|
|
314
|
+
playwright-cli close
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Form Submission with Validation
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
playwright-cli open https://example.com/contact
|
|
321
|
+
playwright-cli snapshot
|
|
322
|
+
|
|
323
|
+
# Fill form fields
|
|
324
|
+
playwright-cli fill e1 "Jane Doe"
|
|
325
|
+
playwright-cli fill e2 "jane@example.com"
|
|
326
|
+
playwright-cli fill e3 "+1-555-0123"
|
|
327
|
+
playwright-cli select e4 "support"
|
|
328
|
+
playwright-cli fill e5 "I need help with my account"
|
|
329
|
+
playwright-cli check e6 # Agree to terms
|
|
330
|
+
|
|
331
|
+
# Submit
|
|
332
|
+
playwright-cli click e7
|
|
333
|
+
playwright-cli snapshot # Verify success message
|
|
334
|
+
playwright-cli close
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Search and Navigate Results
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
playwright-cli open https://example.com
|
|
341
|
+
playwright-cli snapshot
|
|
342
|
+
|
|
343
|
+
playwright-cli fill e1 "playwright automation"
|
|
344
|
+
playwright-cli press Enter
|
|
345
|
+
playwright-cli snapshot # See search results
|
|
346
|
+
|
|
347
|
+
playwright-cli click e5 # Click first result
|
|
348
|
+
playwright-cli snapshot # See result page
|
|
349
|
+
playwright-cli go-back # Return to results
|
|
350
|
+
playwright-cli close
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Multi-Tab Research
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
playwright-cli open https://docs.example.com
|
|
357
|
+
playwright-cli tab-new https://api.example.com/reference
|
|
358
|
+
playwright-cli tab-new https://github.com/example/repo
|
|
359
|
+
|
|
360
|
+
playwright-cli tab-list # See all 3 tabs
|
|
361
|
+
playwright-cli tab-select 0 # Go to docs tab
|
|
362
|
+
playwright-cli snapshot
|
|
363
|
+
playwright-cli tab-select 2 # Go to GitHub tab
|
|
364
|
+
playwright-cli snapshot
|
|
365
|
+
|
|
366
|
+
playwright-cli close # Closes all tabs
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Tips
|
|
370
|
+
|
|
371
|
+
- **Snapshot frequently**: After every action that changes the page, re-snapshot to get fresh refs
|
|
372
|
+
- **Use `fill` for forms**: It's faster and more reliable than `type` for standard inputs
|
|
373
|
+
- **Viewport matters**: Use `resize` to test responsive layouts before taking screenshots
|
|
374
|
+
- **Chain with `run-code`**: When CLI commands feel limiting, drop into the full Playwright API
|
|
375
|
+
- **Check `console`**: Run `playwright-cli console` to see JavaScript errors that might explain unexpected behavior
|