cbrowser 7.4.19 → 7.9.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.
@@ -0,0 +1,153 @@
1
+ # Multi-Persona Comparison Report
2
+
3
+ Run the same user journey through multiple personas to uncover usability gaps across different user types. Generate a comparative report showing where each persona succeeds, struggles, or fails entirely.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 18+
8
+ - CBrowser installed: `npm install -g cbrowser`
9
+ - Target application at `https://shop.example.com`
10
+
11
+ ## Step 1: Establish a Visual Baseline
12
+
13
+ Capture the current state of the application before running persona tests.
14
+
15
+ ```bash
16
+ npx cbrowser visual-baseline "https://shop.example.com" --name pre-persona-test
17
+ ```
18
+
19
+ This gives you a reference point to pair persona findings with specific UI elements.
20
+
21
+ ## Step 2: Define the Journey
22
+
23
+ Choose a complete user journey that exercises core functionality. The comparison will run each persona through the identical goal.
24
+
25
+ ```bash
26
+ npx cbrowser compare-personas \
27
+ --personas power-user,first-timer,elderly-user,mobile-user \
28
+ --start "https://shop.example.com" \
29
+ --goal "Complete purchase" \
30
+ --html
31
+ ```
32
+
33
+ ## Sample Report Output
34
+
35
+ ```
36
+ Persona Comparison Report
37
+ Journey: "Complete purchase"
38
+ Start URL: https://shop.example.com
39
+ Generated: 2026-02-03T11:00:00Z
40
+
41
+ === Summary Table ===
42
+
43
+ Metric power-user first-timer elderly-user mobile-user
44
+ -----------------------------------------------------------------------
45
+ Completed: Yes Yes No Yes
46
+ Time to complete: 1m 04s 3m 47s -- 2m 22s
47
+ Total clicks: 8 14 21 (stuck) 11
48
+ Errors hit: 0 2 4 1
49
+ Friction points: 1 5 8 3
50
+ Accessibility: No issues 1 issue 6 issues 2 issues
51
+ Satisfaction est.: High Medium Low Medium
52
+
53
+ === Detailed Breakdown by Persona ===
54
+
55
+ --- power-user ---
56
+ Path: Home > Search "headphones" > Product page > Add to cart > Checkout > Confirm
57
+ Friction: Checkout form requires re-entering saved address (minor annoyance)
58
+ Notes: Used keyboard shortcuts, skipped optional fields, completed efficiently
59
+
60
+ --- first-timer ---
61
+ Path: Home > Browse categories > Subcategory > Product page > Add to cart > Cart
62
+ > Confused by "Guest checkout" vs "Sign up" > Signed up > Checkout > Confirm
63
+ Friction:
64
+ - Could not find search bar immediately (hidden behind icon)
65
+ - "Guest checkout" label unclear, hesitated for 18s
66
+ - Password requirements not shown until after submission
67
+ - Shipping options lack delivery date estimates
68
+ - Coupon field prominent but no coupon available (felt like missing a deal)
69
+ Errors:
70
+ - Password rejected twice before requirements appeared
71
+ - Zip code validation rejected valid format "K1A 0B1"
72
+
73
+ --- elderly-user ---
74
+ Path: Home > Struggled with navigation > Found products > Product page
75
+ > Add to cart > Cart > STUCK at checkout
76
+ Friction:
77
+ - Navigation dropdown menus close too quickly (requires precise mouse movement)
78
+ - Product text size 13px, hard to read without zooming
79
+ - "Add to Cart" button low contrast (light gray on white)
80
+ - Cart icon badge too small to notice (12px)
81
+ - Form fields lack visible borders (only bottom underline)
82
+ - Checkout timeout (60s) expired during address entry
83
+ - No option to increase text size
84
+ - Error messages disappear after 3 seconds
85
+ BLOCKED: Session timed out during checkout, no recovery path offered
86
+ Result: COULD NOT COMPLETE PURCHASE
87
+
88
+ --- mobile-user ---
89
+ Path: Home > Hamburger menu > Products > Product page > Add to cart > Checkout > Confirm
90
+ Friction:
91
+ - Hamburger menu icon small (32x32, below 44px minimum)
92
+ - Product image gallery swipe conflicts with page scroll
93
+ - Keyboard covers checkout form fields on iOS
94
+ Errors:
95
+ - Tapped "Remove" instead of "Update quantity" (buttons too close)
96
+
97
+ === Cross-Persona Issue Heatmap ===
98
+
99
+ Issue power first elderly mobile
100
+ -------------------------------------------------------------
101
+ Small touch/click targets - - HIGH MED
102
+ Text readability - - HIGH LOW
103
+ Navigation complexity - MED HIGH LOW
104
+ Form usability - MED HIGH MED
105
+ Error handling - HIGH HIGH LOW
106
+ Session/timeout - - HIGH -
107
+ Discoverability - HIGH MED LOW
108
+
109
+ === Top Recommendations (Priority Order) ===
110
+
111
+ 1. CRITICAL: Add session timeout warning with option to extend (blocks elderly-user)
112
+ 2. HIGH: Increase minimum touch target size to 44x44px across all interactive elements
113
+ 3. HIGH: Show password requirements before first submission attempt
114
+ 4. HIGH: Increase base font size to 16px minimum, add text resize controls
115
+ 5. MEDIUM: Make search bar visible by default, not hidden behind an icon
116
+ 6. MEDIUM: Add visible borders to all form fields
117
+ 7. LOW: Add estimated delivery dates to shipping options
118
+ ```
119
+
120
+ ## Step 3: Generate Shareable HTML Report
121
+
122
+ The `--html` flag produces a standalone HTML file with interactive filtering.
123
+
124
+ ```bash
125
+ # Report saved to .cbrowser/reports/persona-comparison-<timestamp>.html
126
+ open .cbrowser/reports/persona-comparison-*.html
127
+ ```
128
+
129
+ The HTML report includes expandable sections for each persona, clickable screenshots at each step, and a filterable issue table.
130
+
131
+ ## Step 4: Retest After Fixes
132
+
133
+ After addressing the findings, rerun the comparison to measure improvement.
134
+
135
+ ```bash
136
+ # Run the same comparison after implementing fixes
137
+ npx cbrowser compare-personas \
138
+ --personas power-user,first-timer,elderly-user,mobile-user \
139
+ --start "https://shop.example.com" \
140
+ --goal "Complete purchase" \
141
+ --html
142
+
143
+ # Compare visual changes against the pre-fix baseline
144
+ npx cbrowser visual-regression "https://shop.example.com" --baseline pre-persona-test
145
+ ```
146
+
147
+ ## Next Steps
148
+
149
+ - Address critical and high-priority issues first, then retest the blocked persona (elderly-user).
150
+ - Add more personas as needed: `keyboard-only-user`, `screen-reader-user`, `low-bandwidth-user`.
151
+ - Run persona comparisons on other key journeys: account creation, returns, support contact.
152
+ - Track improvement over time by archiving reports from each sprint.
153
+ - Set a CI gate: all personas must complete the journey before merging to main.
@@ -0,0 +1,123 @@
1
+ # Visual Regression Testing for CI
2
+
3
+ Catch unintended visual changes before they reach production. Capture baseline screenshots, run comparisons across browsers and viewports, and surface pixel-level diffs.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 18+
8
+ - CBrowser installed: `npm install -g cbrowser`
9
+ - Target application deployed at `https://app.example.com`
10
+
11
+ ## Step 1: Capture a Baseline
12
+
13
+ Take reference screenshots of your production pages to compare future changes against.
14
+
15
+ ```bash
16
+ # Capture baseline screenshots of key pages
17
+ npx cbrowser visual-baseline "https://app.example.com" --name production
18
+
19
+ # Optionally target specific pages
20
+ npx cbrowser visual-baseline "https://app.example.com/dashboard" --name production-dashboard
21
+ npx cbrowser visual-baseline "https://app.example.com/settings" --name production-settings
22
+ ```
23
+
24
+ This stores timestamped screenshots in `.cbrowser/baselines/production/`.
25
+
26
+ ## Step 2: Run Visual Regression
27
+
28
+ After deploying a new build to staging, compare against the baseline.
29
+
30
+ ```bash
31
+ npx cbrowser visual-regression "https://staging.example.com" --baseline production
32
+ ```
33
+
34
+ ## Expected Diff Output
35
+
36
+ ```
37
+ Visual Regression Report: staging vs production
38
+ Generated: 2026-02-03T14:30:00Z
39
+
40
+ Page: /
41
+ Similarity: 99.7% [PASS]
42
+ Diff pixels: 342 of 2,073,600
43
+
44
+ Page: /dashboard
45
+ Similarity: 94.2% [FAIL - below 98% threshold]
46
+ Diff pixels: 120,432 of 2,073,600
47
+ Changes detected:
48
+ - Header region: navigation bar height changed (+4px)
49
+ - Sidebar: new icon added to menu
50
+ - Chart area: color palette shifted
51
+
52
+ Page: /settings
53
+ Similarity: 100.0% [PASS]
54
+ Diff pixels: 0 of 2,073,600
55
+
56
+ Summary: 2 passed, 1 failed
57
+ Diff images saved to: .cbrowser/diffs/staging-vs-production/
58
+ ```
59
+
60
+ ## Step 3: Cross-Browser Testing
61
+
62
+ Verify rendering consistency across browser engines.
63
+
64
+ ```bash
65
+ npx cbrowser cross-browser "https://app.example.com"
66
+ ```
67
+
68
+ ```
69
+ Cross-Browser Report: https://app.example.com
70
+ Browsers: Chromium 122, Firefox 123, WebKit 17.4
71
+
72
+ Chromium vs Firefox: 99.1% similar [PASS]
73
+ Chromium vs WebKit: 97.3% similar [WARN - minor differences]
74
+ - Font rendering: anti-aliasing differs in body text
75
+ - Box shadow: 1px offset on card components
76
+ Firefox vs WebKit: 97.8% similar [WARN]
77
+
78
+ All browsers functionally equivalent. Minor rendering differences noted.
79
+ ```
80
+
81
+ ## Step 4: Responsive Viewport Testing
82
+
83
+ Check layouts across common device widths.
84
+
85
+ ```bash
86
+ npx cbrowser responsive "https://app.example.com"
87
+ ```
88
+
89
+ ```
90
+ Responsive Report: https://app.example.com
91
+ Viewports: 375px (mobile), 768px (tablet), 1024px (laptop), 1440px (desktop)
92
+
93
+ 375px (mobile): Layout OK, no horizontal overflow
94
+ 768px (tablet): Layout OK, sidebar collapses correctly
95
+ 1024px (laptop): Layout OK, all columns visible
96
+ 1440px (desktop): Layout OK, max-width container centered
97
+
98
+ Issues found:
99
+ - 375px: "Export" button text truncated to "Exp..."
100
+ - 768px: Table rows require horizontal scroll (expected)
101
+
102
+ Responsive score: 9.2/10
103
+ ```
104
+
105
+ ## CI Integration
106
+
107
+ Add to your pipeline (GitHub Actions example):
108
+
109
+ ```yaml
110
+ - name: Visual Regression
111
+ run: |
112
+ npx cbrowser visual-baseline "$PROD_URL" --name production
113
+ npx cbrowser visual-regression "$STAGING_URL" --baseline production --ci
114
+ npx cbrowser cross-browser "$STAGING_URL" --ci
115
+ npx cbrowser responsive "$STAGING_URL" --ci
116
+ ```
117
+
118
+ ## Next Steps
119
+
120
+ - Set custom thresholds: `--threshold 95` to allow more tolerance.
121
+ - Exclude dynamic regions: `--ignore-regions ".timestamp,.ad-banner"`.
122
+ - Generate HTML reports: add `--html` to produce a shareable diff viewer.
123
+ - Schedule nightly baseline updates after each production deploy.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbrowser",
3
- "version": "7.4.19",
3
+ "version": "7.9.0",
4
4
  "description": "AI-powered browser automation with constitutional safety, AI visual regression, persona testing, and natural language test suites. Modular architecture for visual, testing, analysis, and performance modules.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",