cbrowser 17.6.1 → 18.1.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/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +37 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +10 -5
- package/dist/cli.js.map +1 -1
- package/dist/mcp-server-remote.d.ts.map +1 -1
- package/dist/mcp-server-remote.js +3 -1
- package/dist/mcp-server-remote.js.map +1 -1
- package/dist/mcp-tools/base/navigation-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/navigation-tools.js +33 -12
- package/dist/mcp-tools/base/navigation-tools.js.map +1 -1
- package/dist/mcp-tools/index.d.ts +1 -0
- package/dist/mcp-tools/index.d.ts.map +1 -1
- package/dist/mcp-tools/index.js +2 -0
- package/dist/mcp-tools/index.js.map +1 -1
- package/dist/mcp-tools/screenshot-utils.d.ts +45 -0
- package/dist/mcp-tools/screenshot-utils.d.ts.map +1 -0
- package/dist/mcp-tools/screenshot-utils.js +131 -0
- package/dist/mcp-tools/screenshot-utils.js.map +1 -0
- package/docs/Tool-Cognitive-Journey-Autonomous.md +264 -0
- package/docs/Tool-Competitive-Benchmark.md +287 -0
- package/docs/Tool-Empathy-Audit.md +325 -0
- package/docs/Tool-Hunt-Bugs.md +299 -0
- package/docs/Tool-Marketing-Campaign.md +292 -0
- package/docs/Tool-Persona-Create.md +268 -0
- package/docs/Tools-Accessibility.md +202 -0
- package/docs/Tools-Browser-Automation.md +305 -0
- package/docs/Tools-Cognitive-Journeys.md +227 -0
- package/docs/Tools-Marketing-Intelligence.md +265 -0
- package/docs/Tools-Overview.md +143 -0
- package/docs/Tools-Persona-System.md +294 -0
- package/docs/Tools-Session-State.md +272 -0
- package/docs/Tools-Testing-Quality.md +251 -0
- package/docs/Tools-Utilities.md +176 -0
- package/docs/Tools-Visual-Performance.md +272 -0
- package/package.json +1 -1
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Session & State Tools
|
|
2
|
+
|
|
3
|
+
**Stay logged in. Handle Cloudflare. Test sites that fight back.**
|
|
4
|
+
|
|
5
|
+
These 14 tools manage browser sessions, handle state persistence, and (for Enterprise) bypass bot detection on sites you're authorized to test. Stop re-authenticating between test runs.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to Use These Tools
|
|
10
|
+
|
|
11
|
+
- **You're testing authenticated flows** and tired of logging in every time
|
|
12
|
+
- **Your tests run against Cloudflare-protected sites** you own
|
|
13
|
+
- **Browser crashes are disrupting your automation** and you need recovery
|
|
14
|
+
- **You need clean state** between test scenarios
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Session Management Tools
|
|
19
|
+
|
|
20
|
+
### `save_session`
|
|
21
|
+
|
|
22
|
+
**What it does**: Save the current browser session — cookies, localStorage, sessionStorage, and URL — for later restoration.
|
|
23
|
+
|
|
24
|
+
**Why you'd use it**: Authenticate once, save the session, reuse it across multiple test runs.
|
|
25
|
+
|
|
26
|
+
| Parameter | Type | Required | Description |
|
|
27
|
+
|-----------|------|----------|-------------|
|
|
28
|
+
| `name` | string | Yes | Name for this session |
|
|
29
|
+
| `url` | string | No | Navigate to this URL before saving (if not already there) |
|
|
30
|
+
|
|
31
|
+
**Example**:
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"name": "github-logged-in"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Note**: Session files include cookies with expiration dates. Sessions may need to be recreated when cookies expire.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### `load_session`
|
|
43
|
+
|
|
44
|
+
**What it does**: Restore a previously saved session, including cookies and storage.
|
|
45
|
+
|
|
46
|
+
**Why you'd use it**: Start tests already logged in, without going through authentication flow.
|
|
47
|
+
|
|
48
|
+
| Parameter | Type | Required | Description |
|
|
49
|
+
|-----------|------|----------|-------------|
|
|
50
|
+
| `name` | string | Yes | Session name to load |
|
|
51
|
+
| `navigateToUrl` | boolean | No | Navigate to the saved URL after loading. Default: true |
|
|
52
|
+
|
|
53
|
+
**Example**:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"name": "github-logged-in"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### `list_sessions`
|
|
63
|
+
|
|
64
|
+
**What it does**: List all saved sessions with metadata (creation date, domain, expiration).
|
|
65
|
+
|
|
66
|
+
**Why you'd use it**: See what sessions are available and whether they're still valid.
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Required | Description |
|
|
69
|
+
|-----------|------|----------|-------------|
|
|
70
|
+
| `detailed` | boolean | No | Include full metadata. Default: false |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### `delete_session`
|
|
75
|
+
|
|
76
|
+
**What it does**: Delete a saved session by name.
|
|
77
|
+
|
|
78
|
+
**Why you'd use it**: Clean up old or expired sessions.
|
|
79
|
+
|
|
80
|
+
| Parameter | Type | Required | Description |
|
|
81
|
+
|-----------|------|----------|-------------|
|
|
82
|
+
| `name` | string | Yes | Session to delete |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Browser State Tools
|
|
87
|
+
|
|
88
|
+
### `reset_browser`
|
|
89
|
+
|
|
90
|
+
**What it does**: Reset the browser to a clean state — clears all cookies, storage, and cache.
|
|
91
|
+
|
|
92
|
+
**Why you'd use it**: Ensure test isolation by starting from a blank slate.
|
|
93
|
+
|
|
94
|
+
| Parameter | Type | Required | Description |
|
|
95
|
+
|-----------|------|----------|-------------|
|
|
96
|
+
| `preserveSession` | string | No | Session name to preserve during reset |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### `browser_health`
|
|
101
|
+
|
|
102
|
+
**What it does**: Check if the browser is healthy and responsive.
|
|
103
|
+
|
|
104
|
+
**Why you'd use it**: Diagnose issues when automation stops responding.
|
|
105
|
+
|
|
106
|
+
| Parameter | Type | Required | Description |
|
|
107
|
+
|-----------|------|----------|-------------|
|
|
108
|
+
| *none* | | | |
|
|
109
|
+
|
|
110
|
+
**Returns**:
|
|
111
|
+
- Browser status (healthy/unhealthy)
|
|
112
|
+
- Memory usage
|
|
113
|
+
- Open pages count
|
|
114
|
+
- Last activity timestamp
|
|
115
|
+
- Any error conditions
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### `browser_recover`
|
|
120
|
+
|
|
121
|
+
**What it does**: Attempt to recover from a browser crash or unresponsive state by restarting.
|
|
122
|
+
|
|
123
|
+
**Why you'd use it**: Automatic recovery when things go wrong.
|
|
124
|
+
|
|
125
|
+
| Parameter | Type | Required | Description |
|
|
126
|
+
|-----------|------|----------|-------------|
|
|
127
|
+
| `preserveState` | boolean | No | Try to restore tabs after restart. Default: true |
|
|
128
|
+
|
|
129
|
+
**Note**: v11.9.0 added exponential backoff for crash recovery.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Stealth Mode Tools 🔒 Enterprise
|
|
134
|
+
|
|
135
|
+
> **All stealth tools require CBrowser Enterprise.**
|
|
136
|
+
> Stealth mode is constitutional — it only works on domains you've explicitly authorized with signed attestation.
|
|
137
|
+
> This prevents misuse while enabling legitimate testing of your own properties.
|
|
138
|
+
|
|
139
|
+
### `stealth_enable` 🔒 Enterprise
|
|
140
|
+
|
|
141
|
+
**What it does**: Enable stealth mode to bypass bot detection on authorized domains.
|
|
142
|
+
|
|
143
|
+
**Why you'd use it**: Test your own sites that use aggressive bot protection.
|
|
144
|
+
|
|
145
|
+
| Parameter | Type | Required | Description |
|
|
146
|
+
|-----------|------|----------|-------------|
|
|
147
|
+
| `authorized_domains` | array | Yes | Domains you're authorized to test |
|
|
148
|
+
| `signed_by` | string | Yes | Your email confirming authorization |
|
|
149
|
+
| `proxy_server` | string | No | Proxy server URL |
|
|
150
|
+
| `proxy_username` | string | No | Proxy authentication |
|
|
151
|
+
| `proxy_password` | string | No | Proxy authentication |
|
|
152
|
+
|
|
153
|
+
**Example**:
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"authorized_domains": ["example.com", "staging.example.com"],
|
|
157
|
+
"signed_by": "yourname@example.com"
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Constitutional Requirement**: Stealth only works on the specific domains you've authorized. Attempts to use it elsewhere fail with a security error.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### `stealth_disable` 🔒 Enterprise
|
|
166
|
+
|
|
167
|
+
**What it does**: Disable stealth mode, returning to standard browser fingerprint.
|
|
168
|
+
|
|
169
|
+
**Why you'd use it**: When you're done testing protected sites.
|
|
170
|
+
|
|
171
|
+
| Parameter | Type | Required | Description |
|
|
172
|
+
|-----------|------|----------|-------------|
|
|
173
|
+
| *none* | | | |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### `stealth_status` 🔒 Enterprise
|
|
178
|
+
|
|
179
|
+
**What it does**: Check current stealth configuration and status.
|
|
180
|
+
|
|
181
|
+
**Why you'd use it**: Verify stealth is configured correctly before testing.
|
|
182
|
+
|
|
183
|
+
| Parameter | Type | Required | Description |
|
|
184
|
+
|-----------|------|----------|-------------|
|
|
185
|
+
| *none* | | | |
|
|
186
|
+
|
|
187
|
+
**Returns**: Enabled status, authorized domains, proxy configuration (masked), enterprise version.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
### `stealth_check` 🔒 Enterprise
|
|
192
|
+
|
|
193
|
+
**What it does**: Check if a specific action is allowed on a URL under current stealth configuration.
|
|
194
|
+
|
|
195
|
+
**Why you'd use it**: Verify authorization before attempting an action that might fail.
|
|
196
|
+
|
|
197
|
+
| Parameter | Type | Required | Description |
|
|
198
|
+
|-----------|------|----------|-------------|
|
|
199
|
+
| `action` | string | Yes | Action to check (e.g., "navigate", "fill") |
|
|
200
|
+
| `url` | string | Yes | URL where action would occur |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### `stealth_diagnose` 🔒 Enterprise
|
|
205
|
+
|
|
206
|
+
**What it does**: Analyze what bot detection methods a site uses.
|
|
207
|
+
|
|
208
|
+
**Why you'd use it**: Understand what you're up against before enabling stealth.
|
|
209
|
+
|
|
210
|
+
| Parameter | Type | Required | Description |
|
|
211
|
+
|-----------|------|----------|-------------|
|
|
212
|
+
| `url` | string | Yes | URL to analyze |
|
|
213
|
+
|
|
214
|
+
**Returns**: Detection methods found (fingerprinting, IP reputation, WAF type, JavaScript challenges).
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Cloudflare Tools 🔒 Enterprise
|
|
219
|
+
|
|
220
|
+
### `cloudflare_detect` 🔒 Enterprise
|
|
221
|
+
|
|
222
|
+
**What it does**: Detect if a page is showing a Cloudflare challenge or block.
|
|
223
|
+
|
|
224
|
+
**Why you'd use it**: Know if you need to handle Cloudflare before proceeding.
|
|
225
|
+
|
|
226
|
+
| Parameter | Type | Required | Description |
|
|
227
|
+
|-----------|------|----------|-------------|
|
|
228
|
+
| `url` | string | Yes | URL to check |
|
|
229
|
+
|
|
230
|
+
**Returns**: Challenge type (JS challenge, Turnstile, block), detection confidence.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### `cloudflare_wait` 🔒 Enterprise
|
|
235
|
+
|
|
236
|
+
**What it does**: Wait for a Cloudflare challenge to complete naturally.
|
|
237
|
+
|
|
238
|
+
**Why you'd use it**: Let stealth mode handle the challenge while you wait.
|
|
239
|
+
|
|
240
|
+
| Parameter | Type | Required | Description |
|
|
241
|
+
|-----------|------|----------|-------------|
|
|
242
|
+
| `url` | string | Yes | URL with Cloudflare challenge |
|
|
243
|
+
| `timeout` | number | No | Max wait time in seconds. Default: 30 |
|
|
244
|
+
|
|
245
|
+
**Returns**: Success/failure, final page state, time taken.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Why Stealth Requires Authorization
|
|
250
|
+
|
|
251
|
+
CBrowser's stealth mode is designed for legitimate testing:
|
|
252
|
+
|
|
253
|
+
1. **You specify exactly which domains** you're authorized to test
|
|
254
|
+
2. **You sign with your email** creating an audit trail
|
|
255
|
+
3. **Attempts on unauthorized domains fail** immediately
|
|
256
|
+
4. **Enterprise license is required** ensuring accountability
|
|
257
|
+
|
|
258
|
+
This prevents misuse while enabling:
|
|
259
|
+
- Testing your own bot-protected sites
|
|
260
|
+
- QA on staging environments with production security
|
|
261
|
+
- Security assessments of your own properties
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Related Documentation
|
|
266
|
+
|
|
267
|
+
- [Constitutional Safety](/docs/Constitutional-Safety/) — How CBrowser classifies and limits actions
|
|
268
|
+
- [Tools Overview](/docs/Tools-Overview/) — All tools by category
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
*Last updated: v17.6.0*
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# Testing & Quality Tools
|
|
2
|
+
|
|
3
|
+
**Write tests in plain English. Let AI fix them when they break.**
|
|
4
|
+
|
|
5
|
+
These 7 tools transform how you write, maintain, and debug tests. Natural language test suites, automatic repair of broken selectors, flaky test detection, and coverage mapping — all without writing a single line of test code.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to Use These Tools
|
|
10
|
+
|
|
11
|
+
- **You hate writing test scripts** but need test coverage
|
|
12
|
+
- **Your tests break constantly** when the UI changes
|
|
13
|
+
- **You have flaky tests** that randomly pass and fail
|
|
14
|
+
- **You don't know what's untested** and want a coverage map
|
|
15
|
+
- **You want autonomous bug finding** without writing test cases
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Tools
|
|
20
|
+
|
|
21
|
+
### `nl_test_inline`
|
|
22
|
+
|
|
23
|
+
**What it does**: Run tests written in plain English, passed directly as text.
|
|
24
|
+
|
|
25
|
+
**Why you'd use it**: Quick validation without creating test files. Great for ad-hoc testing and CI pipelines.
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Required | Description |
|
|
28
|
+
|-----------|------|----------|-------------|
|
|
29
|
+
| `tests` | string | Yes | Natural language test steps, one per line |
|
|
30
|
+
| `stopOnFailure` | boolean | No | Stop at first failure. Default: false |
|
|
31
|
+
| `screenshots` | boolean | No | Capture screenshot after each step. Default: false |
|
|
32
|
+
|
|
33
|
+
**Example**:
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"tests": "go to https://example.com\nclick the login button\nfill email with test@example.com\nfill password with secret123\nclick submit\nverify the page contains Welcome",
|
|
37
|
+
"screenshots": true
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Test Syntax
|
|
42
|
+
|
|
43
|
+
| Instruction | Examples |
|
|
44
|
+
|-------------|----------|
|
|
45
|
+
| **Navigate** | `go to https://...`, `navigate to https://...`, `open https://...` |
|
|
46
|
+
| **Click** | `click the login button`, `click Submit`, `press Enter` |
|
|
47
|
+
| **Fill** | `type "value" in email field`, `fill username with "john"` |
|
|
48
|
+
| **Wait** | `wait 2 seconds`, `wait for "Loading" to disappear` |
|
|
49
|
+
| **Assert** | `verify page contains "Welcome"`, `verify url contains "/home"` |
|
|
50
|
+
| **Screenshot** | `take screenshot` |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### `nl_test_file`
|
|
55
|
+
|
|
56
|
+
**What it does**: Run a test suite from a file. Supports multiple test blocks and better organization.
|
|
57
|
+
|
|
58
|
+
**Why you'd use it**: Maintain test suites as simple text files that anyone can read and edit.
|
|
59
|
+
|
|
60
|
+
| Parameter | Type | Required | Description |
|
|
61
|
+
|-----------|------|----------|-------------|
|
|
62
|
+
| `path` | string | Yes | Path to the test file |
|
|
63
|
+
| `filter` | string | No | Run only tests matching this pattern |
|
|
64
|
+
| `dryRun` | boolean | No | Parse tests without executing. Default: false |
|
|
65
|
+
|
|
66
|
+
**Example**:
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"path": "/tests/checkout-flow.txt",
|
|
70
|
+
"filter": "payment"
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Test File Format
|
|
75
|
+
|
|
76
|
+
```txt
|
|
77
|
+
# Test: Login Flow
|
|
78
|
+
go to https://example.com
|
|
79
|
+
click the login button
|
|
80
|
+
fill email with user@example.com
|
|
81
|
+
fill password with password123
|
|
82
|
+
click submit
|
|
83
|
+
verify url contains /dashboard
|
|
84
|
+
|
|
85
|
+
# Test: Failed Login
|
|
86
|
+
go to https://example.com/login
|
|
87
|
+
fill email with wrong@example.com
|
|
88
|
+
fill password with badpassword
|
|
89
|
+
click submit
|
|
90
|
+
verify page contains "Invalid credentials"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### `generate_tests`
|
|
96
|
+
|
|
97
|
+
**What it does**: Analyze a page and automatically generate test scenarios covering its functionality.
|
|
98
|
+
|
|
99
|
+
**Why you'd use it**: Bootstrap test coverage for a new page or discover tests you didn't think to write.
|
|
100
|
+
|
|
101
|
+
| Parameter | Type | Required | Description |
|
|
102
|
+
|-----------|------|----------|-------------|
|
|
103
|
+
| `url` | string | Yes | Page to analyze |
|
|
104
|
+
| `depth` | string | No | Test depth: `smoke`, `standard`, `comprehensive`. Default: `standard` |
|
|
105
|
+
| `focus` | string | No | Focus area: `forms`, `navigation`, `errors`, `all` |
|
|
106
|
+
|
|
107
|
+
**Example**:
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"url": "https://example.com/checkout",
|
|
111
|
+
"depth": "comprehensive",
|
|
112
|
+
"focus": "forms"
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Returns**: Generated test file content with scenarios for happy paths, edge cases, and error conditions.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### `repair_test`
|
|
121
|
+
|
|
122
|
+
**What it does**: Automatically fix a broken test by analyzing what changed and updating selectors/assertions.
|
|
123
|
+
|
|
124
|
+
**Why you'd use it**: When a test fails due to UI changes, repair it instead of rewriting it.
|
|
125
|
+
|
|
126
|
+
| Parameter | Type | Required | Description |
|
|
127
|
+
|-----------|------|----------|-------------|
|
|
128
|
+
| `testPath` | string | Yes | Path to the broken test file |
|
|
129
|
+
| `errorContext` | string | No | Error message or failure details |
|
|
130
|
+
| `autoApply` | boolean | No | Apply fixes automatically. Default: false |
|
|
131
|
+
| `verify` | boolean | No | Run repaired test to verify fix. Default: true |
|
|
132
|
+
|
|
133
|
+
**Example**:
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"testPath": "/tests/checkout.txt",
|
|
137
|
+
"errorContext": "Element 'Submit Order' not found",
|
|
138
|
+
"autoApply": true
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Returns**: Proposed fixes, what changed, and (if verified) confirmation the repaired test passes.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### `detect_flaky_tests`
|
|
147
|
+
|
|
148
|
+
**What it does**: Run tests multiple times to identify which ones are unreliable.
|
|
149
|
+
|
|
150
|
+
**Why you'd use it**: Find tests that randomly fail so you can fix them or quarantine them.
|
|
151
|
+
|
|
152
|
+
| Parameter | Type | Required | Description |
|
|
153
|
+
|-----------|------|----------|-------------|
|
|
154
|
+
| `testPath` | string | Yes | Test file to check |
|
|
155
|
+
| `runs` | number | No | Number of runs. Default: 5 |
|
|
156
|
+
| `threshold` | number | No | Failure percentage to mark as flaky. Default: 20 |
|
|
157
|
+
|
|
158
|
+
**Example**:
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"testPath": "/tests/full-suite.txt",
|
|
162
|
+
"runs": 10,
|
|
163
|
+
"threshold": 10
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Returns**: List of flaky tests with failure rates, timing variance, and suggested fixes.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### `coverage_map`
|
|
172
|
+
|
|
173
|
+
**What it does**: Generate a test coverage map showing which pages and features are tested.
|
|
174
|
+
|
|
175
|
+
**Why you'd use it**: Find gaps in test coverage before they become bugs in production.
|
|
176
|
+
|
|
177
|
+
| Parameter | Type | Required | Description |
|
|
178
|
+
|-----------|------|----------|-------------|
|
|
179
|
+
| `siteUrl` | string | Yes | Base URL of the site |
|
|
180
|
+
| `testsPath` | string | Yes | Path to test files (supports glob patterns) |
|
|
181
|
+
| `depth` | number | No | Crawl depth for discovering pages. Default: 3 |
|
|
182
|
+
|
|
183
|
+
**Example**:
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"siteUrl": "https://example.com",
|
|
187
|
+
"testsPath": "/tests/**/*.txt",
|
|
188
|
+
"depth": 3
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Returns**: Coverage matrix showing each page, what tests cover it, and what's untested.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### `hunt_bugs`
|
|
197
|
+
|
|
198
|
+
**What it does**: Autonomously explore a site looking for bugs, errors, and accessibility issues — without being told what to test.
|
|
199
|
+
|
|
200
|
+
**Why you'd use it**: Discover issues you didn't know existed. Great for exploratory testing and security reconnaissance.
|
|
201
|
+
|
|
202
|
+
| Parameter | Type | Required | Description |
|
|
203
|
+
|-----------|------|----------|-------------|
|
|
204
|
+
| `url` | string | Yes | Starting URL |
|
|
205
|
+
| `scope` | string | No | Bug types: `all`, `functional`, `visual`, `accessibility`, `security` |
|
|
206
|
+
| `depth` | number | No | Exploration depth. Default: 3 |
|
|
207
|
+
| `maxPages` | number | No | Maximum pages to visit. Default: 20 |
|
|
208
|
+
|
|
209
|
+
**Example**:
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"url": "https://example.com",
|
|
213
|
+
"scope": "all",
|
|
214
|
+
"depth": 4,
|
|
215
|
+
"maxPages": 50
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Returns**: List of discovered issues with severity, reproduction steps, and screenshots.
|
|
220
|
+
|
|
221
|
+
### What `hunt_bugs` Looks For
|
|
222
|
+
|
|
223
|
+
- **Functional**: Broken links, form errors, JavaScript exceptions, failed network requests
|
|
224
|
+
- **Visual**: Layout breaks, overlapping elements, missing images, rendering issues
|
|
225
|
+
- **Accessibility**: Missing alt text, low contrast, keyboard traps, ARIA violations
|
|
226
|
+
- **Security**: Exposed credentials, insecure forms, missing HTTPS, data in URLs
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Natural Language Test Advantages
|
|
231
|
+
|
|
232
|
+
| Traditional Tests | CBrowser NL Tests |
|
|
233
|
+
|-------------------|-------------------|
|
|
234
|
+
| `await page.click('#btn-submit-order-v3')` | `click the Submit Order button` |
|
|
235
|
+
| Breaks when ID changes | Finds button by intent |
|
|
236
|
+
| Requires developer to write | Anyone can write |
|
|
237
|
+
| Hard to read for non-devs | Self-documenting |
|
|
238
|
+
| Manual repair on failure | Auto-repair available |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Related Documentation
|
|
243
|
+
|
|
244
|
+
- [Natural Language Tests](/docs/Natural-Language-Tests/) — Deep dive on NL test syntax
|
|
245
|
+
- [AI Test Repair](/docs/AI-Test-Repair/) — How repair works
|
|
246
|
+
- [Flaky Test Detection](/docs/Flaky-Test-Detection/) — Dealing with unreliable tests
|
|
247
|
+
- [Test Coverage Map](/docs/Test-Coverage-Map/) — Understanding coverage
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
*Last updated: v17.6.0*
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Utility Tools
|
|
2
|
+
|
|
3
|
+
**Diagnostics, health checks, and infrastructure.**
|
|
4
|
+
|
|
5
|
+
These 6 tools handle diagnostics, self-healing statistics, agent-readiness audits, and API key management (Enterprise). The tools that keep everything else running smoothly.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
### `status`
|
|
12
|
+
|
|
13
|
+
**What it does**: Get comprehensive CBrowser environment diagnostics.
|
|
14
|
+
|
|
15
|
+
**Why you'd use it**: Debug configuration issues, verify installation, check capabilities.
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Required | Description |
|
|
18
|
+
|-----------|------|----------|-------------|
|
|
19
|
+
| *none* | | | |
|
|
20
|
+
|
|
21
|
+
**Returns**:
|
|
22
|
+
- CBrowser version
|
|
23
|
+
- Browser backend (Chromium/Firefox/WebKit)
|
|
24
|
+
- Data directory location
|
|
25
|
+
- Enterprise availability
|
|
26
|
+
- Authentication status
|
|
27
|
+
- Recent activity summary
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### `heal_stats`
|
|
32
|
+
|
|
33
|
+
**What it does**: Get statistics on the self-healing selector cache — how many selectors have been healed, hit rate, storage usage.
|
|
34
|
+
|
|
35
|
+
**Why you'd use it**: Understand how well self-healing is working and whether the cache needs maintenance.
|
|
36
|
+
|
|
37
|
+
| Parameter | Type | Required | Description |
|
|
38
|
+
|-----------|------|----------|-------------|
|
|
39
|
+
| `detailed` | boolean | No | Include per-domain breakdown. Default: false |
|
|
40
|
+
|
|
41
|
+
**Returns**:
|
|
42
|
+
- Total healed selectors
|
|
43
|
+
- Cache hit rate
|
|
44
|
+
- Most frequently healed selectors
|
|
45
|
+
- Cache age and size
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### `agent_ready_audit`
|
|
50
|
+
|
|
51
|
+
**What it does**: Audit a website for AI-agent friendliness. Scores how easily an autonomous AI could navigate and interact with the site.
|
|
52
|
+
|
|
53
|
+
**Why you'd use it**: Know if your site is ready for the AI agent future. Sites that score well are also easier for humans to use.
|
|
54
|
+
|
|
55
|
+
| Parameter | Type | Required | Description |
|
|
56
|
+
|-----------|------|----------|-------------|
|
|
57
|
+
| `url` | string | Yes | URL to audit |
|
|
58
|
+
| `depth` | number | No | Pages to crawl. Default: 5 |
|
|
59
|
+
|
|
60
|
+
**Example**:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"url": "https://example.com",
|
|
64
|
+
"depth": 10
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Returns**:
|
|
69
|
+
- Overall score (0-100)
|
|
70
|
+
- Grade (A-F)
|
|
71
|
+
- Category scores:
|
|
72
|
+
- Semantic HTML quality
|
|
73
|
+
- ARIA completeness
|
|
74
|
+
- Consistent navigation
|
|
75
|
+
- Clear form labels
|
|
76
|
+
- Predictable interactive elements
|
|
77
|
+
- Error message clarity
|
|
78
|
+
- Specific recommendations
|
|
79
|
+
|
|
80
|
+
### Scoring
|
|
81
|
+
|
|
82
|
+
| Grade | Score | Meaning |
|
|
83
|
+
|-------|-------|---------|
|
|
84
|
+
| A | 90-100 | Excellent agent compatibility |
|
|
85
|
+
| B | 80-89 | Good, minor improvements possible |
|
|
86
|
+
| C | 70-79 | Acceptable, some friction for agents |
|
|
87
|
+
| D | 60-69 | Poor, significant navigation challenges |
|
|
88
|
+
| F | <60 | Hostile to automated interaction |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## API Key Management 🔒 Enterprise
|
|
93
|
+
|
|
94
|
+
> **All API key tools require CBrowser Enterprise.**
|
|
95
|
+
> API keys enable autonomous cognitive journeys that make AI decisions without human orchestration.
|
|
96
|
+
|
|
97
|
+
### `set_api_key` 🔒 Enterprise
|
|
98
|
+
|
|
99
|
+
**What it does**: Store an Anthropic API key in encrypted session memory for autonomous journey execution.
|
|
100
|
+
|
|
101
|
+
**Why you'd use it**: Enable `cognitive_journey_autonomous` and other features that require AI decision-making.
|
|
102
|
+
|
|
103
|
+
| Parameter | Type | Required | Description |
|
|
104
|
+
|-----------|------|----------|-------------|
|
|
105
|
+
| `api_key` | string | Yes | Your Anthropic API key (starts with `sk-ant-`) |
|
|
106
|
+
|
|
107
|
+
**Security**: Keys are stored in memory only, not persisted to disk. They're cleared when the session ends.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### `clear_api_key` 🔒 Enterprise
|
|
112
|
+
|
|
113
|
+
**What it does**: Remove the stored API key from session memory.
|
|
114
|
+
|
|
115
|
+
**Why you'd use it**: Clear credentials when you're done or before switching accounts.
|
|
116
|
+
|
|
117
|
+
| Parameter | Type | Required | Description |
|
|
118
|
+
|-----------|------|----------|-------------|
|
|
119
|
+
| *none* | | | |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `api_key_status` 🔒 Enterprise
|
|
124
|
+
|
|
125
|
+
**What it does**: Check if an API key is currently stored without revealing the key itself.
|
|
126
|
+
|
|
127
|
+
**Why you'd use it**: Verify setup before running autonomous operations.
|
|
128
|
+
|
|
129
|
+
| Parameter | Type | Required | Description |
|
|
130
|
+
|-----------|------|----------|-------------|
|
|
131
|
+
| *none* | | | |
|
|
132
|
+
|
|
133
|
+
**Returns**:
|
|
134
|
+
- Key stored: yes/no
|
|
135
|
+
- Key prefix (first 8 chars, masked)
|
|
136
|
+
- When stored (timestamp)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### `get_api_key_prompt` 🔒 Enterprise
|
|
141
|
+
|
|
142
|
+
**What it does**: Get instructions for obtaining an Anthropic API key.
|
|
143
|
+
|
|
144
|
+
**Why you'd use it**: Help users who need to set up API access.
|
|
145
|
+
|
|
146
|
+
| Parameter | Type | Required | Description |
|
|
147
|
+
|-----------|------|----------|-------------|
|
|
148
|
+
| *none* | | | |
|
|
149
|
+
|
|
150
|
+
**Returns**: Step-by-step instructions for creating an Anthropic account and generating an API key.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Demo vs Enterprise
|
|
155
|
+
|
|
156
|
+
| Tool | Demo | Enterprise |
|
|
157
|
+
|------|------|------------|
|
|
158
|
+
| `status` | ✅ | ✅ |
|
|
159
|
+
| `heal_stats` | ✅ | ✅ |
|
|
160
|
+
| `agent_ready_audit` | ✅ | ✅ |
|
|
161
|
+
| `set_api_key` | ❌ | ✅ |
|
|
162
|
+
| `clear_api_key` | ❌ | ✅ |
|
|
163
|
+
| `api_key_status` | ❌ | ✅ |
|
|
164
|
+
| `get_api_key_prompt` | ❌ | ✅ |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Related Documentation
|
|
169
|
+
|
|
170
|
+
- [Tools Overview](/docs/Tools-Overview/) — All tools by category
|
|
171
|
+
- [MCP Server](/docs/MCP-Server/) — Running CBrowser locally
|
|
172
|
+
- [Remote MCP Server](/docs/Remote-MCP-Server/) — Cloud deployment
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
*Last updated: v17.6.0*
|