@testivai/witness 1.0.1 → 1.0.3

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.
Files changed (92) hide show
  1. package/README.md +44 -13
  2. package/dist/baselines/index.d.ts +6 -0
  3. package/dist/baselines/index.d.ts.map +1 -0
  4. package/dist/baselines/index.js +9 -0
  5. package/dist/baselines/index.js.map +1 -0
  6. package/dist/baselines/store.d.ts +100 -0
  7. package/dist/baselines/store.d.ts.map +1 -0
  8. package/dist/baselines/store.js +298 -0
  9. package/dist/baselines/store.js.map +1 -0
  10. package/dist/bin/testivai.js +2 -0
  11. package/dist/bin/testivai.js.map +1 -1
  12. package/dist/browser/binding.d.ts.map +1 -1
  13. package/dist/browser/binding.js +173 -42
  14. package/dist/browser/binding.js.map +1 -1
  15. package/dist/browser/capture.d.ts.map +1 -1
  16. package/dist/browser/capture.js +7 -4
  17. package/dist/browser/capture.js.map +1 -1
  18. package/dist/commands/approve.d.ts +3 -0
  19. package/dist/commands/approve.d.ts.map +1 -0
  20. package/dist/commands/approve.js +94 -0
  21. package/dist/commands/approve.js.map +1 -0
  22. package/dist/commands/init.d.ts.map +1 -1
  23. package/dist/commands/init.js +53 -0
  24. package/dist/commands/init.js.map +1 -1
  25. package/dist/commands/run.d.ts.map +1 -1
  26. package/dist/commands/run.js +98 -0
  27. package/dist/commands/run.js.map +1 -1
  28. package/dist/config/index.d.ts +6 -0
  29. package/dist/config/index.d.ts.map +1 -0
  30. package/dist/config/index.js +14 -0
  31. package/dist/config/index.js.map +1 -0
  32. package/dist/config/local-config.d.ts +54 -0
  33. package/dist/config/local-config.d.ts.map +1 -0
  34. package/dist/config/local-config.js +130 -0
  35. package/dist/config/local-config.js.map +1 -0
  36. package/dist/diff/diff.d.ts +27 -0
  37. package/dist/diff/diff.d.ts.map +1 -0
  38. package/dist/diff/diff.js +216 -0
  39. package/dist/diff/diff.js.map +1 -0
  40. package/dist/diff/dom-diff.d.ts +85 -0
  41. package/dist/diff/dom-diff.d.ts.map +1 -0
  42. package/dist/diff/dom-diff.js +291 -0
  43. package/dist/diff/dom-diff.js.map +1 -0
  44. package/dist/diff/ignore.d.ts +22 -0
  45. package/dist/diff/ignore.d.ts.map +1 -0
  46. package/dist/diff/ignore.js +43 -0
  47. package/dist/diff/ignore.js.map +1 -0
  48. package/dist/diff/index.d.ts +18 -0
  49. package/dist/diff/index.d.ts.map +1 -0
  50. package/dist/diff/index.js +25 -0
  51. package/dist/diff/index.js.map +1 -0
  52. package/dist/diff/minimap.d.ts +23 -0
  53. package/dist/diff/minimap.d.ts.map +1 -0
  54. package/dist/diff/minimap.js +43 -0
  55. package/dist/diff/minimap.js.map +1 -0
  56. package/dist/diff/regions.d.ts +23 -0
  57. package/dist/diff/regions.d.ts.map +1 -0
  58. package/dist/diff/regions.js +129 -0
  59. package/dist/diff/regions.js.map +1 -0
  60. package/dist/diff/resize.d.ts +27 -0
  61. package/dist/diff/resize.d.ts.map +1 -0
  62. package/dist/diff/resize.js +82 -0
  63. package/dist/diff/resize.js.map +1 -0
  64. package/dist/diff/types.d.ts +79 -0
  65. package/dist/diff/types.d.ts.map +1 -0
  66. package/dist/diff/types.js +10 -0
  67. package/dist/diff/types.js.map +1 -0
  68. package/dist/index.d.ts +8 -0
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +23 -2
  71. package/dist/index.js.map +1 -1
  72. package/dist/report/compare.d.ts +18 -0
  73. package/dist/report/compare.d.ts.map +1 -0
  74. package/dist/report/compare.js +193 -0
  75. package/dist/report/compare.js.map +1 -0
  76. package/dist/report/generator.d.ts +31 -0
  77. package/dist/report/generator.d.ts.map +1 -0
  78. package/dist/report/generator.js +123 -0
  79. package/dist/report/generator.js.map +1 -0
  80. package/dist/report/index.d.ts +10 -0
  81. package/dist/report/index.d.ts.map +1 -0
  82. package/dist/report/index.js +13 -0
  83. package/dist/report/index.js.map +1 -0
  84. package/dist/report/results.d.ts +56 -0
  85. package/dist/report/results.d.ts.map +1 -0
  86. package/dist/report/results.js +8 -0
  87. package/dist/report/results.js.map +1 -0
  88. package/dist/report/template.d.ts +14 -0
  89. package/dist/report/template.d.ts.map +1 -0
  90. package/dist/report/template.js +275 -0
  91. package/dist/report/template.js.map +1 -0
  92. package/package.json +58 -15
