@crvy/rprtr 0.0.5 → 0.0.7
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/CHANGELOG.md +60 -0
- package/README.md +34 -9
- package/dist/{chunk-MWLM3HWS.js → chunk-JGS2VWQP.js} +189 -2
- package/dist/{chunk-IH44LYNM.js → chunk-OMDYTNWY.js} +131 -53
- package/dist/cli.js +2 -2
- package/dist/index.css +3 -0
- package/dist/index.js +555 -485
- package/dist/report-state.d.ts +6 -1
- package/dist/report-state.d.ts.map +1 -1
- package/dist/report-utils.d.ts +3 -0
- package/dist/report-utils.d.ts.map +1 -1
- package/dist/reporter-utils.d.ts +11 -2
- package/dist/reporter-utils.d.ts.map +1 -1
- package/dist/reporter.cjs +368 -154
- package/dist/reporter.d.ts +13 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +182 -153
- package/dist/schemas.d.ts +115 -15
- package/dist/schemas.d.ts.map +1 -1
- package/dist/server/app.d.ts +5 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/routes.d.ts +7 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server.cjs +329 -64
- package/dist/server.js +2 -2
- package/dist/snapshot-path-resolver.d.ts +30 -0
- package/dist/snapshot-path-resolver.d.ts.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -35,7 +35,7 @@ __export(server_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(server_exports);
|
|
36
36
|
|
|
37
37
|
// src/server/app.ts
|
|
38
|
-
var
|
|
38
|
+
var import_path6 = require("path");
|
|
39
39
|
var import_url = require("url");
|
|
40
40
|
var import_p_limit = __toESM(require("p-limit"), 1);
|
|
41
41
|
|
|
@@ -62,6 +62,12 @@ function withImageSource(image) {
|
|
|
62
62
|
source: classifyImage(image)
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
+
function getDeclaredVisualNames(visualNames, visualDeclarations) {
|
|
66
|
+
return visualDeclarations?.map(({ visualName }) => visualName) ?? visualNames;
|
|
67
|
+
}
|
|
68
|
+
function copyVisualDeclarations(visualDeclarations) {
|
|
69
|
+
return visualDeclarations?.map((visualDeclaration) => ({ ...visualDeclaration }));
|
|
70
|
+
}
|
|
65
71
|
function mergeDeclaredImages(images, visualNames) {
|
|
66
72
|
const names = /* @__PURE__ */ new Set([...Object.keys(images), ...visualNames]);
|
|
67
73
|
return Object.fromEntries(
|
|
@@ -181,10 +187,14 @@ function applyTestEndEvent(state, data, options = {}) {
|
|
|
181
187
|
}
|
|
182
188
|
test.status = mapStatus(data.status);
|
|
183
189
|
const resultStatus = data.status === "passed" ? "success" : data.status === "failed" ? "failed" : "pending";
|
|
190
|
+
const visualDeclarations = copyVisualDeclarations(data.visualDeclarations);
|
|
184
191
|
const images = preservePreviousPassingImages(
|
|
185
192
|
test,
|
|
186
193
|
data.status,
|
|
187
|
-
mergeDeclaredImages(
|
|
194
|
+
mergeDeclaredImages(
|
|
195
|
+
attachmentsToImages(data.attachments, options.screenshotsBaseUrl),
|
|
196
|
+
getDeclaredVisualNames(data.visualNames, visualDeclarations)
|
|
197
|
+
)
|
|
188
198
|
);
|
|
189
199
|
const diffCount = countDiffImages(images);
|
|
190
200
|
const hasDiffs = diffCount > 0;
|
|
@@ -196,6 +206,7 @@ function applyTestEndEvent(state, data, options = {}) {
|
|
|
196
206
|
status: resultStatus,
|
|
197
207
|
retries: 0,
|
|
198
208
|
images,
|
|
209
|
+
visualDeclarations,
|
|
199
210
|
error: data.error,
|
|
200
211
|
duration: data.duration
|
|
201
212
|
}
|
|
@@ -233,6 +244,20 @@ var ImagesSchema = import_zod.z.object({
|
|
|
233
244
|
error: import_zod.z.string().optional(),
|
|
234
245
|
source: VisualSourceSchema.optional()
|
|
235
246
|
});
|
|
247
|
+
var ScreenshotDeclarationSchema = import_zod.z.discriminatedUnion("kind", [
|
|
248
|
+
import_zod.z.object({
|
|
249
|
+
visualName: import_zod.z.string(),
|
|
250
|
+
kind: import_zod.z.literal("named"),
|
|
251
|
+
declaredName: import_zod.z.string(),
|
|
252
|
+
snapshotBaseName: import_zod.z.string(),
|
|
253
|
+
occurrenceIndex: import_zod.z.number()
|
|
254
|
+
}),
|
|
255
|
+
import_zod.z.object({
|
|
256
|
+
visualName: import_zod.z.string(),
|
|
257
|
+
kind: import_zod.z.literal("unnamed"),
|
|
258
|
+
occurrenceIndex: import_zod.z.number()
|
|
259
|
+
})
|
|
260
|
+
]);
|
|
236
261
|
var AttachmentSchema = import_zod.z.object({
|
|
237
262
|
name: import_zod.z.string(),
|
|
238
263
|
path: import_zod.z.string(),
|
|
@@ -244,6 +269,7 @@ var TestResultSchema = import_zod.z.object({
|
|
|
244
269
|
status: TestResultStatusSchema,
|
|
245
270
|
retries: import_zod.z.number(),
|
|
246
271
|
images: import_zod.z.record(import_zod.z.string(), ImagesSchema).optional(),
|
|
272
|
+
visualDeclarations: import_zod.z.array(ScreenshotDeclarationSchema).optional(),
|
|
247
273
|
error: import_zod.z.string().optional(),
|
|
248
274
|
duration: import_zod.z.number().optional()
|
|
249
275
|
});
|
|
@@ -290,6 +316,10 @@ var TestEndDataSchema = import_zod.z.object({
|
|
|
290
316
|
status: import_zod.z.enum(["passed", "failed", "skipped"]),
|
|
291
317
|
attachments: import_zod.z.array(AttachmentSchema),
|
|
292
318
|
visualNames: import_zod.z.array(import_zod.z.string()).default([]),
|
|
319
|
+
visualDeclarations: import_zod.z.preprocess(
|
|
320
|
+
(value) => value === null ? void 0 : value,
|
|
321
|
+
import_zod.z.array(ScreenshotDeclarationSchema).optional()
|
|
322
|
+
),
|
|
293
323
|
error: import_zod.z.string().optional(),
|
|
294
324
|
duration: import_zod.z.number().optional()
|
|
295
325
|
});
|
|
@@ -639,13 +669,172 @@ async function watchReportArtifacts(options) {
|
|
|
639
669
|
}
|
|
640
670
|
|
|
641
671
|
// src/server/routes.ts
|
|
672
|
+
var import_fs = require("fs");
|
|
673
|
+
var import_path5 = require("path");
|
|
674
|
+
|
|
675
|
+
// src/snapshot-path-resolver.ts
|
|
676
|
+
var import_crypto = require("crypto");
|
|
642
677
|
var import_path4 = require("path");
|
|
678
|
+
var DEFAULT_SCREENSHOT_TEMPLATE = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}";
|
|
679
|
+
var WINDOWS_FILESYSTEM_FRIENDLY_LENGTH = 60;
|
|
680
|
+
function isUnsafeFilePathCharacter(character) {
|
|
681
|
+
const codePoint = character.codePointAt(0);
|
|
682
|
+
return codePoint !== void 0 && (codePoint <= 44 || codePoint >= 46 && codePoint <= 47 || codePoint >= 58 && codePoint <= 64 || codePoint >= 91 && codePoint <= 96 || codePoint >= 123 && codePoint <= 127);
|
|
683
|
+
}
|
|
684
|
+
function sanitizeForFilePath(value) {
|
|
685
|
+
return Array.from(value).reduce(
|
|
686
|
+
(state, character) => {
|
|
687
|
+
const unsafeCharacter = isUnsafeFilePathCharacter(character);
|
|
688
|
+
return unsafeCharacter ? state.previousCharacterWasUnsafe ? state : {
|
|
689
|
+
value: `${state.value}-`,
|
|
690
|
+
previousCharacterWasUnsafe: true
|
|
691
|
+
} : {
|
|
692
|
+
value: `${state.value}${character}`,
|
|
693
|
+
previousCharacterWasUnsafe: false
|
|
694
|
+
};
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
value: "",
|
|
698
|
+
previousCharacterWasUnsafe: false
|
|
699
|
+
}
|
|
700
|
+
).value;
|
|
701
|
+
}
|
|
702
|
+
function trimLongString(value, length = WINDOWS_FILESYSTEM_FRIENDLY_LENGTH) {
|
|
703
|
+
if (value.length <= length) {
|
|
704
|
+
return value;
|
|
705
|
+
}
|
|
706
|
+
const hash = (0, import_crypto.createHash)("sha1").update(value).digest("hex");
|
|
707
|
+
const middle = `-${hash.slice(0, 5)}-`;
|
|
708
|
+
const start = Math.floor((length - middle.length) / 2);
|
|
709
|
+
const end = length - middle.length - start;
|
|
710
|
+
return value.slice(0, start) + middle + value.slice(-end);
|
|
711
|
+
}
|
|
712
|
+
function sanitizeFilePathBeforeExtension(filePath, extension = (0, import_path4.extname)(filePath)) {
|
|
713
|
+
const base = filePath.slice(0, filePath.length - extension.length);
|
|
714
|
+
return sanitizeForFilePath(base) + extension;
|
|
715
|
+
}
|
|
716
|
+
function addSuffixToFilePath(filePath, suffix) {
|
|
717
|
+
const extension = (0, import_path4.extname)(filePath);
|
|
718
|
+
return filePath.slice(0, filePath.length - extension.length) + suffix + extension;
|
|
719
|
+
}
|
|
720
|
+
function normalizedSnapshotDir(config) {
|
|
721
|
+
return (0, import_path4.resolve)(config.configDir, config.snapshotDir);
|
|
722
|
+
}
|
|
723
|
+
function templateValue(template, token, value) {
|
|
724
|
+
return template.replace(
|
|
725
|
+
new RegExp(`\\{(.)?${token}\\}`, "g"),
|
|
726
|
+
(_, prefix) => value === "" ? "" : `${prefix ?? ""}${value}`
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
function applyTemplate(input, nameArgument, extension) {
|
|
730
|
+
const template = input.config.toHaveScreenshotPathTemplate ?? input.config.snapshotPathTemplate ?? DEFAULT_SCREENSHOT_TEMPLATE;
|
|
731
|
+
const relativeTestFilePath = (0, import_path4.relative)(input.config.testDir, input.testFile);
|
|
732
|
+
const parsed = (0, import_path4.parse)(relativeTestFilePath);
|
|
733
|
+
const tokens = [
|
|
734
|
+
["testDir", input.config.testDir],
|
|
735
|
+
["snapshotDir", normalizedSnapshotDir(input.config)],
|
|
736
|
+
["snapshotSuffix", input.config.snapshotSuffix],
|
|
737
|
+
["testFileDir", parsed.dir],
|
|
738
|
+
["platform", process.platform],
|
|
739
|
+
["projectName", sanitizeForFilePath(input.config.projectName)],
|
|
740
|
+
["testName", ""],
|
|
741
|
+
["testFileName", parsed.base],
|
|
742
|
+
["testFilePath", relativeTestFilePath],
|
|
743
|
+
["arg", nameArgument],
|
|
744
|
+
["ext", extension]
|
|
745
|
+
];
|
|
746
|
+
const snapshotPath = tokens.reduce(
|
|
747
|
+
(currentTemplate, [token, value]) => templateValue(currentTemplate, token, value),
|
|
748
|
+
template
|
|
749
|
+
);
|
|
750
|
+
return (0, import_path4.resolve)(input.config.configDir, snapshotPath);
|
|
751
|
+
}
|
|
752
|
+
function removeExtension(filePath, extension = (0, import_path4.extname)(filePath)) {
|
|
753
|
+
return filePath.slice(0, filePath.length - extension.length);
|
|
754
|
+
}
|
|
755
|
+
function snapshotNameParts(declaredName) {
|
|
756
|
+
const extension = (0, import_path4.extname)(declaredName) || ".png";
|
|
757
|
+
return {
|
|
758
|
+
extension,
|
|
759
|
+
filePath: (0, import_path4.extname)(declaredName) === "" ? `${declaredName}${extension}` : declaredName
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function filePathForOccurrence(filePath, occurrenceIndex) {
|
|
763
|
+
return occurrenceIndex === 1 ? filePath : addSuffixToFilePath(filePath, `-${occurrenceIndex - 1}`);
|
|
764
|
+
}
|
|
765
|
+
function createResolvedBaselineTarget(input, declaration, nameArgument, extension) {
|
|
766
|
+
return {
|
|
767
|
+
visualName: declaration.visualName,
|
|
768
|
+
attachmentBaseName: declaration.visualName,
|
|
769
|
+
artifactBaseName: sanitizeForFilePath(declaration.visualName),
|
|
770
|
+
snapshotPath: applyTemplate(input, nameArgument, extension)
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
function resolveStringCallTarget(input, declaration) {
|
|
774
|
+
const { extension, filePath } = snapshotNameParts(declaration.declaredName);
|
|
775
|
+
const occurrenceFilePath = filePathForOccurrence(filePath, declaration.occurrenceIndex);
|
|
776
|
+
const sanitizedNameWithExtension = sanitizeFilePathBeforeExtension(occurrenceFilePath, extension);
|
|
777
|
+
const nameArgument = removeExtension(sanitizedNameWithExtension, extension);
|
|
778
|
+
return createResolvedBaselineTarget(input, declaration, nameArgument, extension);
|
|
779
|
+
}
|
|
780
|
+
function resolveArrayCallTarget(input, declaration) {
|
|
781
|
+
const { extension, filePath } = snapshotNameParts(declaration.declaredName);
|
|
782
|
+
const occurrenceFilePath = filePathForOccurrence(filePath, declaration.occurrenceIndex);
|
|
783
|
+
const nameArgument = (0, import_path4.join)((0, import_path4.dirname)(occurrenceFilePath), (0, import_path4.basename)(occurrenceFilePath, extension));
|
|
784
|
+
return createResolvedBaselineTarget(input, declaration, nameArgument, extension);
|
|
785
|
+
}
|
|
786
|
+
function resolveNamedTarget(input, declaration) {
|
|
787
|
+
if (!declaration.declaredName.includes("/")) {
|
|
788
|
+
return resolveStringCallTarget(input, declaration);
|
|
789
|
+
}
|
|
790
|
+
const stringCallTarget = resolveStringCallTarget(input, declaration);
|
|
791
|
+
const arrayCallTarget = resolveArrayCallTarget(input, declaration);
|
|
792
|
+
if (stringCallTarget.snapshotPath === arrayCallTarget.snapshotPath) {
|
|
793
|
+
return stringCallTarget;
|
|
794
|
+
}
|
|
795
|
+
if (input.snapshotPathExists === void 0) {
|
|
796
|
+
return void 0;
|
|
797
|
+
}
|
|
798
|
+
const stringCallTargetExists = input.snapshotPathExists(stringCallTarget.snapshotPath);
|
|
799
|
+
const arrayCallTargetExists = input.snapshotPathExists(arrayCallTarget.snapshotPath);
|
|
800
|
+
if (stringCallTargetExists === arrayCallTargetExists) {
|
|
801
|
+
return void 0;
|
|
802
|
+
}
|
|
803
|
+
return stringCallTargetExists ? stringCallTarget : arrayCallTarget;
|
|
804
|
+
}
|
|
805
|
+
function reporterTitlesWithoutProjectAndFile(reporterTitlePath2) {
|
|
806
|
+
return reporterTitlePath2.slice(3).filter((part) => part !== "");
|
|
807
|
+
}
|
|
808
|
+
function anonymousName(reporterTitlePath2, occurrenceIndex) {
|
|
809
|
+
const rawAnonymousName = `${reporterTitlesWithoutProjectAndFile(reporterTitlePath2).join(" ")} ${occurrenceIndex}.png`;
|
|
810
|
+
return sanitizeFilePathBeforeExtension(trimLongString(rawAnonymousName), ".png");
|
|
811
|
+
}
|
|
812
|
+
function resolveTarget(input, declaration) {
|
|
813
|
+
switch (declaration.kind) {
|
|
814
|
+
case "named":
|
|
815
|
+
return typeof declaration.declaredName === "string" && declaration.declaredName !== "" ? resolveNamedTarget(input, declaration) : void 0;
|
|
816
|
+
case "unnamed": {
|
|
817
|
+
const anonymousFileName = anonymousName(input.reporterTitlePath, declaration.occurrenceIndex);
|
|
818
|
+
const extension = ".png";
|
|
819
|
+
const nameArgument = (0, import_path4.join)((0, import_path4.dirname)(anonymousFileName), (0, import_path4.basename)(anonymousFileName, extension));
|
|
820
|
+
return createResolvedBaselineTarget(input, declaration, nameArgument, extension);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
function resolveBaselineTargets(input) {
|
|
825
|
+
return input.declarations.flatMap((declaration) => {
|
|
826
|
+
const resolvedTarget = resolveTarget(input, declaration);
|
|
827
|
+
return resolvedTarget === void 0 ? [] : [resolvedTarget];
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// src/server/routes.ts
|
|
643
832
|
var LIVE_UPDATES_WEBSOCKET_PATH = "/";
|
|
644
833
|
function isWebSocketUpgradeRequest(req) {
|
|
645
834
|
return new URL(req.url).pathname === LIVE_UPDATES_WEBSOCKET_PATH && req.headers.get("upgrade")?.toLowerCase() === "websocket";
|
|
646
835
|
}
|
|
647
836
|
async function handleRoot(ctx) {
|
|
648
|
-
const html = await respondWithFile((0,
|
|
837
|
+
const html = await respondWithFile((0, import_path5.join)(ctx.staticDir, "index.html"), "text/html");
|
|
649
838
|
return html ?? new Response("Not Found", { status: 404 });
|
|
650
839
|
}
|
|
651
840
|
async function handleAppCss() {
|
|
@@ -662,6 +851,37 @@ async function handleSrcFiles(req) {
|
|
|
662
851
|
function handleApiReport(ctx) {
|
|
663
852
|
return Response.json(ctx.reportData);
|
|
664
853
|
}
|
|
854
|
+
var APPROVAL_TARGET_ERROR = "Could not resolve approval target";
|
|
855
|
+
function actualPathFromUrl(ctx, actualUrl) {
|
|
856
|
+
return actualUrl.startsWith("/screenshots/") ? (0, import_path5.join)(ctx.reportData.screenshotDir, actualUrl.slice("/screenshots/".length)) : actualUrl;
|
|
857
|
+
}
|
|
858
|
+
function reporterTitlePath(test) {
|
|
859
|
+
const testFile = test.location?.file;
|
|
860
|
+
return ["", test.browser, testFile ?? "", ...test.titlePath, test.title];
|
|
861
|
+
}
|
|
862
|
+
function resolveApprovalTarget(ctx, test, retry, imageName) {
|
|
863
|
+
const testFile = test.location?.file;
|
|
864
|
+
const declaration = test.results?.[retry]?.visualDeclarations?.find((candidate) => candidate.visualName === imageName);
|
|
865
|
+
if (ctx.approvalRouting === void 0 || testFile === void 0 || declaration === void 0) {
|
|
866
|
+
return null;
|
|
867
|
+
}
|
|
868
|
+
const targets = resolveBaselineTargets({
|
|
869
|
+
testFile,
|
|
870
|
+
reporterTitlePath: reporterTitlePath(test),
|
|
871
|
+
declarations: [declaration],
|
|
872
|
+
config: {
|
|
873
|
+
configDir: ctx.approvalRouting.configDir,
|
|
874
|
+
testDir: ctx.approvalRouting.playwrightTestDir ?? (0, import_path5.dirname)(testFile),
|
|
875
|
+
snapshotDir: ctx.approvalRouting.playwrightSnapshotDir ?? (0, import_path5.dirname)(testFile),
|
|
876
|
+
projectName: test.browser,
|
|
877
|
+
snapshotSuffix: process.platform,
|
|
878
|
+
snapshotPathTemplate: ctx.approvalRouting.playwrightSnapshotPathTemplate,
|
|
879
|
+
toHaveScreenshotPathTemplate: ctx.approvalRouting.playwrightToHaveScreenshotPathTemplate
|
|
880
|
+
},
|
|
881
|
+
snapshotPathExists: import_fs.existsSync
|
|
882
|
+
});
|
|
883
|
+
return targets.length === 1 ? targets[0]?.snapshotPath ?? null : null;
|
|
884
|
+
}
|
|
665
885
|
async function handleApiApprove(ctx, req) {
|
|
666
886
|
try {
|
|
667
887
|
const rawBody = await req.json();
|
|
@@ -672,61 +892,96 @@ async function handleApiApprove(ctx, req) {
|
|
|
672
892
|
}
|
|
673
893
|
const { id, retry, image } = parsed;
|
|
674
894
|
const test = ctx.reportData.tests[id];
|
|
675
|
-
if (test
|
|
676
|
-
|
|
677
|
-
|
|
895
|
+
if (test === void 0) {
|
|
896
|
+
return Response.json({ success: false, error: "Test not found" }, { status: 404 });
|
|
897
|
+
}
|
|
898
|
+
const actualUrl = test.results?.[retry]?.images?.[image]?.actual;
|
|
899
|
+
if (actualUrl === void 0) {
|
|
900
|
+
return Response.json({ success: false, error: "Actual image not found" }, { status: 409 });
|
|
901
|
+
}
|
|
902
|
+
const snapshotPath = resolveApprovalTarget(ctx, test, retry, image);
|
|
903
|
+
if (snapshotPath === null) {
|
|
904
|
+
return Response.json({ success: false, error: APPROVAL_TARGET_ERROR }, { status: 409 });
|
|
905
|
+
}
|
|
906
|
+
try {
|
|
907
|
+
await copyFilePortable(actualPathFromUrl(ctx, actualUrl), snapshotPath);
|
|
908
|
+
test.approved = { ...test.approved ?? {}, [image]: retry };
|
|
678
909
|
await ctx.saveReport();
|
|
679
|
-
|
|
680
|
-
if (actualUrl !== null && actualUrl !== void 0 && test.location?.file !== null && test.location?.file !== void 0) {
|
|
681
|
-
const actualPath = actualUrl.replace("/screenshots/", `${ctx.reportData.screenshotDir}/`);
|
|
682
|
-
const snapshotPath = `${test.location.file}-snapshots/${image}-${test.browser}-${process.platform}.png`;
|
|
683
|
-
try {
|
|
684
|
-
await copyFilePortable(actualPath, snapshotPath);
|
|
685
|
-
console.log(` \u2714 Updated baseline: ${snapshotPath}`);
|
|
686
|
-
} catch (err) {
|
|
687
|
-
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
688
|
-
console.error(` \u2717 Failed to update baseline: ${errorMsg}`);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
910
|
+
console.log(` \u2714 Updated baseline: ${snapshotPath}`);
|
|
691
911
|
console.log(` \u2714 Approved [${test.browser}] ${test.title} \u2014 ${image}`);
|
|
912
|
+
return Response.json({ success: true });
|
|
913
|
+
} catch (err) {
|
|
914
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
915
|
+
console.error(` \u2717 Failed to update baseline: ${errorMsg}`);
|
|
916
|
+
return Response.json({ success: false, error: "Failed to update baseline" }, { status: 500 });
|
|
692
917
|
}
|
|
693
|
-
return Response.json({ success: true });
|
|
694
918
|
} catch {
|
|
695
919
|
return Response.json({ success: false, error: "Invalid request" }, { status: 400 });
|
|
696
920
|
}
|
|
697
921
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
const approved = {};
|
|
922
|
+
function createBulkApprovalUpdates(ctx) {
|
|
923
|
+
return Object.values(ctx.reportData.tests).flatMap((test) => {
|
|
924
|
+
if (!test.results || test.results.length === 0) {
|
|
925
|
+
return [];
|
|
926
|
+
}
|
|
704
927
|
const lastRetry = test.results.length - 1;
|
|
705
928
|
const lastResult = test.results[lastRetry];
|
|
706
|
-
if (!lastResult?.images)
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
929
|
+
if (!lastResult?.images) {
|
|
930
|
+
return [];
|
|
931
|
+
}
|
|
932
|
+
return Object.keys(lastResult.images).flatMap((imageName) => {
|
|
710
933
|
const actualUrl = lastResult.images?.[imageName]?.actual;
|
|
711
|
-
if (actualUrl
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}).catch((err) => {
|
|
718
|
-
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
719
|
-
console.error(` \u2717 Failed to update baseline: ${errorMsg}`);
|
|
720
|
-
})
|
|
721
|
-
);
|
|
934
|
+
if (actualUrl === void 0) {
|
|
935
|
+
return [Promise.resolve({ kind: "unresolved" })];
|
|
936
|
+
}
|
|
937
|
+
const snapshotPath = resolveApprovalTarget(ctx, test, lastRetry, imageName);
|
|
938
|
+
if (snapshotPath === null) {
|
|
939
|
+
return [Promise.resolve({ kind: "unresolved" })];
|
|
722
940
|
}
|
|
941
|
+
return [
|
|
942
|
+
copyFilePortable(actualPathFromUrl(ctx, actualUrl), snapshotPath).then(
|
|
943
|
+
() => ({
|
|
944
|
+
kind: "approved",
|
|
945
|
+
imageName,
|
|
946
|
+
retry: lastRetry,
|
|
947
|
+
snapshotPath,
|
|
948
|
+
test
|
|
949
|
+
})
|
|
950
|
+
).catch((err) => {
|
|
951
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
952
|
+
console.error(` \u2717 Failed to update baseline: ${errorMsg}`);
|
|
953
|
+
return { kind: "failed" };
|
|
954
|
+
})
|
|
955
|
+
];
|
|
723
956
|
});
|
|
724
|
-
test.approved = approved;
|
|
725
957
|
});
|
|
958
|
+
}
|
|
959
|
+
function summarizeBulkApprovalOutcomes(outcomes) {
|
|
960
|
+
return outcomes.reduce(
|
|
961
|
+
(summary, outcome) => {
|
|
962
|
+
switch (outcome.kind) {
|
|
963
|
+
case "approved": {
|
|
964
|
+
outcome.test.approved = { ...outcome.test.approved ?? {}, [outcome.imageName]: outcome.retry };
|
|
965
|
+
console.log(` \u2714 Updated baseline: ${outcome.snapshotPath}`);
|
|
966
|
+
return { ...summary, approved: summary.approved + 1 };
|
|
967
|
+
}
|
|
968
|
+
case "unresolved":
|
|
969
|
+
return { ...summary, unresolved: summary.unresolved + 1 };
|
|
970
|
+
case "failed":
|
|
971
|
+
return { ...summary, failed: summary.failed + 1 };
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
{ approved: 0, unresolved: 0, failed: 0 }
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
async function handleApiApproveAll(ctx) {
|
|
978
|
+
const outcomes = await Promise.all(createBulkApprovalUpdates(ctx));
|
|
979
|
+
const counts = summarizeBulkApprovalOutcomes(outcomes);
|
|
726
980
|
await ctx.saveReport();
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
981
|
+
console.log(
|
|
982
|
+
` \u2714 Approved all \u2014 approved: ${counts.approved}, unresolved: ${counts.unresolved}, failed: ${counts.failed}`
|
|
983
|
+
);
|
|
984
|
+
return Response.json({ success: counts.failed === 0, ...counts });
|
|
730
985
|
}
|
|
731
986
|
async function handleApiImages(req) {
|
|
732
987
|
const path = new URL(req.url).pathname.slice("/api/images/".length);
|
|
@@ -742,7 +997,7 @@ async function handleScreenshots(ctx, req) {
|
|
|
742
997
|
}
|
|
743
998
|
async function handleDist(ctx, req) {
|
|
744
999
|
const path = new URL(req.url).pathname.slice("/dist/".length);
|
|
745
|
-
const filePath = (0,
|
|
1000
|
+
const filePath = (0, import_path5.join)(ctx.staticDir, path);
|
|
746
1001
|
const contentType = filePath.endsWith(".css") ? "text/css" : filePath.endsWith(".js") ? "application/javascript" : filePath.endsWith(".svelte") ? "text/plain" : "application/octet-stream";
|
|
747
1002
|
const file = await respondWithFile(filePath, contentType);
|
|
748
1003
|
return file ?? new Response("Not Found", { status: 404 });
|
|
@@ -761,10 +1016,10 @@ function handleHttpRequest(ctx, req) {
|
|
|
761
1016
|
if (pathname === "/api/report") {
|
|
762
1017
|
return Promise.resolve(handleApiReport(ctx));
|
|
763
1018
|
}
|
|
764
|
-
if (pathname === "/api/approve") {
|
|
1019
|
+
if (pathname === "/api/approve" && req.method === "POST") {
|
|
765
1020
|
return handleApiApprove(ctx, req);
|
|
766
1021
|
}
|
|
767
|
-
if (pathname === "/api/approve-all") {
|
|
1022
|
+
if (pathname === "/api/approve-all" && req.method === "POST") {
|
|
768
1023
|
return handleApiApproveAll(ctx);
|
|
769
1024
|
}
|
|
770
1025
|
if (pathname.startsWith("/api/images/")) {
|
|
@@ -898,19 +1153,19 @@ function createWebSocketMessageHandler(getHandlerContext) {
|
|
|
898
1153
|
};
|
|
899
1154
|
}
|
|
900
1155
|
async function resolveStaticDir(staticDir) {
|
|
901
|
-
const currentDir = (0,
|
|
1156
|
+
const currentDir = (0, import_path6.dirname)((0, import_url.fileURLToPath)(import_meta.url));
|
|
902
1157
|
const candidates = staticDir === void 0 ? [
|
|
903
1158
|
currentDir,
|
|
904
|
-
(0,
|
|
905
|
-
(0,
|
|
906
|
-
(0,
|
|
907
|
-
(0,
|
|
908
|
-
(0,
|
|
909
|
-
] : [staticDir, (0,
|
|
1159
|
+
(0, import_path6.join)(currentDir, "dist"),
|
|
1160
|
+
(0, import_path6.join)(currentDir, "..", "dist"),
|
|
1161
|
+
(0, import_path6.join)(currentDir, "..", "..", "dist"),
|
|
1162
|
+
(0, import_path6.join)(currentDir, ".."),
|
|
1163
|
+
(0, import_path6.join)(currentDir, "..", "..")
|
|
1164
|
+
] : [staticDir, (0, import_path6.join)(staticDir, "dist")];
|
|
910
1165
|
const resolvedCandidates = await Promise.all(
|
|
911
1166
|
candidates.map(async (candidate) => ({
|
|
912
1167
|
candidate,
|
|
913
|
-
exists: await fileExists((0,
|
|
1168
|
+
exists: await fileExists((0, import_path6.join)(candidate, "index.html"))
|
|
914
1169
|
}))
|
|
915
1170
|
);
|
|
916
1171
|
const resolved = resolvedCandidates.find(({ exists }) => exists);
|
|
@@ -921,9 +1176,23 @@ async function resolveStaticDir(staticDir) {
|
|
|
921
1176
|
}
|
|
922
1177
|
async function resolveReportPath(reportPath) {
|
|
923
1178
|
if (await isDirectory(reportPath)) {
|
|
924
|
-
return { reportFile: (0,
|
|
1179
|
+
return { reportFile: (0, import_path6.join)(reportPath, "report.json"), offlineReportDir: reportPath };
|
|
925
1180
|
}
|
|
926
|
-
return { reportFile: reportPath, offlineReportDir: (0,
|
|
1181
|
+
return { reportFile: reportPath, offlineReportDir: (0, import_path6.dirname)(reportPath) };
|
|
1182
|
+
}
|
|
1183
|
+
function createRoutesContext(reportData, staticDir, saveReport, options) {
|
|
1184
|
+
return {
|
|
1185
|
+
reportData,
|
|
1186
|
+
staticDir,
|
|
1187
|
+
saveReport,
|
|
1188
|
+
approvalRouting: {
|
|
1189
|
+
configDir: options.configDir ?? process.cwd(),
|
|
1190
|
+
playwrightTestDir: options.playwrightTestDir,
|
|
1191
|
+
playwrightSnapshotDir: options.playwrightSnapshotDir,
|
|
1192
|
+
playwrightSnapshotPathTemplate: options.playwrightSnapshotPathTemplate,
|
|
1193
|
+
playwrightToHaveScreenshotPathTemplate: options.playwrightToHaveScreenshotPathTemplate
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
927
1196
|
}
|
|
928
1197
|
async function createServerApp(options = {}) {
|
|
929
1198
|
const port = options.port ?? 3e3;
|
|
@@ -936,11 +1205,7 @@ async function createServerApp(options = {}) {
|
|
|
936
1205
|
async function saveReport() {
|
|
937
1206
|
await writeJsonFile(reportFile, reportData);
|
|
938
1207
|
}
|
|
939
|
-
const routesContext =
|
|
940
|
-
reportData,
|
|
941
|
-
staticDir,
|
|
942
|
-
saveReport
|
|
943
|
-
};
|
|
1208
|
+
const routesContext = createRoutesContext(reportData, staticDir, saveReport, options);
|
|
944
1209
|
const getHandlerContext = () => createHandlerContext(reportData, wsClients, currentRunIds, saveReport);
|
|
945
1210
|
const handleRequest = (req) => handleHttpRequest(routesContext, req);
|
|
946
1211
|
const handleWebSocketMessage = createWebSocketMessageHandler(getHandlerContext);
|
|
@@ -1140,7 +1405,7 @@ function attachWebSocketServer(server, app) {
|
|
|
1140
1405
|
});
|
|
1141
1406
|
}
|
|
1142
1407
|
async function listen(server, port) {
|
|
1143
|
-
await new Promise((
|
|
1408
|
+
await new Promise((resolve2, reject) => {
|
|
1144
1409
|
const onError = (error) => {
|
|
1145
1410
|
server.off("error", onError);
|
|
1146
1411
|
reject(error);
|
|
@@ -1148,7 +1413,7 @@ async function listen(server, port) {
|
|
|
1148
1413
|
server.on("error", onError);
|
|
1149
1414
|
server.listen(port, () => {
|
|
1150
1415
|
server.off("error", onError);
|
|
1151
|
-
|
|
1416
|
+
resolve2();
|
|
1152
1417
|
});
|
|
1153
1418
|
});
|
|
1154
1419
|
}
|
package/dist/server.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ScreenshotDeclaration } from './reporter-utils.ts';
|
|
2
|
+
export interface SnapshotResolverConfig {
|
|
3
|
+
readonly configDir: string;
|
|
4
|
+
readonly testDir: string;
|
|
5
|
+
readonly snapshotDir: string;
|
|
6
|
+
readonly projectName: string;
|
|
7
|
+
readonly snapshotSuffix: string;
|
|
8
|
+
readonly snapshotPathTemplate?: string;
|
|
9
|
+
readonly toHaveScreenshotPathTemplate?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SnapshotResolverInput {
|
|
12
|
+
readonly testFile: string;
|
|
13
|
+
readonly reporterTitlePath: readonly string[];
|
|
14
|
+
readonly declarations: readonly ScreenshotDeclaration[];
|
|
15
|
+
readonly config: SnapshotResolverConfig;
|
|
16
|
+
readonly snapshotPathExists?: (snapshotPath: string) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedBaselineTarget {
|
|
19
|
+
readonly visualName: string;
|
|
20
|
+
readonly attachmentBaseName: string;
|
|
21
|
+
readonly artifactBaseName: string;
|
|
22
|
+
readonly snapshotPath: string;
|
|
23
|
+
}
|
|
24
|
+
declare function sanitizeForFilePath(value: string): string;
|
|
25
|
+
declare function trimLongString(value: string, length?: number): string;
|
|
26
|
+
declare function sanitizeFilePathBeforeExtension(filePath: string, extension?: string): string;
|
|
27
|
+
declare function addSuffixToFilePath(filePath: string, suffix: string): string;
|
|
28
|
+
export declare function resolveBaselineTargets(input: SnapshotResolverInput): ResolvedBaselineTarget[];
|
|
29
|
+
export { sanitizeForFilePath, trimLongString, sanitizeFilePathBeforeExtension, addSuffixToFilePath };
|
|
30
|
+
//# sourceMappingURL=snapshot-path-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-path-resolver.d.ts","sourceRoot":"","sources":["../src/snapshot-path-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA8B,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAM5F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAA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HANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScreenshotDeclaration } from './reporter-utils.ts';
|
|
1
2
|
export type VisualSource = 'comparison' | 'baseline-only' | 'declared-only';
|
|
2
3
|
export interface Images {
|
|
3
4
|
actual?: string;
|
|
@@ -21,6 +22,7 @@ export interface TestResult {
|
|
|
21
22
|
status: TestResultStatus;
|
|
22
23
|
retries: number;
|
|
23
24
|
images?: Partial<Record<string, Images>>;
|
|
25
|
+
visualDeclarations?: readonly ScreenshotDeclaration[];
|
|
24
26
|
error?: string;
|
|
25
27
|
duration?: number;
|
|
26
28
|
}
|
|
@@ -71,6 +73,7 @@ export interface TestEndMessage {
|
|
|
71
73
|
status: 'passed' | 'failed' | 'skipped';
|
|
72
74
|
attachments: Attachment[];
|
|
73
75
|
visualNames: string[];
|
|
76
|
+
visualDeclarations?: readonly ScreenshotDeclaration[];
|
|
74
77
|
error?: string;
|
|
75
78
|
duration?: number;
|
|
76
79
|
};
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAA;AAE3E,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,UAAU,GAAG,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