@argos-ci/playwright 1.6.2 → 1.6.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.
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.mjs +12 -3
- package/package.json +2 -2
package/dist/reporter.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare class ArgosReporter implements Reporter {
|
|
|
15
15
|
uploadToArgos: boolean;
|
|
16
16
|
constructor(config: ArgosReporterOptions);
|
|
17
17
|
writeFile(path: string, body: Buffer | string): Promise<void>;
|
|
18
|
+
copyFile(from: string, to: string): Promise<void>;
|
|
18
19
|
getAutomaticScreenshotName(test: TestCase, result: TestResult): string;
|
|
19
20
|
onBegin(config: FullConfig, _suite: Suite): Promise<void>;
|
|
20
21
|
onTestEnd(test: TestCase, result: TestResult): Promise<void>;
|
package/dist/reporter.mjs
CHANGED
|
@@ -141,6 +141,15 @@ class ArgosReporter {
|
|
|
141
141
|
}
|
|
142
142
|
await writeFile(path, body);
|
|
143
143
|
}
|
|
144
|
+
async copyFile(from, to) {
|
|
145
|
+
const dir = dirname(to);
|
|
146
|
+
if (dir !== this.uploadDir) {
|
|
147
|
+
await mkdir(dir, {
|
|
148
|
+
recursive: true
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
await copyFile(from, to);
|
|
152
|
+
}
|
|
144
153
|
getAutomaticScreenshotName(test, result) {
|
|
145
154
|
let name = test.titlePath().join(" ");
|
|
146
155
|
name += result.retry > 0 ? ` #${result.retry + 1}` : "";
|
|
@@ -155,7 +164,7 @@ class ArgosReporter {
|
|
|
155
164
|
await Promise.all(result.attachments.map(async (attachment)=>{
|
|
156
165
|
if (checkIsArgosScreenshot(attachment) || checkIsArgosScreenshotMetadata(attachment)) {
|
|
157
166
|
const path = join(this.uploadDir, getAttachmentFilename(attachment.name));
|
|
158
|
-
await copyFile(attachment.path, path);
|
|
167
|
+
await this.copyFile(attachment.path, path);
|
|
159
168
|
return;
|
|
160
169
|
}
|
|
161
170
|
// Error screenshots are sent to Argos
|
|
@@ -166,8 +175,8 @@ class ArgosReporter {
|
|
|
166
175
|
const path = join(this.uploadDir, `${name}.png`);
|
|
167
176
|
await Promise.all([
|
|
168
177
|
this.writeFile(path + ".argos.json", JSON.stringify(metadata)),
|
|
169
|
-
copyFile(attachment.path, path),
|
|
170
|
-
trace ? copyFile(trace.path, path + ".pw-trace.zip") : null
|
|
178
|
+
this.copyFile(attachment.path, path),
|
|
179
|
+
trace ? this.copyFile(trace.path, path + ".pw-trace.zip") : null
|
|
171
180
|
]);
|
|
172
181
|
return;
|
|
173
182
|
}
|
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.6.
|
|
4
|
+
"version": "1.6.3",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"test": "pnpm exec playwright test",
|
|
60
60
|
"e2e": "UPLOAD_TO_ARGOS=true pnpm run test"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b89289d745507679cc68b35dafb7ac5e6cbd6dda"
|
|
63
63
|
}
|