package/README.md CHANGED
@@ -9,36 +9,54 @@ The TestivAI Witness SDK allows you to integrate visual regression testing into
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- npm install -g @testivai/witness
12
+ npm install -D @testivai/witness
13
13
  ```
14
14
 
15
- ## Quick Start
15
+ ## Quick Start (Local Mode — Free)
16
+
17
+ TestivAI works in **local mode** without any API key or cloud account:
16
18
 
17
19
  1. **Initialize your project**
18
20
  ```bash
19
21
  npx testivai init
22
+ # Select "Local Mode" when prompted
20
23
  ```
21
24
 
22
- 2. **Authenticate with your API key**
23
- ```bash
24
- npx testivai auth <your-api-key>
25
- ```
26
-
27
- 3. **Add visual captures to your tests**
25
+ 2. **Add visual captures to your tests**
28
26
  ```javascript
29
27
  // In your test code
30
28
  await window.testivaiWitness('my-snapshot');
31
29
  ```
32
30
 
33
- 4. **Run your tests**
31
+ 3. **Run your tests**
34
32
  ```bash
35
33
  # Make sure Chrome is running with remote debugging
36
34
  chrome --remote-debugging-port=9222
37
35
 
38
36
  # Run your tests with TestivAI
39
- testivai run "npm test"
37
+ npx testivai run "npm test"
38
+ ```
39
+
40
+ 4. **View the report**
41
+ Open `visual-report/index.html` in your browser to see results.
42
+
43
+ 5. **Approve changes**
44
+ ```bash
45
+ npx testivai approve --all
40
46
  ```
41
47
 
48
+ ## Quick Start (Cloud Mode)
49
+
50
+ For team collaboration and hosted dashboards:
51
+
52
+ 1. **Get an API key** at [testiv.ai](https://testiv.ai)
53
+ 2. **Set your API key**
54
+ ```bash
55
+ export TESTIVAI_API_KEY=your-api-key
56
+ ```
57
+ 3. Follow steps 1–3 from local mode above
58
+ 4. Results will upload to the cloud dashboard automatically
59
+
42
60
  ## Framework Integration
43
61
 
44
62
  ### Cypress
@@ -214,6 +232,19 @@ Options:
214
232
  - `-o, --output <path>` - Output directory (default: .testivai/captures)
215
233
  - `-f, --format <format>` - Output format: json|png (default: json)
216
234
 
235
+ ### `npx testivai approve [name]`
236
+ Approve snapshots in local mode. Use after reviewing visual changes.
237
+
238
+ ```bash
239
+ npx testivai approve "my-snapshot" # Approve specific snapshot
240
+ npx testivai approve --all # Approve all changed snapshots
241
+ npx testivai approve --undo "name" # Undo an approval
242
+ ```
243
+
244
+ Options:
245
+ - `--all` - Approve all changed snapshots
246
+ - `--undo` - Undo approval for the specified snapshot
247
+
217
248
  ## Chrome Setup
218
249
 
219
250
  ### Manual Launch
@@ -400,6 +431,6 @@ MIT
400
431
 
401
432
  ## Support
402
433
 
403
- - Documentation: https://docs.testiv.ai
404
- - Issues: https://github.com/testivai/testivai-monorepo/issues
405
- - Email: support@testiv.ai
434
+ - Documentation: https://github.com/mcbuddy/testivai-oss/tree/main/packages/witness
435
+ - Issues: https://github.com/mcbuddy/testivai-oss/issues
436
+ - Website: https://testiv.ai
@@ -0,0 +1,6 @@
1
+ /**
2
+ * TestivAI Local Baseline Store
3
+ */
4
+ export { BaselineStore } from './store';
5
+ export type { BaselineMetadata } from './store';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/baselines/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * TestivAI Local Baseline Store
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BaselineStore = void 0;
7
+ var store_1 = require("./store");
8
+ Object.defineProperty(exports, "BaselineStore", { enumerable: true, get: function () { return store_1.BaselineStore; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/baselines/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAAwC;AAA/B,sGAAA,aAAa,OAAA"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * TestivAI Local Baseline Store
3
+ *
4
+ * Manages baseline screenshots on disk for local visual regression testing.
5
+ *
6
+ * Directory structure:
7
+ * .testivai/
8
+ * ├── baselines/{name}/screenshot.png, metadata.json, dom.html?, .previous/
9
+ * └── temp/{name}/screenshot.png, dom.html? (gitignored)
10
+ *
11
+ * `dom.html` is optional — written when the adapter captures DOM alongside
12
+ * the screenshot. Used by the DOM-diff noise hint in the local report.
13
+ */
14
+ export interface BaselineMetadata {
15
+ name: string;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ width?: number;
19
+ height?: number;
20
+ approvedBy?: string;
21
+ }
22
+ export declare class BaselineStore {
23
+ private readonly projectRoot;
24
+ private readonly baselinesDir;
25
+ private readonly tempDir;
26
+ constructor(projectRoot: string);
27
+ /**
28
+ * Check if a baseline exists for the given snapshot name.
29
+ */
30
+ exists(name: string): boolean;
31
+ /**
32
+ * Read a baseline screenshot as a Buffer.
33
+ * Returns null if the baseline does not exist.
34
+ */
35
+ read(name: string): Buffer | null;
36
+ /**
37
+ * Read baseline metadata.
38
+ * Returns null if the baseline does not exist.
39
+ */
40
+ readMetadata(name: string): BaselineMetadata | null;
41
+ /**
42
+ * Write a screenshot and metadata to the baseline directory.
43
+ * Creates the directory if it doesn't exist.
44
+ *
45
+ * @param dom - Optional DOM HTML captured at the same time as the
46
+ * screenshot. Stored as `dom.html` for the noise-hint compare.
47
+ */
48
+ write(name: string, screenshot: Buffer, metadata?: Partial<BaselineMetadata>, dom?: string): void;
49
+ /**
50
+ * Read the baseline DOM HTML if one was captured.
51
+ * Returns null when no DOM file exists for this snapshot.
52
+ */
53
+ readDom(name: string): string | null;
54
+ /**
55
+ * Approve a temp screenshot as the new baseline.
56
+ * Backs up the previous baseline to `.previous/` if one exists.
57
+ */
58
+ approve(name: string): void;
59
+ /**
60
+ * Undo the last approve by restoring the `.previous/` backup.
61
+ */
62
+ undo(name: string): void;
63
+ /**
64
+ * List all baseline names.
65
+ */
66
+ list(): string[];
67
+ /**
68
+ * Write a temp screenshot (captured during a test run).
69
+ *
70
+ * @param dom - Optional DOM HTML captured at the same time as the
71
+ * screenshot. Stored as `dom.html` next to the screenshot.
72
+ */
73
+ writeTemp(name: string, screenshot: Buffer, dom?: string): void;
74
+ /**
75
+ * Read a temp screenshot.
76
+ */
77
+ readTemp(name: string): Buffer | null;
78
+ /**
79
+ * Read the temp DOM HTML if one was captured.
80
+ * Returns null when no temp DOM file exists for this snapshot.
81
+ */
82
+ readTempDom(name: string): string | null;
83
+ /**
84
+ * List all temp snapshot names.
85
+ */
86
+ listTemp(): string[];
87
+ /**
88
+ * Clear all temp files.
89
+ */
90
+ clearTemp(): void;
91
+ getBaselineDir(name: string): string;
92
+ getBaselineScreenshotPath(name: string): string;
93
+ getBaselineMetadataPath(name: string): string;
94
+ getBaselineDomPath(name: string): string;
95
+ getTempScreenshotPath(name: string): string;
96
+ getTempDomPath(name: string): string;
97
+ getBaselinesDir(): string;
98
+ getTempDir(): string;
99
+ }
100
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/baselines/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,aAAa;IAIZ,OAAO,CAAC,QAAQ,CAAC,WAAW;IAHxC,OAAO,CAAC,QAAQ,CAAC,YAAY,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AI,EAAE,MAAM,GAAG,MAAM;IAIxC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI3C,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIpC,eAAe,IAAI,MAAM;IAIzB,UAAU,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,298 @@
1
+ "use strict";
2
+ /**
3
+ * TestivAI Local Baseline Store
4
+ *
5
+ * Manages baseline screenshots on disk for local visual regression testing.
6
+ *
7
+ * Directory structure:
8
+ * .testivai/
9
+ * ├── baselines/{name}/screenshot.png, metadata.json, dom.html?, .previous/
10
+ * └── temp/{name}/screenshot.png, dom.html? (gitignored)
11
+ *
12
+ * `dom.html` is optional — written when the adapter captures DOM alongside
13
+ * the screenshot. Used by the DOM-diff noise hint in the local report.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.BaselineStore = void 0;
50
+ const fs = __importStar(require("fs"));
51
+ const path = __importStar(require("path"));
52
+ class BaselineStore {
53
+ constructor(projectRoot) {
54
+ this.projectRoot = projectRoot;
55
+ this.baselinesDir = path.join(projectRoot, '.testivai', 'baselines');
56
+ this.tempDir = path.join(projectRoot, '.testivai', 'temp');
57
+ }
58
+ /**
59
+ * Check if a baseline exists for the given snapshot name.
60
+ */
61
+ exists(name) {
62
+ const screenshotPath = this.getBaselineScreenshotPath(name);
63
+ return fs.existsSync(screenshotPath);
64
+ }
65
+ /**
66
+ * Read a baseline screenshot as a Buffer.
67
+ * Returns null if the baseline does not exist.
68
+ */
69
+ read(name) {
70
+ const screenshotPath = this.getBaselineScreenshotPath(name);
71
+ if (!fs.existsSync(screenshotPath)) {
72
+ return null;
73
+ }
74
+ return fs.readFileSync(screenshotPath);
75
+ }
76
+ /**
77
+ * Read baseline metadata.
78
+ * Returns null if the baseline does not exist.
79
+ */
80
+ readMetadata(name) {
81
+ const metadataPath = this.getBaselineMetadataPath(name);
82
+ if (!fs.existsSync(metadataPath)) {
83
+ return null;
84
+ }
85
+ const raw = fs.readFileSync(metadataPath, 'utf-8');
86
+ return JSON.parse(raw);
87
+ }
88
+ /**
89
+ * Write a screenshot and metadata to the baseline directory.
90
+ * Creates the directory if it doesn't exist.
91
+ *
92
+ * @param dom - Optional DOM HTML captured at the same time as the
93
+ * screenshot. Stored as `dom.html` for the noise-hint compare.
94
+ */
95
+ write(name, screenshot, metadata, dom) {
96
+ const baselineDir = this.getBaselineDir(name);
97
+ fs.mkdirSync(baselineDir, { recursive: true });
98
+ // Write screenshot
99
+ fs.writeFileSync(this.getBaselineScreenshotPath(name), screenshot);
100
+ // Write DOM if provided
101
+ if (dom !== undefined) {
102
+ fs.writeFileSync(this.getBaselineDomPath(name), dom);
103
+ }
104
+ // Write metadata
105
+ const now = new Date().toISOString();
106
+ const meta = {
107
+ name,
108
+ createdAt: now,
109
+ updatedAt: now,
110
+ ...metadata,
111
+ };
112
+ fs.writeFileSync(this.getBaselineMetadataPath(name), JSON.stringify(meta, null, 2));
113
+ }
114
+ /**
115
+ * Read the baseline DOM HTML if one was captured.
116
+ * Returns null when no DOM file exists for this snapshot.
117
+ */
118
+ readDom(name) {
119
+ const domPath = this.getBaselineDomPath(name);
120
+ if (!fs.existsSync(domPath))
121
+ return null;
122
+ return fs.readFileSync(domPath, 'utf-8');
123
+ }
124
+ /**
125
+ * Approve a temp screenshot as the new baseline.
126
+ * Backs up the previous baseline to `.previous/` if one exists.
127
+ */
128
+ approve(name) {
129
+ const tempScreenshot = this.getTempScreenshotPath(name);
130
+ if (!fs.existsSync(tempScreenshot)) {
131
+ throw new Error(`No temp screenshot found for "${name}". Run your tests first to generate screenshots.`);
132
+ }
133
+ const baselineDir = this.getBaselineDir(name);
134
+ const previousDir = path.join(baselineDir, '.previous');
135
+ const currentScreenshot = this.getBaselineScreenshotPath(name);
136
+ const currentMetadata = this.getBaselineMetadataPath(name);
137
+ const currentDom = this.getBaselineDomPath(name);
138
+ const tempDom = this.getTempDomPath(name);
139
+ // Backup current baseline if it exists
140
+ if (fs.existsSync(currentScreenshot)) {
141
+ fs.mkdirSync(previousDir, { recursive: true });
142
+ fs.copyFileSync(currentScreenshot, path.join(previousDir, 'screenshot.png'));
143
+ if (fs.existsSync(currentMetadata)) {
144
+ fs.copyFileSync(currentMetadata, path.join(previousDir, 'metadata.json'));
145
+ }
146
+ if (fs.existsSync(currentDom)) {
147
+ fs.copyFileSync(currentDom, path.join(previousDir, 'dom.html'));
148
+ }
149
+ }
150
+ // Copy temp to baseline
151
+ fs.mkdirSync(baselineDir, { recursive: true });
152
+ fs.copyFileSync(tempScreenshot, currentScreenshot);
153
+ if (fs.existsSync(tempDom)) {
154
+ fs.copyFileSync(tempDom, currentDom);
155
+ }
156
+ else if (fs.existsSync(currentDom)) {
157
+ // Temp had no DOM but baseline did — drop the stale DOM rather
158
+ // than keep an inconsistent pair.
159
+ fs.rmSync(currentDom);
160
+ }
161
+ // Update metadata
162
+ const now = new Date().toISOString();
163
+ const existingMeta = this.readMetadata(name);
164
+ const meta = {
165
+ name,
166
+ createdAt: existingMeta?.createdAt ?? now,
167
+ updatedAt: now,
168
+ approvedBy: 'local',
169
+ };
170
+ fs.writeFileSync(currentMetadata, JSON.stringify(meta, null, 2));
171
+ }
172
+ /**
173
+ * Undo the last approve by restoring the `.previous/` backup.
174
+ */
175
+ undo(name) {
176
+ const baselineDir = this.getBaselineDir(name);
177
+ const previousDir = path.join(baselineDir, '.previous');
178
+ if (!fs.existsSync(previousDir)) {
179
+ throw new Error(`No previous baseline found for "${name}". Cannot undo.`);
180
+ }
181
+ const previousScreenshot = path.join(previousDir, 'screenshot.png');
182
+ const previousMetadata = path.join(previousDir, 'metadata.json');
183
+ const previousDom = path.join(previousDir, 'dom.html');
184
+ const currentScreenshot = this.getBaselineScreenshotPath(name);
185
+ const currentMetadata = this.getBaselineMetadataPath(name);
186
+ const currentDom = this.getBaselineDomPath(name);
187
+ // Restore previous screenshot
188
+ if (fs.existsSync(previousScreenshot)) {
189
+ fs.copyFileSync(previousScreenshot, currentScreenshot);
190
+ }
191
+ // Restore previous metadata
192
+ if (fs.existsSync(previousMetadata)) {
193
+ fs.copyFileSync(previousMetadata, currentMetadata);
194
+ }
195
+ // Restore previous DOM (or remove the current one if no previous existed)
196
+ if (fs.existsSync(previousDom)) {
197
+ fs.copyFileSync(previousDom, currentDom);
198
+ }
199
+ else if (fs.existsSync(currentDom)) {
200
+ fs.rmSync(currentDom);
201
+ }
202
+ // Remove .previous directory
203
+ fs.rmSync(previousDir, { recursive: true, force: true });
204
+ }
205
+ /**
206
+ * List all baseline names.
207
+ */
208
+ list() {
209
+ if (!fs.existsSync(this.baselinesDir)) {
210
+ return [];
211
+ }
212
+ return fs.readdirSync(this.baselinesDir).filter((entry) => {
213
+ const entryPath = path.join(this.baselinesDir, entry);
214
+ return fs.statSync(entryPath).isDirectory();
215
+ });
216
+ }
217
+ /**
218
+ * Write a temp screenshot (captured during a test run).
219
+ *
220
+ * @param dom - Optional DOM HTML captured at the same time as the
221
+ * screenshot. Stored as `dom.html` next to the screenshot.
222
+ */
223
+ writeTemp(name, screenshot, dom) {
224
+ const tempDir = path.join(this.tempDir, name);
225
+ fs.mkdirSync(tempDir, { recursive: true });
226
+ fs.writeFileSync(this.getTempScreenshotPath(name), screenshot);
227
+ if (dom !== undefined) {
228
+ fs.writeFileSync(this.getTempDomPath(name), dom);
229
+ }
230
+ }
231
+ /**
232
+ * Read a temp screenshot.
233
+ */
234
+ readTemp(name) {
235
+ const tempPath = this.getTempScreenshotPath(name);
236
+ if (!fs.existsSync(tempPath)) {
237
+ return null;
238
+ }
239
+ return fs.readFileSync(tempPath);
240
+ }
241
+ /**
242
+ * Read the temp DOM HTML if one was captured.
243
+ * Returns null when no temp DOM file exists for this snapshot.
244
+ */
245
+ readTempDom(name) {
246
+ const domPath = this.getTempDomPath(name);
247
+ if (!fs.existsSync(domPath))
248
+ return null;
249
+ return fs.readFileSync(domPath, 'utf-8');
250
+ }
251
+ /**
252
+ * List all temp snapshot names.
253
+ */
254
+ listTemp() {
255
+ if (!fs.existsSync(this.tempDir)) {
256
+ return [];
257
+ }
258
+ return fs.readdirSync(this.tempDir).filter((entry) => {
259
+ const entryPath = path.join(this.tempDir, entry);
260
+ return fs.statSync(entryPath).isDirectory();
261
+ });
262
+ }
263
+ /**
264
+ * Clear all temp files.
265
+ */
266
+ clearTemp() {
267
+ if (fs.existsSync(this.tempDir)) {
268
+ fs.rmSync(this.tempDir, { recursive: true, force: true });
269
+ }
270
+ }
271
+ // ── Path helpers ──────────────────────────────────────────────────────────
272
+ getBaselineDir(name) {
273
+ return path.join(this.baselinesDir, name);
274
+ }
275
+ getBaselineScreenshotPath(name) {
276
+ return path.join(this.baselinesDir, name, 'screenshot.png');
277
+ }
278
+ getBaselineMetadataPath(name) {
279
+ return path.join(this.baselinesDir, name, 'metadata.json');
280
+ }
281
+ getBaselineDomPath(name) {
282
+ return path.join(this.baselinesDir, name, 'dom.html');
283
+ }
284
+ getTempScreenshotPath(name) {
285
+ return path.join(this.tempDir, name, 'screenshot.png');
286
+ }
287
+ getTempDomPath(name) {
288
+ return path.join(this.tempDir, name, 'dom.html');
289
+ }
290
+ getBaselinesDir() {
291
+ return this.baselinesDir;
292
+ }
293
+ getTempDir() {
294
+ return this.tempDir;
295
+ }
296
+ }
297
+ exports.BaselineStore = BaselineStore;
298
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/baselines/store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAW7B,MAAa,aAAa;IAIxB,YAA6B,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAY;QACjB,MAAM,cAAc,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,IAAY;QACf,MAAM,cAAc,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;Y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AY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,yBAAyB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,uBAAuB,CAAC,IAAY;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;IAED,kBAAkB,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACxD,CAAC;IAED,qBAAqB,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACzD,CAAC;IAED,cAAc,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAzRD,sCAyRC"}
@@ -10,6 +10,7 @@ const auth_1 = require("../commands/auth");
10
10
  const init_1 = require("../commands/init");
11
11
  const run_1 = require("../commands/run");
12
12
  const capture_1 = require("../commands/capture");
13
+ const approve_1 = require("../commands/approve");
13
14
  const packageJson = require('../../package.json');
14
15
  const program = new commander_1.Command();
15
16
  // Display banner
@@ -39,6 +40,7 @@ program.addCommand(auth_1.authCommand);
39
40
  program.addCommand(init_1.initCommand);
40
41
  program.addCommand(run_1.runCommand);
41
42
  program.addCommand(capture_1.witnessCommand);
43
+ program.addCommand(approve_1.approveCommand);
42
44
  // Parse arguments
43
45
  program.parse();
44
46
  // Show help if no command provided
@@ -1 +1 @@
1
- {"version":3,"file":"testivai.js","sourceRoot":"","sources":["../../src/bin/testivai.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,2CAA+C;AAC/C,2CAA+C;AAC/C,yCAA6C;AAC7C,iDAAqD;AAErD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAElD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,iBAAiB;AACjB,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,wBAAwB,CAAC;KACvE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;IACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,UAAU,EAAE,CAAC;IACf,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,iBAAiB;AACjB,OAAO;KACJ,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC;KAChD,MAAM,CAAC,aAAa,EAAE,gCAAgC,CAAC;KACvD,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