@hasna/testers 0.0.18 → 0.0.20
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 +18 -235
- package/dist/cli/index.js +15115 -7778
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3871 -2984
- package/dist/lib/army-runner.d.ts +41 -0
- package/dist/lib/army-runner.d.ts.map +1 -0
- package/dist/lib/browser-bun.d.ts +6 -6
- package/dist/lib/browser-bun.d.ts.map +1 -1
- package/dist/lib/browser.d.ts +2 -2
- package/dist/lib/browser.d.ts.map +1 -1
- package/dist/lib/contacts-connector.d.ts +48 -0
- package/dist/lib/contacts-connector.d.ts.map +1 -0
- package/dist/lib/persona-auth.d.ts +30 -0
- package/dist/lib/persona-auth.d.ts.map +1 -0
- package/dist/lib/recorder.d.ts +5 -1
- package/dist/lib/recorder.d.ts.map +1 -1
- package/dist/lib/runner.d.ts.map +1 -1
- package/dist/lib/secrets-resolver.d.ts +33 -0
- package/dist/lib/secrets-resolver.d.ts.map +1 -0
- package/dist/lib/session-tracker.d.ts +29 -0
- package/dist/lib/session-tracker.d.ts.map +1 -0
- package/dist/lib/visual-diff.d.ts +13 -7
- package/dist/lib/visual-diff.d.ts.map +1 -1
- package/dist/mcp/index.js +4585 -3091
- package/dist/server/index.js +3846 -2968
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -8
package/README.md
CHANGED
|
@@ -1,267 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hasna/testers
|
|
2
2
|
|
|
3
|
-
AI-powered QA testing CLI — spawns cheap AI agents to test web apps with headless browsers
|
|
3
|
+
AI-powered QA testing CLI — spawns cheap AI agents to test web apps with headless browsers
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`testers` is a CLI tool that creates AI testing agents (Claude Haiku 4.5 by default) to click through your website like a real human. Tests are stored in SQLite, screenshots are captured at every step, and results are queryable.
|
|
8
|
-
|
|
9
|
-
Part of the [@hasna](https://www.npmjs.com/org/hasnaxyz) open-source ecosystem.
|
|
5
|
+
[](https://www.npmjs.com/package/@hasna/testers)
|
|
6
|
+
[](LICENSE)
|
|
10
7
|
|
|
11
8
|
## Install
|
|
12
9
|
|
|
13
10
|
```bash
|
|
14
11
|
npm install -g @hasna/testers
|
|
15
|
-
|
|
16
|
-
# Install browser (first time only)
|
|
17
|
-
testers install-browser
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Create a test scenario
|
|
24
|
-
testers add "Login flow" --description "Test login with valid creds" --tag auth --priority high
|
|
25
|
-
|
|
26
|
-
# Run all scenarios against your app
|
|
27
|
-
testers run http://localhost:3000
|
|
28
|
-
|
|
29
|
-
# Run with live browser (non-headless)
|
|
30
|
-
testers run http://localhost:3000 --headed
|
|
31
|
-
|
|
32
|
-
# Run a quick ad-hoc test
|
|
33
|
-
testers run http://localhost:3000 "verify the signup page loads and shows a form"
|
|
34
|
-
|
|
35
|
-
# Use a smarter model for complex scenarios
|
|
36
|
-
testers run http://localhost:3000 --model sonnet
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Features
|
|
40
|
-
|
|
41
|
-
- **SQLite-backed scenarios** — Define, tag, filter, and reuse test scenarios
|
|
42
|
-
- **AI-powered** — Agents navigate, click, fill forms, and verify results autonomously
|
|
43
|
-
- **Screenshot-first** — Every action captured and organized by run/scenario/step
|
|
44
|
-
- **Cheap by default** — Haiku 4.5 (~$0.001/test), configurable per scenario
|
|
45
|
-
- **Headless by default** — Opt-in `--headed` mode to watch AI test live
|
|
46
|
-
- **open-todos integration** — Pull QA tasks as test scenarios
|
|
47
|
-
- **MCP server** — Let Claude Code trigger tests inline
|
|
48
|
-
- **Dashboard** — Web UI for browsing results and screenshots
|
|
49
|
-
|
|
50
|
-
## CLI Reference
|
|
51
|
-
|
|
52
|
-
### Scenario Management
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
testers add <name> [options] # Create a test scenario
|
|
56
|
-
--description <desc> # Scenario description
|
|
57
|
-
--steps <step> # Add a step (repeatable)
|
|
58
|
-
--tag <tag> # Add a tag (repeatable)
|
|
59
|
-
--priority <low|medium|high|critical>
|
|
60
|
-
--model <preset|model-id> # Override model
|
|
61
|
-
--path <path> # Target path (e.g., /login)
|
|
62
|
-
--auth # Requires authentication
|
|
63
|
-
--timeout <ms> # Custom timeout
|
|
64
|
-
|
|
65
|
-
testers list [options] # List scenarios
|
|
66
|
-
--tag <tag> # Filter by tag
|
|
67
|
-
--priority <priority> # Filter by priority
|
|
68
|
-
|
|
69
|
-
testers show <id> # Show scenario details
|
|
70
|
-
testers update <id> [options] # Update scenario
|
|
71
|
-
testers delete <id> # Delete scenario
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Running Tests
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
testers run <url> [description] # Run tests
|
|
78
|
-
--tag <tag> # Run scenarios with tag
|
|
79
|
-
--scenario <id> # Run specific scenario
|
|
80
|
-
--priority <priority> # Run by priority
|
|
81
|
-
--headed # Watch browser live
|
|
82
|
-
--model <quick|thorough|deep> # Model preset
|
|
83
|
-
--parallel <n> # Concurrent agents (default: 1)
|
|
84
|
-
--json # JSON output
|
|
85
|
-
--output <file> # Write JSON to file
|
|
86
|
-
--from-todos # Pull from open-todos
|
|
87
|
-
--project <name> # Filter by project
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Results & Analysis
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
testers runs # List past runs
|
|
94
|
-
testers results <run-id> # Show run results
|
|
95
|
-
testers screenshots <id> # List screenshots
|
|
96
|
-
testers replay <run-id> # Re-run all scenarios from a run
|
|
97
|
-
testers retry <run-id> # Re-run only failed scenarios
|
|
98
|
-
testers diff <run1> <run2> # Compare two runs (regressions/fixes)
|
|
99
|
-
testers report <run-id> # Generate HTML report with screenshots
|
|
100
|
-
testers costs # Show cost tracking & budget status
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Projects
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
testers project create <name> # Create a project
|
|
107
|
-
testers project list # List projects
|
|
108
|
-
testers project show <id> # Show project details
|
|
109
|
-
testers project use <name> # Set active project
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Schedules (Recurring Tests)
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
testers schedule create <name> # Create recurring schedule
|
|
116
|
-
--cron "0 2 * * *" # Cron expression (required)
|
|
117
|
-
--url http://localhost:3000 # Target URL (required)
|
|
118
|
-
--tag <tag> # Filter scenarios
|
|
119
|
-
--parallel <n> # Concurrent agents
|
|
120
|
-
testers schedule list # List all schedules
|
|
121
|
-
testers schedule enable <id> # Enable a schedule
|
|
122
|
-
testers schedule disable <id> # Disable a schedule
|
|
123
|
-
testers schedule run <id> # Manually trigger
|
|
124
|
-
testers daemon # Start scheduler daemon
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Smoke Testing
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
testers smoke <url> # Zero-config autonomous exploration
|
|
131
|
-
--model <preset> # AI model
|
|
132
|
-
--headed # Watch live
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Templates & Auth
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
testers add --template auth # Seed auth test scenarios
|
|
139
|
-
testers add --template crud # Seed CRUD test scenarios
|
|
140
|
-
testers add --template forms # Seed form validation scenarios
|
|
141
|
-
testers add --template nav # Seed navigation scenarios
|
|
142
|
-
testers add --template a11y # Seed accessibility scenarios
|
|
143
|
-
|
|
144
|
-
testers auth add <name> # Create auth preset
|
|
145
|
-
--email <email> --password <pwd>
|
|
146
|
-
testers auth list # List presets
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Watch Mode
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
testers watch <url> # Re-run on file changes
|
|
153
|
-
--dir . # Directory to watch
|
|
154
|
-
--tag <tag> # Filter scenarios
|
|
155
|
-
--debounce <ms> # Debounce delay (default: 2000)
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Webhooks
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
testers webhook add <url> # Add webhook for notifications
|
|
162
|
-
--events failed,completed # Events to listen for
|
|
163
|
-
testers webhook list # List webhooks
|
|
164
|
-
testers webhook test <id> # Send test payload
|
|
165
|
-
testers webhook delete <id> # Remove webhook
|
|
166
12
|
```
|
|
167
13
|
|
|
168
|
-
|
|
14
|
+
## CLI Usage
|
|
169
15
|
|
|
170
16
|
```bash
|
|
171
|
-
testers
|
|
172
|
-
testers config # Show config
|
|
173
|
-
testers status # Show auth & DB status
|
|
174
|
-
testers install-browser # Install Playwright chromium
|
|
175
|
-
testers import <dir> # Import markdown tests to DB
|
|
176
|
-
testers serve # Start dashboard
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## Model Presets
|
|
180
|
-
|
|
181
|
-
| Preset | Model | Use Case |
|
|
182
|
-
|--------|-------|----------|
|
|
183
|
-
| `quick` (default) | Claude Haiku 4.5 | Fast, cheap tests |
|
|
184
|
-
| `thorough` | Claude Sonnet 4.6 | Complex flows |
|
|
185
|
-
| `deep` | Claude Opus 4.6 | Multi-step critical paths |
|
|
186
|
-
|
|
187
|
-
## Configuration
|
|
188
|
-
|
|
189
|
-
Config file: `~/.testers/config.json`
|
|
190
|
-
|
|
191
|
-
```json
|
|
192
|
-
{
|
|
193
|
-
"defaultModel": "claude-haiku-4-5-20251001",
|
|
194
|
-
"browser": {
|
|
195
|
-
"headless": true,
|
|
196
|
-
"viewport": { "width": 1280, "height": 720 }
|
|
197
|
-
},
|
|
198
|
-
"screenshots": {
|
|
199
|
-
"dir": "~/.testers/screenshots",
|
|
200
|
-
"format": "png"
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Environment variables:
|
|
206
|
-
- `ANTHROPIC_API_KEY` — Your Anthropic API key (required)
|
|
207
|
-
- `TESTERS_DB_PATH` — Custom database path
|
|
208
|
-
- `TESTERS_MODEL` — Override default model
|
|
209
|
-
- `TESTERS_SCREENSHOTS_DIR` — Custom screenshot directory
|
|
210
|
-
- `TESTERS_PORT` — Dashboard server port (default: 19450)
|
|
211
|
-
|
|
212
|
-
## Screenshots
|
|
213
|
-
|
|
214
|
-
Screenshots are saved to `~/.testers/screenshots/` organized by:
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
{run-id}/
|
|
218
|
-
{scenario-slug}/
|
|
219
|
-
001-navigate-homepage.png
|
|
220
|
-
002-click-login-button.png
|
|
221
|
-
003-fill-email-field.png
|
|
222
|
-
004-submit-form.png
|
|
223
|
-
005-verify-dashboard.png
|
|
17
|
+
testers --help
|
|
224
18
|
```
|
|
225
19
|
|
|
226
20
|
## MCP Server
|
|
227
21
|
|
|
228
|
-
Install for Claude Code:
|
|
229
|
-
|
|
230
22
|
```bash
|
|
231
|
-
|
|
23
|
+
testers-mcp
|
|
232
24
|
```
|
|
233
25
|
|
|
234
|
-
|
|
26
|
+
64 tools available.
|
|
235
27
|
|
|
236
|
-
##
|
|
237
|
-
|
|
238
|
-
Pull QA tasks from [open-todos](https://github.com/hasna/open-todos) as test scenarios:
|
|
28
|
+
## REST API
|
|
239
29
|
|
|
240
30
|
```bash
|
|
241
|
-
testers
|
|
31
|
+
testers-serve
|
|
242
32
|
```
|
|
243
33
|
|
|
244
|
-
|
|
34
|
+
## Cloud Sync
|
|
245
35
|
|
|
246
|
-
|
|
36
|
+
This package supports cloud sync via `@hasna/cloud`:
|
|
247
37
|
|
|
248
38
|
```bash
|
|
249
|
-
|
|
250
|
-
|
|
39
|
+
cloud setup
|
|
40
|
+
cloud sync push --service testers
|
|
41
|
+
cloud sync pull --service testers
|
|
251
42
|
```
|
|
252
43
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
## Stack
|
|
44
|
+
## Data Directory
|
|
256
45
|
|
|
257
|
-
|
|
258
|
-
- **Language**: TypeScript
|
|
259
|
-
- **Database**: SQLite (bun:sqlite)
|
|
260
|
-
- **Browser**: Playwright (Chromium)
|
|
261
|
-
- **AI**: Anthropic Claude API
|
|
262
|
-
- **CLI**: Commander.js
|
|
263
|
-
- **Dashboard**: React + Vite + Tailwind CSS
|
|
46
|
+
Data is stored in `~/.hasna/testers/`.
|
|
264
47
|
|
|
265
48
|
## License
|
|
266
49
|
|
|
267
|
-
|
|
50
|
+
Apache-2.0 -- see [LICENSE](LICENSE)
|