@argos-ci/playwright 1.2.0 → 1.2.2
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/reporter.mjs +6 -6
- package/package.json +4 -4
package/dist/reporter.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { createRequire } from 'node:module';
|
|
|
9
9
|
function getOriginalAttachmentName(name) {
|
|
10
10
|
return name.replace(/^argos\/[^/]+___/, "");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function getAttachmentFilename(name) {
|
|
13
13
|
if (name.startsWith("argos/screenshot")) {
|
|
14
14
|
return `${getOriginalAttachmentName(name)}.png`;
|
|
15
15
|
}
|
|
@@ -24,6 +24,9 @@ function checkIsTrace(attachment) {
|
|
|
24
24
|
function checkIsArgosScreenshot(attachment) {
|
|
25
25
|
return attachment.name.startsWith("argos/") && attachment.contentType === "image/png" && Boolean(attachment.body);
|
|
26
26
|
}
|
|
27
|
+
function checkIsArgosScreenshotMetadata(attachment) {
|
|
28
|
+
return attachment.name.startsWith("argos/") && attachment.contentType === "application/json" && Boolean(attachment.body);
|
|
29
|
+
}
|
|
27
30
|
function checkIsAutomaticScreenshot(attachment) {
|
|
28
31
|
return attachment.name === "screenshot" && attachment.contentType === "image/png" && Boolean(attachment.path);
|
|
29
32
|
}
|
|
@@ -147,11 +150,8 @@ class ArgosReporter {
|
|
|
147
150
|
}
|
|
148
151
|
async onTestEnd(test, result) {
|
|
149
152
|
await Promise.all(result.attachments.map(async (attachment)=>{
|
|
150
|
-
if (checkIsArgosScreenshot(attachment)) {
|
|
151
|
-
|
|
152
|
-
throw new Error("Missing attachment body");
|
|
153
|
-
}
|
|
154
|
-
const path = join(this.uploadDir, getAttachementFilename(attachment.name));
|
|
153
|
+
if (checkIsArgosScreenshot(attachment) || checkIsArgosScreenshotMetadata(attachment)) {
|
|
154
|
+
const path = join(this.uploadDir, getAttachmentFilename(attachment.name));
|
|
155
155
|
await this.writeFile(path, attachment.body);
|
|
156
156
|
return;
|
|
157
157
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/playwright",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. Playwright commands and utilities for Argos visual testing.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@argos-ci/browser": "1.0.0",
|
|
46
|
-
"@argos-ci/core": "1.2.
|
|
46
|
+
"@argos-ci/core": "1.2.1",
|
|
47
47
|
"@argos-ci/util": "1.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@argos-ci/cli": "1.0.
|
|
50
|
+
"@argos-ci/cli": "1.0.3",
|
|
51
51
|
"@argos-ci/playwright": "workspace:.",
|
|
52
52
|
"@playwright/test": "^1.38.1",
|
|
53
53
|
"@types/node": "^16.0.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"test": "pnpm exec playwright test",
|
|
59
59
|
"e2e": "WITH_ARGOS_REPORTER=true pnpm run test"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "366dc3bdb4a0a8ed87fc7a2cbf28db1f218567ad"
|
|
62
62
|
}
|