@vizzly-testing/cli 0.29.3 → 0.29.5
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { renderToString } from "react-dom/server";
|
|
3
|
+
function isNewComparisonStatus(status) {
|
|
4
|
+
return status === "new" || status === "baseline-created";
|
|
5
|
+
}
|
|
3
6
|
const statusConfig = {
|
|
4
7
|
failed: {
|
|
5
8
|
label: "Changed",
|
|
@@ -430,11 +433,11 @@ function StaticReportView({ reportData }) {
|
|
|
430
433
|
total: comparisons.length,
|
|
431
434
|
passed: comparisons.filter((c) => c.status === "passed").length,
|
|
432
435
|
failed: comparisons.filter((c) => c.status === "failed").length,
|
|
433
|
-
new: comparisons.filter((c) => c.status
|
|
436
|
+
new: comparisons.filter((c) => isNewComparisonStatus(c.status)).length,
|
|
434
437
|
error: comparisons.filter((c) => c.status === "error").length
|
|
435
438
|
};
|
|
436
439
|
let failed = comparisons.filter((c) => c.status === "failed");
|
|
437
|
-
let newItems = comparisons.filter((c) => c.status
|
|
440
|
+
let newItems = comparisons.filter((c) => isNewComparisonStatus(c.status));
|
|
438
441
|
let passed = comparisons.filter((c) => c.status === "passed");
|
|
439
442
|
let errors = comparisons.filter((c) => c.status === "error");
|
|
440
443
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-slate-900 text-white", children: [
|
|
@@ -13,6 +13,7 @@ import { createBuild as createApiBuild, createApiClient, finalizeBuild as finali
|
|
|
13
13
|
import { VizzlyError } from '../errors/vizzly-error.js';
|
|
14
14
|
import { cancelTests, createBuild, finalizeBuild, initializeDaemon, runTests } from '../test-runner/index.js';
|
|
15
15
|
import * as output from '../utils/output.js';
|
|
16
|
+
import { writeSession as defaultWriteSession } from '../utils/session.js';
|
|
16
17
|
import { createBuildObject } from './build-manager.js';
|
|
17
18
|
export class TestRunner extends EventEmitter {
|
|
18
19
|
constructor(config, serverManager, options = {}) {
|
|
@@ -34,6 +35,7 @@ export class TestRunner extends EventEmitter {
|
|
|
34
35
|
getBuild,
|
|
35
36
|
finalizeApiBuild,
|
|
36
37
|
output,
|
|
38
|
+
writeSession: defaultWriteSession,
|
|
37
39
|
createError: (message, code) => new VizzlyError(message, code)
|
|
38
40
|
};
|
|
39
41
|
}
|
|
@@ -79,7 +81,7 @@ export class TestRunner extends EventEmitter {
|
|
|
79
81
|
return result;
|
|
80
82
|
}
|
|
81
83
|
async createBuild(options, tdd) {
|
|
82
|
-
|
|
84
|
+
let buildId = await createBuild({
|
|
83
85
|
runOptions: options,
|
|
84
86
|
tdd,
|
|
85
87
|
config: this.config,
|
|
@@ -90,6 +92,16 @@ export class TestRunner extends EventEmitter {
|
|
|
90
92
|
output: this.deps.output
|
|
91
93
|
}
|
|
92
94
|
});
|
|
95
|
+
if (!tdd && buildId) {
|
|
96
|
+
let writeSession = this.deps.writeSession || defaultWriteSession;
|
|
97
|
+
writeSession({
|
|
98
|
+
buildId,
|
|
99
|
+
branch: options?.branch,
|
|
100
|
+
commit: options?.commit,
|
|
101
|
+
parallelId: options?.parallelId
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return buildId;
|
|
93
105
|
}
|
|
94
106
|
async finalizeBuild(buildId, isTddMode, success, executionTime) {
|
|
95
107
|
await finalizeBuild({
|
package/dist/tdd/tdd-service.js
CHANGED
|
@@ -1038,9 +1038,9 @@ export class TddService {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
// Baseline exists - compare
|
|
1041
|
+
let effectiveThreshold = typeof validatedProperties.threshold === 'number' && validatedProperties.threshold >= 0 ? validatedProperties.threshold : this.threshold;
|
|
1042
|
+
let effectiveMinClusterSize = Number.isInteger(validatedProperties.minClusterSize) && validatedProperties.minClusterSize >= 1 ? validatedProperties.minClusterSize : this.minClusterSize;
|
|
1041
1043
|
try {
|
|
1042
|
-
let effectiveThreshold = typeof validatedProperties.threshold === 'number' && validatedProperties.threshold >= 0 ? validatedProperties.threshold : this.threshold;
|
|
1043
|
-
let effectiveMinClusterSize = Number.isInteger(validatedProperties.minClusterSize) && validatedProperties.minClusterSize >= 1 ? validatedProperties.minClusterSize : this.minClusterSize;
|
|
1044
1044
|
let honeydiffResult = await compareImages(baselineImagePath, currentImagePath, diffImagePath, {
|
|
1045
1045
|
threshold: effectiveThreshold,
|
|
1046
1046
|
minClusterSize: effectiveMinClusterSize
|
|
@@ -1088,29 +1088,25 @@ export class TddService {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
} catch (error) {
|
|
1090
1090
|
if (isDimensionMismatchError(error)) {
|
|
1091
|
-
output.debug('comparison', `${sanitizedName}: dimension mismatch,
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
threshold: this.threshold,
|
|
1096
|
-
signatureProperties: this.signatureProperties
|
|
1097
|
-
});
|
|
1098
|
-
}
|
|
1099
|
-
let screenshotEntry = {
|
|
1100
|
-
name: sanitizedName,
|
|
1101
|
-
properties: validatedProperties,
|
|
1102
|
-
path: baselineImagePath,
|
|
1103
|
-
signature
|
|
1104
|
-
};
|
|
1105
|
-
upsertScreenshotInMetadata(this.baselineData, screenshotEntry, signature);
|
|
1106
|
-
saveBaselineMetadata(this.baselinePath, this.baselineData);
|
|
1107
|
-
let result = buildNewComparison({
|
|
1091
|
+
output.debug('comparison', `${sanitizedName}: dimension mismatch, marking comparison as failed`, {
|
|
1092
|
+
error: error.message
|
|
1093
|
+
});
|
|
1094
|
+
let result = buildFailedComparison({
|
|
1108
1095
|
name: sanitizedName,
|
|
1109
1096
|
signature,
|
|
1110
1097
|
baselinePath: baselineImagePath,
|
|
1111
1098
|
currentPath: currentImagePath,
|
|
1112
|
-
|
|
1099
|
+
diffPath: null,
|
|
1100
|
+
properties: validatedProperties,
|
|
1101
|
+
threshold: effectiveThreshold,
|
|
1102
|
+
minClusterSize: effectiveMinClusterSize,
|
|
1103
|
+
honeydiffResult: {
|
|
1104
|
+
isDifferent: true,
|
|
1105
|
+
diffClusters: []
|
|
1106
|
+
}
|
|
1113
1107
|
});
|
|
1108
|
+
result.reason = 'dimension-mismatch';
|
|
1109
|
+
result.error = error.message;
|
|
1114
1110
|
this._upsertComparison(result);
|
|
1115
1111
|
return result;
|
|
1116
1112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizzly-testing/cli",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.5",
|
|
4
4
|
"description": "Visual review platform for UI developers and designers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visual-testing",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"@vitejs/plugin-react": "^5.0.3",
|
|
123
123
|
"@vizzly-testing/observatory": "^0.3.3",
|
|
124
124
|
"autoprefixer": "^10.4.21",
|
|
125
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
125
126
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
126
127
|
"postcss": "^8.5.6",
|
|
127
128
|
"react": "^19.1.1",
|