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
|
+
# Visual & Performance Tools
|
|
2
|
+
|
|
3
|
+
**Catch regressions before your users see them.**
|
|
4
|
+
|
|
5
|
+
These 10 tools detect visual changes, performance degradation, cross-browser rendering differences, and responsive layout breakage. Stop finding out about broken deploys from customer complaints.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to Use These Tools
|
|
10
|
+
|
|
11
|
+
- **You're deploying to staging** and want to verify nothing visual broke
|
|
12
|
+
- **Performance matters** and you need to catch slowdowns before production
|
|
13
|
+
- **Your site looks different in Safari** and you need to know exactly what's wrong
|
|
14
|
+
- **Mobile layouts keep breaking** and you want automated viewport testing
|
|
15
|
+
- **You want chaos engineering** to test resilience under failure conditions
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Tools
|
|
20
|
+
|
|
21
|
+
### `visual_baseline`
|
|
22
|
+
|
|
23
|
+
**What it does**: Capture a visual baseline (screenshot + metadata) for a URL to compare against later.
|
|
24
|
+
|
|
25
|
+
**Why you'd use it**: Establish what "correct" looks like so you can detect when it changes.
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Required | Description |
|
|
28
|
+
|-----------|------|----------|-------------|
|
|
29
|
+
| `url` | string | Yes | URL to capture |
|
|
30
|
+
| `name` | string | Yes | Name for this baseline |
|
|
31
|
+
| `viewport` | object | No | Width/height. Default: 1280x720 |
|
|
32
|
+
| `fullPage` | boolean | No | Capture entire page. Default: false |
|
|
33
|
+
|
|
34
|
+
**Example**:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"url": "https://example.com",
|
|
38
|
+
"name": "homepage-desktop",
|
|
39
|
+
"viewport": { "width": 1920, "height": 1080 },
|
|
40
|
+
"fullPage": true
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### `visual_regression`
|
|
47
|
+
|
|
48
|
+
**What it does**: Compare current page state against a saved baseline using AI visual analysis.
|
|
49
|
+
|
|
50
|
+
**Why you'd use it**: Detect meaningful visual changes while ignoring irrelevant differences (timestamps, ads, dynamic content).
|
|
51
|
+
|
|
52
|
+
| Parameter | Type | Required | Description |
|
|
53
|
+
|-----------|------|----------|-------------|
|
|
54
|
+
| `url` | string | Yes | URL to test |
|
|
55
|
+
| `baseline` | string | Yes | Baseline name to compare against |
|
|
56
|
+
| `threshold` | number | No | Difference tolerance (0-100). Default: 5 |
|
|
57
|
+
|
|
58
|
+
**Example**:
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"url": "https://staging.example.com",
|
|
62
|
+
"baseline": "homepage-desktop"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Returns**: Pass/fail, difference percentage, annotated diff image, list of changed regions.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### `ab_comparison`
|
|
71
|
+
|
|
72
|
+
**What it does**: Compare two different URLs visually — staging vs production, old design vs new design.
|
|
73
|
+
|
|
74
|
+
**Why you'd use it**: Side-by-side comparison when you don't have a saved baseline, or when comparing different implementations.
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Required | Description |
|
|
77
|
+
|-----------|------|----------|-------------|
|
|
78
|
+
| `urlA` | string | Yes | First URL (e.g., production) |
|
|
79
|
+
| `urlB` | string | Yes | Second URL (e.g., staging) |
|
|
80
|
+
| `labelA` | string | No | Label for first URL. Default: "A" |
|
|
81
|
+
| `labelB` | string | No | Label for second URL. Default: "B" |
|
|
82
|
+
| `viewport` | object | No | Viewport dimensions |
|
|
83
|
+
|
|
84
|
+
**Example**:
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"urlA": "https://example.com/pricing",
|
|
88
|
+
"urlB": "https://staging.example.com/pricing",
|
|
89
|
+
"labelA": "Production",
|
|
90
|
+
"labelB": "Staging"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Returns**: Side-by-side comparison, diff overlay, list of differences.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### `perf_baseline`
|
|
99
|
+
|
|
100
|
+
**What it does**: Capture performance baseline (Core Web Vitals, load times, resource counts) for a URL.
|
|
101
|
+
|
|
102
|
+
**Why you'd use it**: Know what your current performance is so you can detect regressions.
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Required | Description |
|
|
105
|
+
|-----------|------|----------|-------------|
|
|
106
|
+
| `url` | string | Yes | URL to measure |
|
|
107
|
+
| `name` | string | Yes | Baseline name |
|
|
108
|
+
| `runs` | number | No | Number of measurements to average. Default: 3 |
|
|
109
|
+
|
|
110
|
+
**Example**:
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"url": "https://example.com",
|
|
114
|
+
"name": "homepage-perf",
|
|
115
|
+
"runs": 5
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Returns**: LCP, FCP, TTFB, CLS, total load time, resource breakdown, with "good/needs-improvement/poor" ratings.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `perf_regression`
|
|
124
|
+
|
|
125
|
+
**What it does**: Compare current performance against a baseline with configurable sensitivity.
|
|
126
|
+
|
|
127
|
+
**Why you'd use it**: Catch performance regressions before they ship.
|
|
128
|
+
|
|
129
|
+
| Parameter | Type | Required | Description |
|
|
130
|
+
|-----------|------|----------|-------------|
|
|
131
|
+
| `url` | string | Yes | URL to test |
|
|
132
|
+
| `baseline` | string | Yes | Baseline name |
|
|
133
|
+
| `profile` | string | No | Sensitivity: `strict`, `normal`, `lenient`. Default: `normal` |
|
|
134
|
+
| `thresholdLcp` | number | No | LCP regression threshold %. Default: 20 |
|
|
135
|
+
| `thresholdFcp` | number | No | FCP regression threshold %. Default: 20 |
|
|
136
|
+
|
|
137
|
+
**Example**:
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"url": "https://staging.example.com",
|
|
141
|
+
"baseline": "homepage-perf",
|
|
142
|
+
"profile": "strict"
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Returns**: Pass/fail, metric comparisons, which thresholds were exceeded.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### `list_baselines`
|
|
151
|
+
|
|
152
|
+
**What it does**: List all saved visual and performance baselines.
|
|
153
|
+
|
|
154
|
+
**Why you'd use it**: See what baselines exist before running regression tests.
|
|
155
|
+
|
|
156
|
+
| Parameter | Type | Required | Description |
|
|
157
|
+
|-----------|------|----------|-------------|
|
|
158
|
+
| `type` | string | No | Filter: `visual`, `performance`, `all`. Default: `all` |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### `cross_browser_test`
|
|
163
|
+
|
|
164
|
+
**What it does**: Render a page in Chromium, Firefox, and WebKit and compare the results.
|
|
165
|
+
|
|
166
|
+
**Why you'd use it**: Find browser-specific rendering bugs.
|
|
167
|
+
|
|
168
|
+
| Parameter | Type | Required | Description |
|
|
169
|
+
|-----------|------|----------|-------------|
|
|
170
|
+
| `url` | string | Yes | URL to test |
|
|
171
|
+
| `browsers` | array | No | Browsers to test. Default: `["chromium", "firefox", "webkit"]` |
|
|
172
|
+
| `viewport` | object | No | Viewport dimensions |
|
|
173
|
+
|
|
174
|
+
**Example**:
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"url": "https://example.com/complex-layout",
|
|
178
|
+
"browsers": ["chromium", "webkit"]
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Returns**: Screenshots from each browser, diff analysis, list of rendering differences.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### `cross_browser_diff`
|
|
187
|
+
|
|
188
|
+
**What it does**: Quick comparison of key metrics (layout, fonts, colors) across browsers without full screenshots.
|
|
189
|
+
|
|
190
|
+
**Why you'd use it**: Faster browser comparison when you just need to know if there are issues.
|
|
191
|
+
|
|
192
|
+
| Parameter | Type | Required | Description |
|
|
193
|
+
|-----------|------|----------|-------------|
|
|
194
|
+
| `url` | string | Yes | URL to compare |
|
|
195
|
+
| `browsers` | array | No | Browsers to test |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### `responsive_test`
|
|
200
|
+
|
|
201
|
+
**What it does**: Test page rendering across different viewport sizes (mobile, tablet, desktop).
|
|
202
|
+
|
|
203
|
+
**Why you'd use it**: Catch responsive layout breakage.
|
|
204
|
+
|
|
205
|
+
| Parameter | Type | Required | Description |
|
|
206
|
+
|-----------|------|----------|-------------|
|
|
207
|
+
| `url` | string | Yes | URL to test |
|
|
208
|
+
| `viewports` | array | No | Viewport presets or custom sizes. Default: `["mobile", "tablet", "desktop"]` |
|
|
209
|
+
|
|
210
|
+
**Example**:
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"url": "https://example.com",
|
|
214
|
+
"viewports": ["mobile", "tablet", "desktop-lg"]
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Viewport Presets
|
|
219
|
+
|
|
220
|
+
| Preset | Dimensions |
|
|
221
|
+
|--------|------------|
|
|
222
|
+
| `mobile` | 375x667 |
|
|
223
|
+
| `tablet` | 768x1024 |
|
|
224
|
+
| `desktop` | 1280x720 |
|
|
225
|
+
| `desktop-lg` | 1920x1080 |
|
|
226
|
+
|
|
227
|
+
**Returns**: Screenshots at each viewport, flagged layout issues, overflow problems.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### `chaos_test`
|
|
232
|
+
|
|
233
|
+
**What it does**: Inject failures to test site resilience — offline mode, network latency, blocked resources.
|
|
234
|
+
|
|
235
|
+
**Why you'd use it**: Ensure your site degrades gracefully under adverse conditions.
|
|
236
|
+
|
|
237
|
+
| Parameter | Type | Required | Description |
|
|
238
|
+
|-----------|------|----------|-------------|
|
|
239
|
+
| `url` | string | Yes | URL to test |
|
|
240
|
+
| `chaos` | string | Yes | Type: `offline`, `slow-network`, `block-scripts`, `block-images`, `block-fonts` |
|
|
241
|
+
| `duration` | number | No | How long to apply chaos (seconds). Default: 10 |
|
|
242
|
+
|
|
243
|
+
**Example**:
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"url": "https://example.com/checkout",
|
|
247
|
+
"chaos": "slow-network"
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Returns**: How the page behaves under stress, errors encountered, recovery behavior.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Sensitivity Profiles for Performance
|
|
256
|
+
|
|
257
|
+
| Profile | LCP | FCP | TTFB | Use Case |
|
|
258
|
+
|---------|-----|-----|------|----------|
|
|
259
|
+
| `strict` | 10% | 10% | 15% | Pre-production, critical paths |
|
|
260
|
+
| `normal` | 20% | 20% | 25% | Regular CI/CD |
|
|
261
|
+
| `lenient` | 35% | 35% | 40% | Early development, high variance |
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Related Documentation
|
|
266
|
+
|
|
267
|
+
- [Performance Regression](/docs/Performance-Regression/) — Deep dive on perf testing
|
|
268
|
+
- [Tools Overview](/docs/Tools-Overview/) — All tools by category
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
*Last updated: v17.6.0*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cbrowser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cognitive browser automation that thinks like your users—and helps AI agents navigate too. Simulate real user cognition with abandonment detection, constitutional safety, chaos engineering, and UX friction discovery. Sites that pass CBrowser's cognitive tests are easier for both humans and AI agents to navigate.",
|
|
6
6
|
"main": "dist/index.js",
|