prowl-tools 0.1.6 → 0.1.7
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 +334 -183
- package/dist/{chunk-WHAMB4TY.js → chunk-O3OUTZ2P.js} +18 -2
- package/dist/{chunk-WHAMB4TY.js.map → chunk-O3OUTZ2P.js.map} +1 -1
- package/dist/{chunk-5KQR3IR3.js → chunk-R7NUH44M.js} +551 -107
- package/dist/chunk-R7NUH44M.js.map +1 -0
- package/dist/index.cjs +691 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +108 -13
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +693 -220
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.d.cts +164 -7
- package/dist/lib.d.ts +164 -7
- package/dist/lib.js +58 -4
- package/dist/{loader-PBBYV3U7.js → loader-X37URHUV.js} +2 -2
- package/examples/hunts/hello.yml +1 -1
- package/examples/hunts/login-flow.yml +58 -0
- package/package.json +6 -3
- package/dist/chunk-5KQR3IR3.js.map +0 -1
- /package/dist/{loader-PBBYV3U7.js.map → loader-X37URHUV.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,12 +1,53 @@
|
|
|
1
1
|
# Prowl
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
End-to-end testing for **native macOS apps and web apps** — from the same
|
|
4
|
+
declarative YAML.
|
|
4
5
|
|
|
5
6
|
<!-- ILLUSTRATION: Prowl raccoon mascot hero image — cyan raccoon with terminal window showing pass/fail output -->
|
|
6
7
|
|
|
7
|
-
Write
|
|
8
|
+
Write a test (a "hunt") in YAML, run it from the terminal, and get screenshots,
|
|
9
|
+
traces, and reports automatically. The same step vocabulary — `click`, `fill`,
|
|
10
|
+
`assert` — drives a macOS app through Apple's Accessibility API and a web app
|
|
11
|
+
through Playwright. One tool, one file format, both targets.
|
|
12
|
+
|
|
13
|
+
**Desktop-first.** The macOS target — menu-bar extras (`NSStatusItem`) included —
|
|
14
|
+
is the gap no other tool fills: [Maestro](https://maestro.mobile.dev) targets
|
|
15
|
+
mobile and web, [Playwright](https://playwright.dev) is web-only, and
|
|
16
|
+
[XCUITest](https://developer.apple.com/documentation/xctest) means Swift and
|
|
17
|
+
Xcode. Web is Prowl's second first-class target; iOS and Android are
|
|
18
|
+
experimental. The macOS target is **experimental today** — install its signed
|
|
19
|
+
helper with `prowl macdriver install` (see
|
|
20
|
+
[macOS Target](#macos-target-experimental)) — but it's where Prowl leads.
|
|
21
|
+
|
|
22
|
+
**Native macOS app** — driven through the Accessibility API:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
# .prowl/config.yml → target: { type: macos, app: "com.example.App" }
|
|
26
|
+
# .prowl/hunts/save-note.yml
|
|
27
|
+
name: save-note
|
|
28
|
+
steps:
|
|
29
|
+
- click: "id=newNote"
|
|
30
|
+
- type: "Buy milk"
|
|
31
|
+
- click: "id=saveButton"
|
|
32
|
+
- assert:
|
|
33
|
+
visible: "Saved"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
● Running hunt: save-note
|
|
38
|
+
✓ click "id=newNote" (90ms)
|
|
39
|
+
✓ type "Buy milk" (40ms)
|
|
40
|
+
✓ click "id=saveButton" (110ms)
|
|
41
|
+
✓ assert visible "Saved" (12ms)
|
|
42
|
+
|
|
43
|
+
PASS save-note (252ms) 4/4 steps
|
|
44
|
+
Artifacts: .prowl/runs/2026-02-09_10-30-45
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Web app** — driven through Playwright:
|
|
8
48
|
|
|
9
49
|
```yaml
|
|
50
|
+
# .prowl/config.yml → target: { type: web, url: "http://localhost:3000" }
|
|
10
51
|
# .prowl/hunts/login-flow.yml
|
|
11
52
|
name: login-flow
|
|
12
53
|
steps:
|
|
@@ -20,7 +61,7 @@ steps:
|
|
|
20
61
|
visible: "Dashboard"
|
|
21
62
|
```
|
|
22
63
|
|
|
23
|
-
```
|
|
64
|
+
```text
|
|
24
65
|
● Running hunt: login-flow
|
|
25
66
|
✓ navigate "/login" (120ms)
|
|
26
67
|
✓ fill "Email" (85ms)
|
|
@@ -32,6 +73,23 @@ steps:
|
|
|
32
73
|
Artifacts: .prowl/runs/2026-02-09_10-30-45
|
|
33
74
|
```
|
|
34
75
|
|
|
76
|
+
## Why Prowl
|
|
77
|
+
|
|
78
|
+
- **Desktop-first, from the same YAML.** Native macOS apps (Accessibility API)
|
|
79
|
+
and web apps (Playwright) share one step vocabulary, one config, one report
|
|
80
|
+
format. No incumbent covers the Mac desktop the way Prowl aims to.
|
|
81
|
+
- **Deterministic.** Explicit scripted steps — no natural-language guessing.
|
|
82
|
+
- **Developer-ready artifacts.** Every run writes screenshots, a Playwright
|
|
83
|
+
trace, a console log, and both human- (`summary.md`) and machine-readable
|
|
84
|
+
(`result.json`) reports.
|
|
85
|
+
- **Self-sovereign & file-based.** Hunts, run history, and baselines live in
|
|
86
|
+
your repo. No database, no account, no service to sign up for.
|
|
87
|
+
- **Guardrails built in.** Allowed domains/apps, forbidden selectors, and step
|
|
88
|
+
caps keep runs scoped and safe.
|
|
89
|
+
|
|
90
|
+
Additional experimental targets — iOS Simulator and Android — follow the same
|
|
91
|
+
hunt format; see their sections below.
|
|
92
|
+
|
|
35
93
|
---
|
|
36
94
|
|
|
37
95
|
## Getting Started
|
|
@@ -87,20 +145,23 @@ prowl init
|
|
|
87
145
|
|
|
88
146
|
<!-- ILLUSTRATION: Terminal screenshot showing `prowl init` output with raccoon mascot and file listing -->
|
|
89
147
|
|
|
90
|
-
This creates a `.prowl/` directory with a config file and
|
|
148
|
+
This creates a `.prowl/` directory with a config file and two starter hunts:
|
|
91
149
|
|
|
92
150
|
```text
|
|
93
151
|
.prowl/
|
|
94
|
-
├── config.yml
|
|
152
|
+
├── config.yml # Target URL, browser settings, guardrails
|
|
153
|
+
├── .gitignore # Keeps runs/, auth-state.json, and .env out of git
|
|
95
154
|
└── hunts/
|
|
96
|
-
├──
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
155
|
+
├── hello.yml # Minimal smoke test — verifies the app loads
|
|
156
|
+
└── login-flow.yml # Fuller example — auth, secrets, assertions
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`prowl init` finishes by pointing you at the first hunt:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
Initialized .prowl directory.
|
|
163
|
+
Run prowl run hello to get started.
|
|
164
|
+
See .prowl/hunts/login-flow.yml for a fuller example.
|
|
104
165
|
```
|
|
105
166
|
|
|
106
167
|
### 3. Configure
|
|
@@ -112,11 +173,26 @@ target:
|
|
|
112
173
|
url: "http://localhost:3000"
|
|
113
174
|
```
|
|
114
175
|
|
|
115
|
-
### 4.
|
|
176
|
+
### 4. Run the starter hunt
|
|
116
177
|
|
|
117
|
-
|
|
178
|
+
Run the bundled `hello` hunt to confirm your app is reachable:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
prowl run hello
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
<!-- ILLUSTRATION: Terminal screenshot showing colorized pass/fail output with step timings -->
|
|
185
|
+
|
|
186
|
+
A hunt's name is its **file name** under `.prowl/hunts/` — `hello` runs
|
|
187
|
+
`.prowl/hunts/hello.yml`.
|
|
188
|
+
|
|
189
|
+
### 5. Write your own hunt
|
|
190
|
+
|
|
191
|
+
Create a new file `.prowl/hunts/smoke-test.yml`. The file name *is* the hunt
|
|
192
|
+
name, so this hunt runs as `smoke-test`:
|
|
118
193
|
|
|
119
194
|
```yaml
|
|
195
|
+
# .prowl/hunts/smoke-test.yml
|
|
120
196
|
name: smoke-test
|
|
121
197
|
steps:
|
|
122
198
|
- navigate: "/"
|
|
@@ -127,18 +203,226 @@ assertions:
|
|
|
127
203
|
- noConsoleErrors: true
|
|
128
204
|
```
|
|
129
205
|
|
|
130
|
-
|
|
206
|
+
Run it by file name:
|
|
131
207
|
|
|
132
208
|
```bash
|
|
133
209
|
prowl run smoke-test
|
|
134
210
|
```
|
|
135
211
|
|
|
136
|
-
<!-- ILLUSTRATION: Terminal screenshot showing colorized pass/fail output with step timings -->
|
|
137
|
-
|
|
138
212
|
That's it. You're testing.
|
|
139
213
|
|
|
140
214
|
---
|
|
141
215
|
|
|
216
|
+
## macOS Target (Experimental)
|
|
217
|
+
|
|
218
|
+
> **Experimental (PROWL-048).** Prowl can drive **native macOS apps** — including
|
|
219
|
+
> menu bar extras (`NSStatusItem` + `NSMenu`) — through Apple's Accessibility API,
|
|
220
|
+
> in addition to the web. The API, selector dialect, and step coverage may change.
|
|
221
|
+
|
|
222
|
+
### Enabling it
|
|
223
|
+
|
|
224
|
+
1. **Install the helper** (recommended — no Xcode, no Swift toolchain):
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
prowl macdriver install
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
This downloads the pinned, **signed and notarized** `prowl-macdriver` binary
|
|
231
|
+
from GitHub Releases, verifies its SHA-256 against the released checksum, and
|
|
232
|
+
installs it to `~/.prowl/macdriver/<version>/prowl-macdriver`. Check what's
|
|
233
|
+
resolved at any time with `prowl macdriver status`.
|
|
234
|
+
|
|
235
|
+
> **Until the first signed release is cut, `prowl macdriver install` returns a
|
|
236
|
+
> 404** (the maintainer publishes the first `macdriver-v*` release and
|
|
237
|
+
> verifies the flow before this becomes the default path). In the meantime,
|
|
238
|
+
> build from source as below.
|
|
239
|
+
|
|
240
|
+
**Contributors / pre-release — build from source** (requires the Swift
|
|
241
|
+
toolchain / Xcode CLT):
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
cd macdriver
|
|
245
|
+
swift build -c release
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Binary search order.** Prowl resolves the helper via, in order:
|
|
249
|
+
1. `$PROWL_MACDRIVER_BIN` (absolute path to a binary), then
|
|
250
|
+
2. the user-level install at `~/.prowl/macdriver/<version>/prowl-macdriver`
|
|
251
|
+
(what `prowl macdriver install` writes), then
|
|
252
|
+
3. the repo-local source build at `macdriver/.build/release/prowl-macdriver`
|
|
253
|
+
(then `.../debug/...`).
|
|
254
|
+
|
|
255
|
+
If none is found, Prowl fails with a clear message pointing at
|
|
256
|
+
`prowl macdriver install` (with the source build as the contributor fallback)
|
|
257
|
+
rather than crashing.
|
|
258
|
+
|
|
259
|
+
2. **Point your config at a macOS target:**
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
target:
|
|
263
|
+
type: macos
|
|
264
|
+
app: "com.example.App" # bundle id, or an absolute /path/to/App.app
|
|
265
|
+
guardrails:
|
|
266
|
+
allowedApps: # optional scope; empty = allow the target app
|
|
267
|
+
- "com.example.App"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
When `target.app` is an app path, `allowedApps` may list the exact `.app`
|
|
271
|
+
path, the app bundle name (`Example` for `Example.app`), or the bundle id
|
|
272
|
+
from `Contents/Info.plist` when that file is readable.
|
|
273
|
+
|
|
274
|
+
3. **Grant Accessibility permission** (see below), then run a hunt as usual:
|
|
275
|
+
`prowl run my-macos-hunt`.
|
|
276
|
+
|
|
277
|
+
### Accessibility & Screen Recording permission
|
|
278
|
+
|
|
279
|
+
The **process that hosts** Prowl (your terminal — Terminal, iTerm, VS Code, or a CI
|
|
280
|
+
agent) must be granted **Accessibility** permission: **System Settings → Privacy &
|
|
281
|
+
Security → Accessibility**, then enable that app. macOS attributes the grant to the
|
|
282
|
+
hosting app, not to `prowl-macdriver`. `prowl macdriver status` prints the
|
|
283
|
+
resolved binary path, installed versions, and this permission guidance. Preflight
|
|
284
|
+
the Accessibility grant directly from the helper (use the path `status` reports,
|
|
285
|
+
or the source build):
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
MACDRIVER_VERSION=0.1.0 # replace with the version shown by `prowl macdriver status`
|
|
289
|
+
~/.prowl/macdriver/$MACDRIVER_VERSION/prowl-macdriver check
|
|
290
|
+
# or: macdriver/.build/release/prowl-macdriver check
|
|
291
|
+
# prints {"trusted": <bool>}; prompts on first run
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
The `screenshot`/`assertScreenshot` steps additionally need **Screen Recording**
|
|
295
|
+
permission for the hosting app.
|
|
296
|
+
|
|
297
|
+
**CI notes (macOS runners):** headless CI cannot click "Allow" in a dialog, so grant
|
|
298
|
+
the permissions non-interactively before the run. On a self-hosted runner you can
|
|
299
|
+
pre-authorize the agent's host app with a TCC profile via MDM, or (on ephemeral
|
|
300
|
+
runners where it's acceptable) seed the TCC database, e.g.:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" \
|
|
304
|
+
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','<runner-app-bundle-id>',0,2,2,1,NULL,NULL,NULL,'UNUSED',NULL,0,1,NULL,NULL,NULL);"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
GitHub-hosted macOS runners do not grant Accessibility, so the macOS target is aimed
|
|
308
|
+
at self-hosted / MDM-managed runners for now.
|
|
309
|
+
|
|
310
|
+
### Selector dialect (macOS)
|
|
311
|
+
|
|
312
|
+
See the [Native Selector Dialect matrix](#native-selector-dialect-compatibility-matrix)
|
|
313
|
+
for how these compare across native targets (and the `label=` exact-match trap).
|
|
314
|
+
Native selectors address accessibility identifiers, roles, and labels:
|
|
315
|
+
|
|
316
|
+
| Selector | Matches |
|
|
317
|
+
|---|---|
|
|
318
|
+
| `id=openSettings` | element whose `AXIdentifier` equals `openSettings` |
|
|
319
|
+
| `role=button[name="Save"]` | an `AXButton` whose title/description/value contains `Save` |
|
|
320
|
+
| `label="Email"` | element whose accessibility label equals `Email` |
|
|
321
|
+
| `text="Save"` or bare `Save` | element whose title/description/value contains the text |
|
|
322
|
+
| `statusItem` | opens the app's menu bar status-item menu |
|
|
323
|
+
| `menu=Preferences…` | opens the status-item menu and clicks that item |
|
|
324
|
+
|
|
325
|
+
`forbiddenSelectors` still applies (text patterns match via the same substring
|
|
326
|
+
semantics as the web target). Prefer `id=` (accessibility identifiers) — the native
|
|
327
|
+
analog of `data-testid`.
|
|
328
|
+
|
|
329
|
+
### Finding selectors
|
|
330
|
+
|
|
331
|
+
Don't guess selectors — dump them. `prowl analyze` works on the macOS target the
|
|
332
|
+
same way it does on the web: it launches/attaches to the app, walks the
|
|
333
|
+
Accessibility tree, and prints every interactive element with **ranked selector
|
|
334
|
+
candidates** (best first) plus the app's windows and status-item menu contents.
|
|
335
|
+
It is read-only (the only interaction is opening and closing the status menu),
|
|
336
|
+
honors `guardrails.allowedApps`, and leaves the app running when done.
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# Uses the macOS target from .prowl/config.yml:
|
|
340
|
+
prowl analyze
|
|
341
|
+
|
|
342
|
+
# …or point it at any app without a config:
|
|
343
|
+
prowl analyze --app com.example.App
|
|
344
|
+
prowl analyze --app "/Applications/Example.app"
|
|
345
|
+
|
|
346
|
+
# Machine-readable output for agents:
|
|
347
|
+
prowl analyze --app com.example.App --json
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Example (human-readable) output:
|
|
351
|
+
|
|
352
|
+
```text
|
|
353
|
+
App Analysis: com.example.App
|
|
354
|
+
|
|
355
|
+
Windows:
|
|
356
|
+
"Main Window" id=mainWindow
|
|
357
|
+
|
|
358
|
+
Interactive Elements:
|
|
359
|
+
AXButton id=saveButton "Save"
|
|
360
|
+
AXTextField label="Email" "Email"
|
|
361
|
+
AXCheckBox label="Remember me" "Remember me" (disabled)
|
|
362
|
+
|
|
363
|
+
Menu Bar:
|
|
364
|
+
AXMenuItem id=preferences "Preferences…"
|
|
365
|
+
AXMenuItem label="Quit" "Quit"
|
|
366
|
+
|
|
367
|
+
3 elements, 1 windows, 2 menu items
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Selectors are ranked `id=` > `label=` > `role=…[name="…"]` > `text=` — copy the
|
|
371
|
+
first (most durable) candidate into your hunt. Status-item menu identifiers
|
|
372
|
+
(`id=preferences` above) are especially valuable, since menu titles often carry
|
|
373
|
+
ellipses or localized text that are awkward to match by substring.
|
|
374
|
+
|
|
375
|
+
### Step compatibility
|
|
376
|
+
|
|
377
|
+
Portable steps run on **both** targets; web-only steps are rejected up front on the
|
|
378
|
+
macOS target (with a clear error), and `prowl login` / URL guardrails do not apply.
|
|
379
|
+
|
|
380
|
+
| Portable (web + macOS) | Web-only (rejected on macOS) |
|
|
381
|
+
|---|---|
|
|
382
|
+
| `click`, `fill`, `type`, `press` | `navigate`, `waitForUrl`, `waitForNetworkIdle` |
|
|
383
|
+
| `wait`, `waitForSelector` | `mockRoute` / `unmockRoute` |
|
|
384
|
+
| `assert: visible` / `notVisible` | `evalScript`, `runScript` |
|
|
385
|
+
| `screenshot`, `assertScreenshot` | `onDialog`, `select` / `selectOption` |
|
|
386
|
+
| `hover`, `scrollTo` | `setInputFiles`, `waitForDownload` |
|
|
387
|
+
| `repeat`, `if`, `runHunt`, `copyText` | `scroll` (directional), `assert: urlIncludes` / `urlEquals` |
|
|
388
|
+
|
|
389
|
+
Notes: `press` accepts the same key vocabulary as the web target — single printable
|
|
390
|
+
characters, `Enter`/`Return`/`Space`, `Tab`, `Escape`, `Backspace`, `Delete`, `Home`,
|
|
391
|
+
`End`, `PageUp`, `PageDown`, arrows (`ArrowUp`/`ArrowDown`/`ArrowLeft`/`ArrowRight`),
|
|
392
|
+
`F1`–`F12`, and `+`-joined modifier combos (`Control`, `Shift`, `Alt`, `Meta`,
|
|
393
|
+
`ControlOrMeta`; aliases: `Ctrl`, `Option`, `Cmd`, `Command`; `ControlOrMeta` maps
|
|
394
|
+
to Command on macOS), e.g. `Shift+Tab`, `ControlOrMeta+a`, or `Meta+a`; unknown keys
|
|
395
|
+
error clearly. A bare `Enter`/`Return`/`Space` uses the element's activate action when
|
|
396
|
+
available, otherwise keystrokes are synthesized and posted to the target app (activated
|
|
397
|
+
first) so they never land elsewhere — the existing Accessibility grant already covers
|
|
398
|
+
this, no new permission prompt. `type` fills the focused control; app teardown quits the
|
|
399
|
+
target app after the run.
|
|
400
|
+
|
|
401
|
+
#### Hunt-level assertion compatibility
|
|
402
|
+
|
|
403
|
+
Hunt-level `assertions:` are evaluated after the steps complete (even when a step
|
|
404
|
+
failed, matching the web path). Selector assertions run on every target; URL, console,
|
|
405
|
+
and network assertions are web-only and are reported as **`skipped`** on a native
|
|
406
|
+
target — visible in `result.json` / `summary.md` / JUnit, never silently dropped and
|
|
407
|
+
never a hard error.
|
|
408
|
+
|
|
409
|
+
| Assertion | Web | macOS | Android | iOS |
|
|
410
|
+
|---|---|---|---|---|
|
|
411
|
+
| `selectorExists`, `selectorNotExists` | ✅ runs | ✅ runs | ✅ runs | ✅ runs |
|
|
412
|
+
| `urlIncludes`, `urlEquals` | ✅ runs | ⏭️ skipped (web-only) | ⏭️ skipped | ⏭️ skipped |
|
|
413
|
+
| `noConsoleErrors`, `noNetworkErrors` | ✅ runs | ⏭️ skipped (web-only) | ⏭️ skipped | ⏭️ skipped |
|
|
414
|
+
|
|
415
|
+
A web-only assertion a hunt explicitly authored also prints a console warning naming
|
|
416
|
+
the target; the `noConsoleErrors` / `noNetworkErrors` config defaults are surfaced as
|
|
417
|
+
`skipped` but do not warn on every run. For per-step checks on a native target, use
|
|
418
|
+
inline `assert: visible` / `notVisible` steps.
|
|
419
|
+
|
|
420
|
+
> Docs follow-up: the customer-facing docs site (`prowl-docs`) should gain a "macOS
|
|
421
|
+
> target" page mirroring this section (target type + step-compatibility matrix +
|
|
422
|
+
> assertion-compatibility matrix + permission setup); tracked separately from this repo.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
142
426
|
## Step Type Reference
|
|
143
427
|
|
|
144
428
|
Prowl supports both **shorthand** and **explicit** syntax for most step types. Shorthand is concise and readable. Explicit gives you full control over selectors.
|
|
@@ -200,6 +484,14 @@ Press a keyboard key on a specific element.
|
|
|
200
484
|
key: "Enter"
|
|
201
485
|
```
|
|
202
486
|
|
|
487
|
+
Key names follow the web (Playwright) vocabulary — e.g. `Enter`, `Escape`, `Tab`,
|
|
488
|
+
`Backspace`, `Delete`, arrows, `F1`–`F12`, single characters, and modifier combos like
|
|
489
|
+
`Control+a`, `ControlOrMeta+a`, or `Shift+Tab`. The macOS target accepts the same names
|
|
490
|
+
(see the macOS target notes above); `ControlOrMeta` maps to Command, and
|
|
491
|
+
`Cmd`/`Command`/`Option` are also accepted there as aliases for `Meta`/`Alt`.
|
|
492
|
+
On macOS, a shortcut letter in a combo (e.g. `Meta+s`) is synthesized against the US/ANSI
|
|
493
|
+
physical keyboard layout — the standard trade-off for synthesized keystrokes.
|
|
494
|
+
|
|
203
495
|
### select / selectOption
|
|
204
496
|
|
|
205
497
|
Select a dropdown value. Shorthand finds by label, explicit uses a selector.
|
|
@@ -438,6 +730,10 @@ assertions:
|
|
|
438
730
|
- noNetworkErrors: true # No HTTP responses >= 400
|
|
439
731
|
```
|
|
440
732
|
|
|
733
|
+
On native targets (macOS / Android / iOS) the selector assertions run and the
|
|
734
|
+
URL/console/network ones are reported as `skipped` — see the
|
|
735
|
+
[hunt-level assertion compatibility matrix](#hunt-level-assertion-compatibility).
|
|
736
|
+
|
|
441
737
|
---
|
|
442
738
|
|
|
443
739
|
## Config Reference
|
|
@@ -699,9 +995,17 @@ spans. When the app emits no trace headers, nothing is recorded (no noise).
|
|
|
699
995
|
|
|
700
996
|
## CLI Reference
|
|
701
997
|
|
|
998
|
+
A `<hunt-name>` is a hunt's file name under `.prowl/hunts/` — `homepage` for
|
|
999
|
+
`.prowl/hunts/homepage.yml`, or `admin/users` for a nested
|
|
1000
|
+
`.prowl/hunts/admin/users.yml`. `run`, `watch`, and `history` also accept
|
|
1001
|
+
supported `.yml` path forms (`.prowl/hunts/homepage.yml` or
|
|
1002
|
+
`hunts/homepage.yml`) and a bare `.yml` file name (`homepage.yml`); they resolve
|
|
1003
|
+
to the same hunt.
|
|
1004
|
+
|
|
702
1005
|
```bash
|
|
703
1006
|
# Run a hunt
|
|
704
1007
|
prowl run <hunt-name>
|
|
1008
|
+
prowl run .prowl/hunts/homepage.yml # A literal path resolves to `homepage`
|
|
705
1009
|
prowl run <hunt-name> --headed # Show browser window
|
|
706
1010
|
prowl run <hunt-name> --trace # Capture Playwright trace
|
|
707
1011
|
prowl run <hunt-name> --slow-mo 500 # Slow down actions (ms)
|
|
@@ -927,14 +1231,6 @@ CLI Commands
|
|
|
927
1231
|
|
|
928
1232
|
---
|
|
929
1233
|
|
|
930
|
-
## Community Hub
|
|
931
|
-
|
|
932
|
-
Browse and contribute hunt templates through the internal community registry (contact ops for access).
|
|
933
|
-
|
|
934
|
-
Templates cover auth flows (OAuth, 2FA), e-commerce (Stripe), admin panels, SaaS patterns, and more. Each template is heavily commented and ready to customize.
|
|
935
|
-
|
|
936
|
-
---
|
|
937
|
-
|
|
938
1234
|
## Native Selector Dialect (compatibility matrix)
|
|
939
1235
|
|
|
940
1236
|
Android and iOS now consume one shared selector dialect implementation, so `id=`
|
|
@@ -967,163 +1263,8 @@ label-shaped ids, but runtime and host-side matching still resolve `id=` against
|
|
|
967
1263
|
WDA's `name`.
|
|
968
1264
|
|
|
969
1265
|
Prefer `id=` on every native target — the native analog of `data-testid`. Per-target
|
|
970
|
-
specifics (escaping, `statusItem`/`menu=` on macOS, the Compose
|
|
971
|
-
caveat on Android)
|
|
972
|
-
|
|
973
|
-
---
|
|
974
|
-
|
|
975
|
-
## macOS Target (Experimental)
|
|
976
|
-
|
|
977
|
-
> **Experimental (PROWL-048).** Prowl can drive **native macOS apps** — including
|
|
978
|
-
> menu bar extras (`NSStatusItem` + `NSMenu`) — through Apple's Accessibility API,
|
|
979
|
-
> in addition to the web. The API, selector dialect, and step coverage may change.
|
|
980
|
-
> **Distribution is deferred:** the required helper binary is **not** shipped in the
|
|
981
|
-
> npm package; you build it locally (below).
|
|
982
|
-
|
|
983
|
-
### Enabling it
|
|
984
|
-
|
|
985
|
-
1. **Build the helper** (one time; requires the Swift toolchain / Xcode CLT):
|
|
986
|
-
|
|
987
|
-
```bash
|
|
988
|
-
cd macdriver
|
|
989
|
-
swift build -c release
|
|
990
|
-
```
|
|
991
|
-
|
|
992
|
-
Prowl finds the binary at `macdriver/.build/release/prowl-macdriver`, or at
|
|
993
|
-
`$PROWL_MACDRIVER_BIN` if set. If it is missing, Prowl fails with a clear
|
|
994
|
-
"build the helper" message rather than crashing.
|
|
995
|
-
|
|
996
|
-
2. **Point your config at a macOS target:**
|
|
997
|
-
|
|
998
|
-
```yaml
|
|
999
|
-
target:
|
|
1000
|
-
type: macos
|
|
1001
|
-
app: "com.example.App" # bundle id, or an absolute /path/to/App.app
|
|
1002
|
-
guardrails:
|
|
1003
|
-
allowedApps: # optional scope; empty = allow the target app
|
|
1004
|
-
- "com.example.App"
|
|
1005
|
-
```
|
|
1006
|
-
|
|
1007
|
-
When `target.app` is an app path, `allowedApps` may list the exact `.app`
|
|
1008
|
-
path, the app bundle name (`Example` for `Example.app`), or the bundle id
|
|
1009
|
-
from `Contents/Info.plist` when that file is readable.
|
|
1010
|
-
|
|
1011
|
-
3. **Grant Accessibility permission** (see below), then run a hunt as usual:
|
|
1012
|
-
`prowl run my-macos-hunt`.
|
|
1013
|
-
|
|
1014
|
-
### Accessibility & Screen Recording permission
|
|
1015
|
-
|
|
1016
|
-
The **process that hosts** Prowl (your terminal — Terminal, iTerm, VS Code, or a CI
|
|
1017
|
-
agent) must be granted **Accessibility** permission: **System Settings → Privacy &
|
|
1018
|
-
Security → Accessibility**, then enable that app. macOS attributes the grant to the
|
|
1019
|
-
hosting app, not to `prowl-macdriver`. Preflight from the helper:
|
|
1020
|
-
|
|
1021
|
-
```bash
|
|
1022
|
-
macdriver/.build/release/prowl-macdriver check # prints {"trusted": <bool>}; prompts on first run
|
|
1023
|
-
```
|
|
1024
|
-
|
|
1025
|
-
The `screenshot`/`assertScreenshot` steps additionally need **Screen Recording**
|
|
1026
|
-
permission for the hosting app.
|
|
1027
|
-
|
|
1028
|
-
**CI notes (macOS runners):** headless CI cannot click "Allow" in a dialog, so grant
|
|
1029
|
-
the permissions non-interactively before the run. On a self-hosted runner you can
|
|
1030
|
-
pre-authorize the agent's host app with a TCC profile via MDM, or (on ephemeral
|
|
1031
|
-
runners where it's acceptable) seed the TCC database, e.g.:
|
|
1032
|
-
|
|
1033
|
-
```bash
|
|
1034
|
-
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" \
|
|
1035
|
-
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','<runner-app-bundle-id>',0,2,2,1,NULL,NULL,NULL,'UNUSED',NULL,0,1,NULL,NULL,NULL);"
|
|
1036
|
-
```
|
|
1037
|
-
|
|
1038
|
-
GitHub-hosted macOS runners do not grant Accessibility, so the macOS target is aimed
|
|
1039
|
-
at self-hosted / MDM-managed runners for now.
|
|
1040
|
-
|
|
1041
|
-
### Selector dialect (macOS)
|
|
1042
|
-
|
|
1043
|
-
See the [Native Selector Dialect matrix](#native-selector-dialect-compatibility-matrix)
|
|
1044
|
-
for how these compare across native targets (and the `label=` exact-match trap).
|
|
1045
|
-
Native selectors address accessibility identifiers, roles, and labels:
|
|
1046
|
-
|
|
1047
|
-
| Selector | Matches |
|
|
1048
|
-
|---|---|
|
|
1049
|
-
| `id=openSettings` | element whose `AXIdentifier` equals `openSettings` |
|
|
1050
|
-
| `role=button[name="Save"]` | an `AXButton` whose title/description/value contains `Save` |
|
|
1051
|
-
| `label="Email"` | element whose accessibility label equals `Email` |
|
|
1052
|
-
| `text="Save"` or bare `Save` | element whose title/description/value contains the text |
|
|
1053
|
-
| `statusItem` | opens the app's menu bar status-item menu |
|
|
1054
|
-
| `menu=Preferences…` | opens the status-item menu and clicks that item |
|
|
1055
|
-
|
|
1056
|
-
`forbiddenSelectors` still applies (text patterns match via the same substring
|
|
1057
|
-
semantics as the web target). Prefer `id=` (accessibility identifiers) — the native
|
|
1058
|
-
analog of `data-testid`.
|
|
1059
|
-
|
|
1060
|
-
### Finding selectors
|
|
1061
|
-
|
|
1062
|
-
Don't guess selectors — dump them. `prowl analyze` works on the macOS target the
|
|
1063
|
-
same way it does on the web: it launches/attaches to the app, walks the
|
|
1064
|
-
Accessibility tree, and prints every interactive element with **ranked selector
|
|
1065
|
-
candidates** (best first) plus the app's windows and status-item menu contents.
|
|
1066
|
-
It is read-only (the only interaction is opening and closing the status menu),
|
|
1067
|
-
honors `guardrails.allowedApps`, and leaves the app running when done.
|
|
1068
|
-
|
|
1069
|
-
```bash
|
|
1070
|
-
# Uses the macOS target from .prowl/config.yml:
|
|
1071
|
-
prowl analyze
|
|
1072
|
-
|
|
1073
|
-
# …or point it at any app without a config:
|
|
1074
|
-
prowl analyze --app com.example.App
|
|
1075
|
-
prowl analyze --app "/Applications/Example.app"
|
|
1076
|
-
|
|
1077
|
-
# Machine-readable output for agents:
|
|
1078
|
-
prowl analyze --app com.example.App --json
|
|
1079
|
-
```
|
|
1080
|
-
|
|
1081
|
-
Example (human-readable) output:
|
|
1082
|
-
|
|
1083
|
-
```text
|
|
1084
|
-
App Analysis: com.example.App
|
|
1085
|
-
|
|
1086
|
-
Windows:
|
|
1087
|
-
"Main Window" id=mainWindow
|
|
1088
|
-
|
|
1089
|
-
Interactive Elements:
|
|
1090
|
-
AXButton id=saveButton "Save"
|
|
1091
|
-
AXTextField label="Email" "Email"
|
|
1092
|
-
AXCheckBox label="Remember me" "Remember me" (disabled)
|
|
1093
|
-
|
|
1094
|
-
Menu Bar:
|
|
1095
|
-
AXMenuItem id=preferences "Preferences…"
|
|
1096
|
-
AXMenuItem label="Quit" "Quit"
|
|
1097
|
-
|
|
1098
|
-
3 elements, 1 windows, 2 menu items
|
|
1099
|
-
```
|
|
1100
|
-
|
|
1101
|
-
Selectors are ranked `id=` > `label=` > `role=…[name="…"]` > `text=` — copy the
|
|
1102
|
-
first (most durable) candidate into your hunt. Status-item menu identifiers
|
|
1103
|
-
(`id=preferences` above) are especially valuable, since menu titles often carry
|
|
1104
|
-
ellipses or localized text that are awkward to match by substring.
|
|
1105
|
-
|
|
1106
|
-
### Step compatibility
|
|
1107
|
-
|
|
1108
|
-
Portable steps run on **both** targets; web-only steps are rejected up front on the
|
|
1109
|
-
macOS target (with a clear error), and `prowl login` / URL guardrails do not apply.
|
|
1110
|
-
|
|
1111
|
-
| Portable (web + macOS) | Web-only (rejected on macOS) |
|
|
1112
|
-
|---|---|
|
|
1113
|
-
| `click`, `fill`, `type`, `press` | `navigate`, `waitForUrl`, `waitForNetworkIdle` |
|
|
1114
|
-
| `wait`, `waitForSelector` | `mockRoute` / `unmockRoute` |
|
|
1115
|
-
| `assert: visible` / `notVisible` | `evalScript`, `runScript` |
|
|
1116
|
-
| `screenshot`, `assertScreenshot` | `onDialog`, `select` / `selectOption` |
|
|
1117
|
-
| `hover`, `scrollTo` | `setInputFiles`, `waitForDownload` |
|
|
1118
|
-
| `repeat`, `if`, `runHunt`, `copyText` | `scroll` (directional), `assert: urlIncludes` / `urlEquals` |
|
|
1119
|
-
|
|
1120
|
-
Notes: `press` maps Enter/Return/Space onto the element's activate action (other keys
|
|
1121
|
-
are unsupported); `type` fills the focused control; app teardown quits the target app
|
|
1122
|
-
after the run.
|
|
1123
|
-
|
|
1124
|
-
> Docs follow-up: the customer-facing docs site (`prowl-docs`) should gain a "macOS
|
|
1125
|
-
> target" page mirroring this section (target type + step-compatibility matrix +
|
|
1126
|
-
> permission setup); tracked separately from this repo.
|
|
1266
|
+
specifics (escaping, `statusItem`/`menu=` on macOS above, the Compose
|
|
1267
|
+
`testTagsAsResourceId` caveat on Android below) live in each target's own section.
|
|
1127
1268
|
|
|
1128
1269
|
---
|
|
1129
1270
|
|
|
@@ -1219,6 +1360,11 @@ equivalent yet and are rejected with a clear message; scroll-gesture support is
|
|
|
1219
1360
|
follow-up. A degraded pure-`adb` fallback (`uiautomator dump` + `input tap`) is a
|
|
1220
1361
|
possible future diagnostic mode, not the primary path.
|
|
1221
1362
|
|
|
1363
|
+
Hunt-level `assertions:` behave as on macOS — `selectorExists` / `selectorNotExists`
|
|
1364
|
+
run against the device; `urlIncludes` / `urlEquals` / `noConsoleErrors` /
|
|
1365
|
+
`noNetworkErrors` are web-only and reported as `skipped`. See the
|
|
1366
|
+
[hunt-level assertion compatibility matrix](#hunt-level-assertion-compatibility).
|
|
1367
|
+
|
|
1222
1368
|
### Finding selectors (Android)
|
|
1223
1369
|
|
|
1224
1370
|
Don't guess selectors — dump them. `prowl analyze` works on the Android target the
|
|
@@ -1364,6 +1510,11 @@ message. Screenshots are captured with `simctl` (not WDA), so artifacts still wo
|
|
|
1364
1510
|
even if the agent wedges. `hover` and `scrollTo` have no touch equivalent yet and are
|
|
1365
1511
|
rejected with a clear message; scroll-gesture support is a follow-up.
|
|
1366
1512
|
|
|
1513
|
+
Hunt-level `assertions:` behave as on macOS — `selectorExists` / `selectorNotExists`
|
|
1514
|
+
run against the simulator; `urlIncludes` / `urlEquals` / `noConsoleErrors` /
|
|
1515
|
+
`noNetworkErrors` are web-only and reported as `skipped`. See the
|
|
1516
|
+
[hunt-level assertion compatibility matrix](#hunt-level-assertion-compatibility).
|
|
1517
|
+
|
|
1367
1518
|
### Finding selectors (iOS)
|
|
1368
1519
|
|
|
1369
1520
|
Don't guess selectors — dump them. `prowl analyze` works on the iOS target the
|
|
@@ -12,13 +12,28 @@ var SUPPORTED_BROWSER_ENGINES = ["chromium", "firefox", "webkit"];
|
|
|
12
12
|
|
|
13
13
|
// src/config/hunt-name.ts
|
|
14
14
|
var HUNT_NAME_PATTERN = /^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/;
|
|
15
|
+
var HUNT_FILE_EXTENSION_PATTERN = /\.yml$/i;
|
|
15
16
|
function isValidHuntName(name) {
|
|
16
17
|
return HUNT_NAME_PATTERN.test(name);
|
|
17
18
|
}
|
|
19
|
+
function normalizeHuntName(input) {
|
|
20
|
+
let name = input.trim();
|
|
21
|
+
if (name.startsWith("./")) {
|
|
22
|
+
name = name.slice(2);
|
|
23
|
+
}
|
|
24
|
+
const isSupportedHuntPath = HUNT_FILE_EXTENSION_PATTERN.test(name);
|
|
25
|
+
if (isSupportedHuntPath && name.startsWith(".prowl/hunts/")) {
|
|
26
|
+
name = name.slice(".prowl/hunts/".length);
|
|
27
|
+
} else if (isSupportedHuntPath && name.startsWith("hunts/")) {
|
|
28
|
+
name = name.slice("hunts/".length);
|
|
29
|
+
}
|
|
30
|
+
name = name.replace(HUNT_FILE_EXTENSION_PATTERN, "");
|
|
31
|
+
return name;
|
|
32
|
+
}
|
|
18
33
|
function assertValidHuntName(name) {
|
|
19
34
|
if (!isValidHuntName(name)) {
|
|
20
35
|
throw new Error(
|
|
21
|
-
`Invalid hunt name: "${name}".
|
|
36
|
+
`Invalid hunt name: "${name}". A hunt name is its file name under .prowl/hunts/ (letters, numbers, hyphens, underscores, and forward slashes for nested hunts). Accepted forms: a bare name (homepage), a nested name (admin/users), or a path (.prowl/hunts/homepage.yml or hunts/homepage.yml).`
|
|
22
37
|
);
|
|
23
38
|
}
|
|
24
39
|
}
|
|
@@ -593,6 +608,7 @@ function listHunts(configDir) {
|
|
|
593
608
|
|
|
594
609
|
export {
|
|
595
610
|
SUPPORTED_BROWSER_ENGINES,
|
|
611
|
+
normalizeHuntName,
|
|
596
612
|
configSchema,
|
|
597
613
|
stepSchema,
|
|
598
614
|
huntSchema,
|
|
@@ -608,4 +624,4 @@ export {
|
|
|
608
624
|
loadHuntMeta,
|
|
609
625
|
listHunts
|
|
610
626
|
};
|
|
611
|
-
//# sourceMappingURL=chunk-
|
|
627
|
+
//# sourceMappingURL=chunk-O3OUTZ2P.js.map
|