@vizzly-testing/cli 0.8.0 → 0.9.1
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 +26 -13
- package/dist/cli.js +31 -1
- package/dist/client/index.js +77 -11
- package/dist/commands/init.js +23 -17
- package/dist/commands/tdd-daemon.js +362 -0
- package/dist/commands/tdd.js +45 -14
- package/dist/reporter/reporter-bundle.css +1 -0
- package/dist/reporter/reporter-bundle.iife.js +57 -0
- package/dist/server/handlers/api-handler.js +98 -30
- package/dist/server/handlers/tdd-handler.js +264 -77
- package/dist/server/http-server.js +358 -15
- package/dist/services/html-report-generator.js +77 -0
- package/dist/services/report-generator/report.css +56 -0
- package/dist/services/screenshot-server.js +6 -3
- package/dist/services/server-manager.js +2 -9
- package/dist/services/tdd-service.js +188 -25
- package/dist/services/test-runner.js +43 -1
- package/dist/types/commands/tdd-daemon.d.ts +24 -0
- package/dist/types/container/index.d.ts +1 -3
- package/dist/types/reporter/src/components/app-router.d.ts +3 -0
- package/dist/types/reporter/src/components/comparison/comparison-actions.d.ts +5 -0
- package/dist/types/reporter/src/components/comparison/comparison-card.d.ts +6 -0
- package/dist/types/reporter/src/components/comparison/comparison-list.d.ts +6 -0
- package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/view-mode-selector.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/viewer-modes/onion-viewer.d.ts +3 -0
- package/dist/types/reporter/src/components/comparison/viewer-modes/overlay-viewer.d.ts +3 -0
- package/dist/types/reporter/src/components/comparison/viewer-modes/side-by-side-viewer.d.ts +3 -0
- package/dist/types/reporter/src/components/comparison/viewer-modes/toggle-viewer.d.ts +3 -0
- package/dist/types/reporter/src/components/dashboard/dashboard-filters.d.ts +16 -0
- package/dist/types/reporter/src/components/dashboard/dashboard-header.d.ts +5 -0
- package/dist/types/reporter/src/components/dashboard/dashboard-stats.d.ts +4 -0
- package/dist/types/reporter/src/components/dashboard/empty-state.d.ts +8 -0
- package/dist/types/reporter/src/components/ui/smart-image.d.ts +7 -0
- package/dist/types/reporter/src/components/ui/status-badge.d.ts +5 -0
- package/dist/types/reporter/src/components/ui/toast.d.ts +4 -0
- package/dist/types/reporter/src/components/views/comparisons-view.d.ts +6 -0
- package/dist/types/reporter/src/components/views/stats-view.d.ts +6 -0
- package/dist/types/reporter/src/hooks/use-baseline-actions.d.ts +5 -0
- package/dist/types/reporter/src/hooks/use-comparison-filters.d.ts +20 -0
- package/dist/types/reporter/src/hooks/use-image-loader.d.ts +1 -0
- package/dist/types/reporter/src/hooks/use-report-data.d.ts +7 -0
- package/dist/types/reporter/src/hooks/use-vizzly-api.d.ts +9 -0
- package/dist/types/reporter/src/main.d.ts +1 -0
- package/dist/types/reporter/src/services/api-client.d.ts +4 -0
- package/dist/types/reporter/src/utils/comparison-helpers.d.ts +16 -0
- package/dist/types/reporter/src/utils/constants.d.ts +37 -0
- package/dist/types/reporter/vite.config.d.ts +2 -0
- package/dist/types/reporter/vite.dev.config.d.ts +2 -0
- package/dist/types/sdk/index.d.ts +1 -2
- package/dist/types/server/handlers/api-handler.d.ts +5 -14
- package/dist/types/server/handlers/tdd-handler.d.ts +18 -17
- package/dist/types/server/http-server.d.ts +2 -1
- package/dist/types/services/base-service.d.ts +1 -2
- package/dist/types/services/html-report-generator.d.ts +3 -3
- package/dist/types/services/screenshot-server.d.ts +1 -1
- package/dist/types/services/server-manager.d.ts +25 -35
- package/dist/types/services/tdd-service.d.ts +7 -1
- package/dist/types/services/test-runner.d.ts +6 -1
- package/dist/types/utils/build-history.d.ts +16 -0
- package/dist/types/utils/config-loader.d.ts +1 -1
- package/dist/types/utils/console-ui.d.ts +1 -1
- package/dist/types/utils/git.d.ts +4 -4
- package/dist/types/utils/security.d.ts +2 -1
- package/dist/utils/build-history.js +103 -0
- package/dist/utils/security.js +14 -5
- package/docs/api-reference.md +1 -3
- package/docs/getting-started.md +1 -1
- package/docs/tdd-mode.md +178 -112
- package/package.json +20 -4
package/docs/tdd-mode.md
CHANGED
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
# TDD Mode Guide
|
|
2
2
|
|
|
3
|
-
TDD (Test-Driven Development) Mode enables fast local development
|
|
3
|
+
TDD (Test-Driven Development) Mode enables fast local development with an interactive dashboard for real-time visual comparison feedback.
|
|
4
4
|
|
|
5
5
|
## What is TDD Mode?
|
|
6
6
|
|
|
7
|
-
TDD Mode transforms your visual testing workflow
|
|
7
|
+
TDD Mode transforms your visual testing workflow with:
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **Interactive Dashboard** - Real-time visual feedback as tests run
|
|
10
|
+
- **Local Comparison** - Compares screenshots on your machine using `odiff`
|
|
11
|
+
- **Live Updates** - See comparisons instantly in the browser
|
|
12
|
+
- **Baseline Management** - Accept/reject changes directly from the UI
|
|
13
|
+
- **Fast Feedback** - No network uploads during development
|
|
14
|
+
- **No Token Required** - Works entirely offline for local development
|
|
14
15
|
|
|
15
16
|
## Quick Start
|
|
16
17
|
|
|
17
|
-
### 1.
|
|
18
|
+
### 1. Start the TDD Dashboard
|
|
18
19
|
|
|
19
|
-
Start
|
|
20
|
+
Start the interactive dashboard server:
|
|
20
21
|
|
|
21
22
|
```bash
|
|
22
|
-
npx vizzly tdd
|
|
23
|
+
npx vizzly tdd start
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
🐻 **
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- All tests pass (baseline creation)
|
|
26
|
+
🐻 **Dashboard starts:**
|
|
27
|
+
- Opens at `http://localhost:47392` (or custom `--port`)
|
|
28
|
+
- Shows empty state ready for comparisons
|
|
29
|
+
- Runs in the background and returns your terminal immediately
|
|
30
30
|
|
|
31
|
-
### 2.
|
|
31
|
+
### 2. Run Your Tests in Watch Mode
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
In the same terminal or a new one, run your tests in watch mode:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
|
|
37
|
-
vim src/components/Header.js
|
|
38
|
-
|
|
39
|
-
# Test immediately with local comparison
|
|
40
|
-
npx vizzly tdd "npm test"
|
|
36
|
+
npm test -- --watch
|
|
41
37
|
```
|
|
42
38
|
|
|
43
|
-
🐻 **
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
39
|
+
🐻 **As tests run:**
|
|
40
|
+
- Screenshots sent to dashboard in real-time
|
|
41
|
+
- Comparisons appear instantly
|
|
42
|
+
- Live pass/fail statistics update
|
|
43
|
+
- Filter by status (all/changed/identical/new)
|
|
44
|
+
|
|
45
|
+
### 3. Review Changes in the Dashboard
|
|
46
|
+
|
|
47
|
+
Open your browser to `http://localhost:47392`:
|
|
48
|
+
|
|
49
|
+
- **Visual Diff Modes** - Overlay, side-by-side, onion skin, toggle
|
|
50
|
+
- **Accept Baselines** - Click to accept individual or all changes
|
|
51
|
+
- **Test Statistics** - Total tests, pass rate, change detection
|
|
52
|
+
- **Dark Theme** - Easy on the eyes during development
|
|
48
53
|
|
|
49
|
-
###
|
|
54
|
+
### 4. Accept Changes (Update Baseline)
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
Accept changes directly in the dashboard UI, or via CLI:
|
|
52
57
|
|
|
53
58
|
```bash
|
|
54
|
-
npx vizzly tdd "npm test" --set-baseline
|
|
59
|
+
npx vizzly tdd run "npm test" --set-baseline
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
🐻 **Baseline update behavior:**
|
|
@@ -60,24 +65,34 @@ npx vizzly tdd "npm test" --set-baseline
|
|
|
60
65
|
- All tests pass (baseline accepted)
|
|
61
66
|
- Future runs use updated baselines
|
|
62
67
|
|
|
63
|
-
###
|
|
68
|
+
### 5. Stop the Dashboard
|
|
64
69
|
|
|
65
|
-
When
|
|
70
|
+
When done developing:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
npx vizzly
|
|
73
|
+
npx vizzly tdd stop
|
|
69
74
|
```
|
|
70
75
|
|
|
76
|
+
Or press `Ctrl+C` if running in foreground.
|
|
77
|
+
|
|
71
78
|
## How It Works
|
|
72
79
|
|
|
73
|
-
TDD Mode
|
|
80
|
+
TDD Mode provides two workflows:
|
|
81
|
+
|
|
82
|
+
### Interactive Dashboard Workflow
|
|
83
|
+
|
|
84
|
+
1. **Start dashboard** - `vizzly tdd start` launches persistent server
|
|
85
|
+
2. **Run tests in watch** - Tests run continuously as you code
|
|
86
|
+
3. **Live updates** - Screenshots compared and displayed in real-time
|
|
87
|
+
4. **Review in browser** - Visual diff modes help analyze changes
|
|
88
|
+
5. **Accept baselines** - Click to update baselines from UI
|
|
74
89
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
### Single-Shot Workflow
|
|
91
|
+
|
|
92
|
+
1. **Run tests** - `vizzly tdd run "npm test"` executes once
|
|
93
|
+
2. **Compares locally** - Uses `odiff` for pixel-perfect comparison
|
|
94
|
+
3. **Generates report** - Creates HTML report with visual comparisons
|
|
95
|
+
4. **Exit with status** - Fails if differences exceed threshold
|
|
81
96
|
|
|
82
97
|
## Directory Structure
|
|
83
98
|
|
|
@@ -101,44 +116,79 @@ TDD Mode creates a `.vizzly/` directory:
|
|
|
101
116
|
|
|
102
117
|
**Important**: Add `.vizzly/` to your `.gitignore` file as it contains local development artifacts.
|
|
103
118
|
|
|
104
|
-
## Interactive
|
|
119
|
+
## Interactive Dashboard
|
|
120
|
+
|
|
121
|
+
The TDD dashboard provides real-time visual comparison feedback as you develop.
|
|
122
|
+
|
|
123
|
+
### 🐻 **Dashboard Features**
|
|
124
|
+
|
|
125
|
+
**Two-View Navigation**
|
|
126
|
+
- **Comparisons View** - Main view showing all screenshot comparisons with visual diffs
|
|
127
|
+
- **Statistics View** - Overview of test runs, pass/fail metrics, and baseline management
|
|
128
|
+
- Switch between views using the navigation tabs at the top
|
|
129
|
+
|
|
130
|
+
**Live Updates**
|
|
131
|
+
- Screenshots appear as tests run
|
|
132
|
+
- Comparisons processed in real-time
|
|
133
|
+
- No page refresh needed
|
|
134
|
+
- Auto-refreshes every 2 seconds to show latest results
|
|
135
|
+
|
|
136
|
+
**Visual Diff Modes** (in Comparisons view)
|
|
137
|
+
- **Overlay** - Toggle diff overlay on/off
|
|
138
|
+
- **Side-by-Side** - Compare baseline and current horizontally
|
|
139
|
+
- **Onion Skin** - Drag to reveal baseline underneath
|
|
140
|
+
- **Toggle** - Click to switch between baseline and current
|
|
141
|
+
|
|
142
|
+
**Baseline Management**
|
|
143
|
+
- **Accept Individual** - Click accept on any comparison to update that baseline
|
|
144
|
+
- **Accept All Changes** - Bulk accept all failed/new screenshots at once (shown when changes detected)
|
|
145
|
+
- Shows count of failed and new baselines
|
|
146
|
+
- Prominent button appears in Comparisons view when changes exist
|
|
147
|
+
- **Reset Baselines** - Delete all baselines and comparison history (in Statistics view)
|
|
148
|
+
- Useful for starting fresh or fixing corrupted state
|
|
149
|
+
- Requires confirmation before executing
|
|
105
150
|
|
|
106
|
-
|
|
151
|
+
**Filtering & Search** (in Comparisons view)
|
|
152
|
+
- Filter by status: All, Failed, Passed, New
|
|
153
|
+
- Search by screenshot name
|
|
154
|
+
- Filter by browser type
|
|
155
|
+
- Filter by viewport size
|
|
156
|
+
- Sort by name, status, or diff percentage
|
|
107
157
|
|
|
108
|
-
### 🐻 **
|
|
158
|
+
### 🐻 **Dashboard UI**
|
|
109
159
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- Perfect for spotting subtle changes
|
|
160
|
+
```bash
|
|
161
|
+
# Start the dashboard
|
|
162
|
+
npx vizzly tdd start
|
|
114
163
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
164
|
+
# Opens at http://localhost:47392
|
|
165
|
+
# Shows real-time comparisons as tests run
|
|
166
|
+
# Dark theme optimized for development
|
|
167
|
+
# Navigate between Comparisons and Statistics views
|
|
168
|
+
```
|
|
119
169
|
|
|
120
|
-
**
|
|
121
|
-
- Drag across image to reveal baseline underneath
|
|
122
|
-
- Interactive reveal lets you control comparison area
|
|
123
|
-
- Ideal for precise change inspection
|
|
170
|
+
**Dashboard Views:**
|
|
124
171
|
|
|
125
|
-
**
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
172
|
+
1. **Comparisons View** (`/`)
|
|
173
|
+
- Lists all screenshot comparisons with visual diffs
|
|
174
|
+
- Filter, search, and sort capabilities
|
|
175
|
+
- "Accept All" button appears when changes are detected
|
|
176
|
+
- Individual accept/reject actions per comparison
|
|
177
|
+
- Multiple visual diff modes for detailed inspection
|
|
129
178
|
|
|
130
|
-
|
|
179
|
+
2. **Statistics View** (`/stats`)
|
|
180
|
+
- Overview of test runs and baseline status
|
|
181
|
+
- Total pass/fail/new screenshot counts
|
|
182
|
+
- Current baseline information (build name, creation date)
|
|
183
|
+
- "Accept All Changes" button for bulk baseline updates
|
|
184
|
+
- "Reset Baselines" button to clear all baselines and start fresh
|
|
131
185
|
|
|
132
|
-
|
|
133
|
-
- **Mobile Responsive** - Works on any screen size
|
|
134
|
-
- **Clickable File Paths** - Click from terminal to open instantly
|
|
135
|
-
- **Clean Status Display** - Shows "Visual differences detected" instead of technical metrics
|
|
136
|
-
- **Test Summary** - Total, passed, failed counts and pass rate
|
|
186
|
+
### 🐻 **Static HTML Report**
|
|
137
187
|
|
|
138
|
-
|
|
188
|
+
When using `vizzly tdd run`, a static HTML report is generated at `.vizzly/report/index.html`:
|
|
139
189
|
|
|
140
190
|
```bash
|
|
141
|
-
# Report path
|
|
191
|
+
# Report path shown after each run
|
|
142
192
|
🐻 View detailed report: file:///path/to/.vizzly/report/index.html
|
|
143
193
|
|
|
144
194
|
# Click the link in your terminal, or open manually
|
|
@@ -147,82 +197,98 @@ open .vizzly/report/index.html # macOS
|
|
|
147
197
|
|
|
148
198
|
## Command Options
|
|
149
199
|
|
|
150
|
-
###
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
vizzly tdd "npm test"
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Accept Changes (Update Baseline)
|
|
200
|
+
### TDD Subcommands
|
|
157
201
|
|
|
202
|
+
**Start Dashboard Server**
|
|
158
203
|
```bash
|
|
159
|
-
vizzly tdd
|
|
204
|
+
vizzly tdd start [options]
|
|
160
205
|
```
|
|
161
206
|
|
|
162
|
-
|
|
207
|
+
Starts the dashboard server in the background as a detached process and returns your terminal immediately.
|
|
163
208
|
|
|
164
|
-
|
|
209
|
+
Options:
|
|
210
|
+
- `--port <port>` - Server port (default: 47392)
|
|
211
|
+
- `--threshold <number>` - Comparison threshold (default: 0.1)
|
|
212
|
+
- `--baseline-build <id>` - Use specific build as baseline
|
|
213
|
+
- `--open` - Auto-open dashboard in browser
|
|
165
214
|
|
|
166
|
-
|
|
215
|
+
**Run Tests (Single-Shot)**
|
|
167
216
|
```bash
|
|
168
|
-
|
|
217
|
+
vizzly tdd run "npm test" [options]
|
|
169
218
|
```
|
|
170
219
|
|
|
171
|
-
|
|
220
|
+
Options:
|
|
221
|
+
- `--set-baseline` - Accept screenshots as new baseline
|
|
222
|
+
- `--port <port>` - Server port (default: 47392)
|
|
223
|
+
- `--threshold <number>` - Comparison threshold (default: 0.1)
|
|
224
|
+
- `--baseline-build <id>` - Use specific build as baseline
|
|
225
|
+
- `--timeout <ms>` - Server timeout (default: 30000)
|
|
226
|
+
|
|
227
|
+
**Stop Dashboard Server**
|
|
172
228
|
```bash
|
|
173
|
-
|
|
229
|
+
vizzly tdd stop
|
|
174
230
|
```
|
|
175
231
|
|
|
176
|
-
###
|
|
232
|
+
### Legacy Command
|
|
177
233
|
|
|
178
|
-
|
|
234
|
+
The legacy command format is still supported:
|
|
179
235
|
|
|
180
236
|
```bash
|
|
181
|
-
vizzly tdd "npm test"
|
|
182
|
-
vizzly tdd "npm test" --timeout 60000
|
|
237
|
+
vizzly tdd "npm test" # Equivalent to: vizzly tdd run "npm test"
|
|
183
238
|
```
|
|
184
239
|
|
|
185
240
|
## Development Workflow
|
|
186
241
|
|
|
187
|
-
###
|
|
242
|
+
### Interactive Development (Recommended)
|
|
188
243
|
|
|
189
244
|
```bash
|
|
190
|
-
#
|
|
191
|
-
npx vizzly
|
|
245
|
+
# Start dashboard (runs in background)
|
|
246
|
+
npx vizzly tdd start
|
|
192
247
|
|
|
193
|
-
#
|
|
194
|
-
|
|
248
|
+
# Run tests in watch mode (same terminal or new one)
|
|
249
|
+
npm test -- --watch
|
|
195
250
|
|
|
196
|
-
#
|
|
197
|
-
#
|
|
198
|
-
npx vizzly tdd "npm test"
|
|
251
|
+
# Browser: Open http://localhost:47392
|
|
252
|
+
# See live comparisons as you code
|
|
199
253
|
|
|
200
|
-
#
|
|
254
|
+
# Accept changes from dashboard UI when ready
|
|
255
|
+
# Stop when done: npx vizzly tdd stop
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Single-Shot Testing
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Run tests once with comparison
|
|
262
|
+
npx vizzly tdd run "npm test"
|
|
263
|
+
|
|
264
|
+
# Accept changes as new baseline
|
|
265
|
+
npx vizzly tdd run "npm test" --set-baseline
|
|
266
|
+
|
|
267
|
+
# Upload to Vizzly when satisfied
|
|
201
268
|
npx vizzly run "npm test" --wait
|
|
202
269
|
```
|
|
203
270
|
|
|
204
271
|
### Feature Development
|
|
205
272
|
|
|
206
273
|
```bash
|
|
207
|
-
# Start
|
|
208
|
-
npx vizzly tdd
|
|
274
|
+
# Start interactive dashboard (runs in background)
|
|
275
|
+
npx vizzly tdd start
|
|
276
|
+
|
|
277
|
+
# Run tests in watch mode (same terminal or new one)
|
|
278
|
+
npm test -- --watch
|
|
209
279
|
|
|
210
|
-
#
|
|
211
|
-
|
|
212
|
-
# Edit code to fix visual differences
|
|
213
|
-
vim src/components/NewFeature.js
|
|
214
|
-
npx vizzly tdd "npm test"
|
|
215
|
-
done
|
|
280
|
+
# Make changes and see live feedback in browser
|
|
281
|
+
# Accept baselines directly from dashboard UI
|
|
216
282
|
|
|
217
|
-
#
|
|
283
|
+
# When feature complete, upload to Vizzly
|
|
218
284
|
npx vizzly run "npm test" --build-name "Feature: New Dashboard"
|
|
219
285
|
```
|
|
220
286
|
|
|
221
287
|
### Bug Fixing
|
|
222
288
|
|
|
223
289
|
```bash
|
|
224
|
-
#
|
|
225
|
-
npx vizzly tdd "npm test"
|
|
290
|
+
# Quick verification with single-shot mode
|
|
291
|
+
npx vizzly tdd run "npm test"
|
|
226
292
|
|
|
227
293
|
# Tests should pass when bug is fixed
|
|
228
294
|
# Then upload the fix
|
|
@@ -242,9 +308,7 @@ Configure in `vizzly.config.js`:
|
|
|
242
308
|
```javascript
|
|
243
309
|
export default {
|
|
244
310
|
comparison: {
|
|
245
|
-
threshold: 0.01
|
|
246
|
-
ignoreAntialiasing: true,
|
|
247
|
-
ignoreColors: false
|
|
311
|
+
threshold: 0.01 // 1% difference tolerance
|
|
248
312
|
}
|
|
249
313
|
};
|
|
250
314
|
```
|
|
@@ -262,7 +326,7 @@ npx vizzly status # Shows latest build info
|
|
|
262
326
|
Download new baselines from a different build:
|
|
263
327
|
|
|
264
328
|
```bash
|
|
265
|
-
npx vizzly tdd "npm test" --baseline-build build-xyz789
|
|
329
|
+
npx vizzly tdd run "npm test" --baseline-build build-xyz789
|
|
266
330
|
```
|
|
267
331
|
|
|
268
332
|
### Force Baseline Refresh
|
|
@@ -271,7 +335,7 @@ Delete local baselines to force re-download:
|
|
|
271
335
|
|
|
272
336
|
```bash
|
|
273
337
|
rm -rf .vizzly/baselines/
|
|
274
|
-
npx vizzly tdd "npm test"
|
|
338
|
+
npx vizzly tdd run "npm test"
|
|
275
339
|
```
|
|
276
340
|
|
|
277
341
|
## Advanced Usage
|
|
@@ -322,7 +386,7 @@ jobs:
|
|
|
322
386
|
# Use TDD mode for PR builds (faster, no uploads)
|
|
323
387
|
- name: TDD Visual Tests (PR)
|
|
324
388
|
if: github.event_name == 'pull_request'
|
|
325
|
-
run: npx vizzly tdd "npm test"
|
|
389
|
+
run: npx vizzly tdd run "npm test"
|
|
326
390
|
env:
|
|
327
391
|
VIZZLY_TOKEN: ${{ secrets.VIZZLY_TOKEN }}
|
|
328
392
|
|
|
@@ -345,6 +409,8 @@ jobs:
|
|
|
345
409
|
- **Fast iteration** - Make changes and test immediately
|
|
346
410
|
- **Visual debugging** - See exact pixel differences
|
|
347
411
|
- **Offline capable** - Works without internet (after initial baseline download)
|
|
412
|
+
- **Clean console output** - Reduced logging noise, only shows important information
|
|
413
|
+
- **Silent mode** - Vizzly client auto-disables after first warning if not initialized
|
|
348
414
|
|
|
349
415
|
### Cost Efficiency
|
|
350
416
|
- **Reduced API usage** - Only upload final results
|
|
@@ -383,7 +449,7 @@ Error: Failed to compare 'homepage': baseline image not found
|
|
|
383
449
|
**Solution**: Refresh baselines:
|
|
384
450
|
```bash
|
|
385
451
|
rm -rf .vizzly/baselines/
|
|
386
|
-
npx vizzly tdd "npm test"
|
|
452
|
+
npx vizzly tdd run "npm test"
|
|
387
453
|
```
|
|
388
454
|
|
|
389
455
|
### Odiff Not Found
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizzly-testing/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Visual review platform for UI developers and designers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visual-testing",
|
|
@@ -53,14 +53,18 @@
|
|
|
53
53
|
],
|
|
54
54
|
"scripts": {
|
|
55
55
|
"start": "node src/index.js",
|
|
56
|
-
"build": "npm run clean && npm run compile && npm run copy-assets && npm run types",
|
|
56
|
+
"build": "npm run clean && npm run compile && npm run copy-assets && npm run build:reporter && npm run types",
|
|
57
57
|
"clean": "rimraf dist",
|
|
58
58
|
"compile": "babel src --out-dir dist --ignore '**/*.test.js'",
|
|
59
59
|
"copy-assets": "cp src/services/report-generator/report.css dist/services/report-generator/",
|
|
60
|
+
"build:reporter": "cd src/reporter && vite build",
|
|
61
|
+
"dev:reporter": "cd src/reporter && vite --config vite.dev.config.js",
|
|
60
62
|
"types": "tsc --emitDeclarationOnly --outDir dist/types",
|
|
61
63
|
"prepublishOnly": "npm test && npm run build",
|
|
62
64
|
"test": "vitest run",
|
|
63
65
|
"test:watch": "vitest",
|
|
66
|
+
"test:reporter": "playwright test --config=tests/reporter/playwright.config.js",
|
|
67
|
+
"test:reporter:visual": "node bin/vizzly.js run \"npm run test:reporter\"",
|
|
64
68
|
"lint": "eslint src tests",
|
|
65
69
|
"lint:fix": "eslint src tests --fix",
|
|
66
70
|
"format": "prettier --write src tests",
|
|
@@ -88,15 +92,27 @@
|
|
|
88
92
|
"@babel/preset-react": "^7.27.1",
|
|
89
93
|
"@babel/preset-typescript": "^7.23.6",
|
|
90
94
|
"@eslint/js": "^9.31.0",
|
|
95
|
+
"@heroicons/react": "^2.2.0",
|
|
96
|
+
"@playwright/test": "^1.55.1",
|
|
97
|
+
"@tailwindcss/postcss": "^4.1.13",
|
|
98
|
+
"@vitejs/plugin-react": "^5.0.3",
|
|
91
99
|
"@vitest/coverage-v8": "^3.2.4",
|
|
100
|
+
"autoprefixer": "^10.4.21",
|
|
92
101
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
93
102
|
"eslint": "^9.31.0",
|
|
94
103
|
"eslint-config-prettier": "^10.1.8",
|
|
95
104
|
"eslint-plugin-prettier": "^5.5.3",
|
|
105
|
+
"eslint-plugin-react": "^7.37.5",
|
|
106
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
107
|
+
"postcss": "^8.5.6",
|
|
96
108
|
"prettier": "^3.6.2",
|
|
109
|
+
"react": "^19.1.1",
|
|
110
|
+
"react-dom": "^19.1.1",
|
|
97
111
|
"rimraf": "^6.0.1",
|
|
112
|
+
"tailwindcss": "^4.1.13",
|
|
98
113
|
"typescript": "^5.0.4",
|
|
99
|
-
"vite": "^7.1.
|
|
100
|
-
"vitest": "^3.2.4"
|
|
114
|
+
"vite": "^7.1.7",
|
|
115
|
+
"vitest": "^3.2.4",
|
|
116
|
+
"wouter": "^3.7.1"
|
|
101
117
|
}
|
|
102
118
|
}
|