@vizzly-testing/cli 0.32.0 → 0.34.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/README.md +81 -50
- package/dist/cli.js +10 -10
- package/dist/client/index.js +2 -1
- package/dist/commands/doctor.js +4 -4
- package/dist/commands/init.js +215 -3
- package/dist/commands/preview.js +3 -3
- package/dist/commands/run.js +1 -1
- package/dist/commands/tdd-daemon.js +1 -1
- package/dist/reporter/reporter-bundle.css +1 -1
- package/dist/reporter/reporter-bundle.iife.js +118 -105
- package/dist/reporter-ssr/ssr-entry.js +88 -88
- package/dist/services/static-report-generator.js +2 -2
- package/dist/tdd/tdd-service.js +14 -14
- package/dist/utils/colors.js +28 -45
- package/dist/utils/global-config.js +1 -1
- package/dist/utils/output.js +16 -16
- package/dist/utils/screenshot-options.js +1 -0
- package/docs/assets/vizzly-mascot-inspector.png +0 -0
- package/package.json +11 -8
- package/skills/vizzly/SKILL.md +99 -0
- package/skills/vizzly/agents/openai.yaml +4 -0
- package/skills/vizzly/references/cli-context.md +42 -0
- package/skills/vizzly/references/dynamic-content.md +44 -0
- package/skills/vizzly/references/public-screenshots.md +44 -0
- package/skills/vizzly/references/sdks.md +62 -0
- package/skills/vizzly/references/setup-ci.md +42 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# SDK Capture Patterns
|
|
2
|
+
|
|
3
|
+
Vizzly works best when screenshots are attached to real user journeys and stable names.
|
|
4
|
+
|
|
5
|
+
## JavaScript Client
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
import { vizzlyScreenshot } from '@vizzly-testing/cli/client';
|
|
9
|
+
|
|
10
|
+
let screenshot = await page.screenshot();
|
|
11
|
+
await vizzlyScreenshot('settings-profile-edit-mode', screenshot, {
|
|
12
|
+
properties: {
|
|
13
|
+
browser: 'chromium',
|
|
14
|
+
viewport: 'desktop',
|
|
15
|
+
state: 'edit'
|
|
16
|
+
},
|
|
17
|
+
threshold: 2,
|
|
18
|
+
minClusterSize: 4
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`vizzlyScreenshot(name, image, options)` accepts a PNG buffer or file path.
|
|
23
|
+
|
|
24
|
+
Important options:
|
|
25
|
+
|
|
26
|
+
- `properties`: metadata used for baseline identity and filtering.
|
|
27
|
+
- `threshold`: per-screenshot CIEDE2000 Delta E tolerance.
|
|
28
|
+
- `minClusterSize`: minimum changed-pixel cluster size.
|
|
29
|
+
- `fullPage`: marks full-page captures.
|
|
30
|
+
|
|
31
|
+
## Vitest
|
|
32
|
+
|
|
33
|
+
Use the Vizzly Vitest plugin when present. It keeps the native `toMatchScreenshot` style:
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
await expect(page.getByRole('heading')).toMatchScreenshot('hero-section.png', {
|
|
37
|
+
properties: {
|
|
38
|
+
theme: 'dark',
|
|
39
|
+
viewport: 'desktop'
|
|
40
|
+
},
|
|
41
|
+
threshold: 2,
|
|
42
|
+
fullPage: true
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Storybook And Static Sites
|
|
47
|
+
|
|
48
|
+
If the repo uses Vizzly Storybook or static-site clients, prefer those existing flows over adding custom Playwright screenshots. They already know how to crawl stories/pages, name screenshots, and attach viewport metadata.
|
|
49
|
+
|
|
50
|
+
## Swift
|
|
51
|
+
|
|
52
|
+
Swift/XCTest projects use `VizzlyXCTest` helpers such as `app.vizzlyScreenshot(name:properties:threshold:minClusterSize:)`. For iOS work, verify against the Swift package docs in the repo before changing examples.
|
|
53
|
+
|
|
54
|
+
## Naming
|
|
55
|
+
|
|
56
|
+
Use stable, descriptive screenshot names:
|
|
57
|
+
|
|
58
|
+
- Good: `checkout-payment-form-valid-card`
|
|
59
|
+
- Good: `settings-profile-edit-mode`
|
|
60
|
+
- Avoid: `screenshot1`, `test`, names with slashes
|
|
61
|
+
|
|
62
|
+
Use properties for variants instead of stuffing every variant into the name.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Setup And CI
|
|
2
|
+
|
|
3
|
+
Use Vizzly locally for fast feedback and in CI for shared review.
|
|
4
|
+
|
|
5
|
+
## Local Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
vizzly init
|
|
9
|
+
vizzly tdd start
|
|
10
|
+
vizzly tdd run "<test command>" --no-open
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The local SDK discovers `.vizzly/server.json` and sends screenshots to the TDD server when it is running.
|
|
14
|
+
|
|
15
|
+
## Cloud Setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
export VIZZLY_TOKEN="project-token"
|
|
19
|
+
vizzly run "<test command>" --wait
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use project tokens in CI. Avoid committing tokens.
|
|
23
|
+
|
|
24
|
+
## Parallel CI
|
|
25
|
+
|
|
26
|
+
Use `--parallel-id` when jobs are sharded:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
vizzly run "npm test -- --shard=1/4" --parallel-id shard-1 --wait
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Keep fast PR checks and broad scheduled checks separate:
|
|
33
|
+
|
|
34
|
+
- PR builds: critical flows and changed surfaces.
|
|
35
|
+
- Nightly builds: full-page sweeps, generated image suites, docs/manual captures.
|
|
36
|
+
|
|
37
|
+
## Troubleshooting
|
|
38
|
+
|
|
39
|
+
- Run `vizzly doctor` for local configuration checks.
|
|
40
|
+
- Run `vizzly status <build-id>` for cloud build status.
|
|
41
|
+
- Run `vizzly context build <build-id> --agent --json` for review evidence.
|
|
42
|
+
- If no screenshots appear, verify the SDK/import is present and the TDD server or `vizzly run` wrapper is active.
|