@checkly/playwright-reporter 0.1.7 → 0.1.8
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/dist/index.js +27 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -83,6 +83,15 @@ var AssetCollector = class {
|
|
|
83
83
|
if (testResultsIndex !== -1) {
|
|
84
84
|
return normalizedPath.substring(testResultsIndex);
|
|
85
85
|
}
|
|
86
|
+
const blobResourcesMatch = normalizedPath.match(/.*?[\w-]*blob-report[\w-]*\/resources\/(.+)$/);
|
|
87
|
+
if (blobResourcesMatch) {
|
|
88
|
+
return `test-results/resources/${blobResourcesMatch[1]}`;
|
|
89
|
+
}
|
|
90
|
+
const resourcesIndex = normalizedPath.indexOf("/resources/");
|
|
91
|
+
if (resourcesIndex !== -1) {
|
|
92
|
+
const filename = normalizedPath.split("/").pop() || "";
|
|
93
|
+
return `test-results/resources/${filename}`;
|
|
94
|
+
}
|
|
86
95
|
const parts = normalizedPath.split("/");
|
|
87
96
|
if (parts.length >= 2) {
|
|
88
97
|
return `test-results/${parts.slice(-2).join("/")}`;
|
|
@@ -332,15 +341,17 @@ var Zipper = class {
|
|
|
332
341
|
}
|
|
333
342
|
/**
|
|
334
343
|
* Normalizes attachment paths by extracting the relevant snapshot directory portion.
|
|
335
|
-
* Supports Playwright's default and common custom snapshot directory patterns
|
|
344
|
+
* Supports Playwright's default and common custom snapshot directory patterns,
|
|
345
|
+
* as well as blob merge resource paths.
|
|
336
346
|
*
|
|
337
347
|
* Priority order (first match wins):
|
|
338
348
|
* 1. test-results/ (highest priority, existing behavior)
|
|
339
|
-
* 2.
|
|
340
|
-
* 3.
|
|
341
|
-
* 4.
|
|
342
|
-
* 5.
|
|
343
|
-
* 6.
|
|
349
|
+
* 2. blob-reports/resources/ (blob merge extraction paths)
|
|
350
|
+
* 3. snapshots directories (Playwright default pattern)
|
|
351
|
+
* 4. __screenshots__/ (common custom pattern)
|
|
352
|
+
* 5. __snapshots__/ (common custom pattern)
|
|
353
|
+
* 6. screenshots/ (simple custom pattern)
|
|
354
|
+
* 7. snapshots/ (simple custom pattern)
|
|
344
355
|
*
|
|
345
356
|
* @param attachmentPath - Absolute or relative path to attachment
|
|
346
357
|
* @returns Normalized path starting from the matched directory, or original path if no match
|
|
@@ -351,6 +362,16 @@ var Zipper = class {
|
|
|
351
362
|
if (testResultsIndex !== -1) {
|
|
352
363
|
return normalizedPath.substring(testResultsIndex);
|
|
353
364
|
}
|
|
365
|
+
const blobResourcesMatch = normalizedPath.match(/.*?([\w-]*blob-report[\w-]*\/resources\/.+)$/);
|
|
366
|
+
if (blobResourcesMatch) {
|
|
367
|
+
const filename = normalizedPath.split("/").pop() || "";
|
|
368
|
+
return `test-results/resources/${filename}`;
|
|
369
|
+
}
|
|
370
|
+
const resourcesIndex = normalizedPath.indexOf("/resources/");
|
|
371
|
+
if (resourcesIndex !== -1) {
|
|
372
|
+
const filename = normalizedPath.split("/").pop() || "";
|
|
373
|
+
return `test-results/resources/${filename}`;
|
|
374
|
+
}
|
|
354
375
|
const snapshotsIndex = normalizedPath.indexOf("-snapshots/");
|
|
355
376
|
if (snapshotsIndex !== -1) {
|
|
356
377
|
const pathBeforeSnapshots = normalizedPath.substring(0, snapshotsIndex);
|
package/package.json
CHANGED