@argos-ci/playwright 1.2.0 → 1.2.1

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 CHANGED
@@ -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,10 +150,7 @@ 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
- if (!attachment.body) {
152
- throw new Error("Missing attachment body");
153
- }
153
+ if (checkIsArgosScreenshot(attachment) || checkIsArgosScreenshotMetadata(attachment)) {
154
154
  const path = join(this.uploadDir, getAttachementFilename(attachment.name));
155
155
  await this.writeFile(path, attachment.body);
156
156
  return;
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.0",
4
+ "version": "1.2.1",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -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": "47a939474ca0c0d55ca5360dcaa5f8912547ed76"
61
+ "gitHead": "cb1cd503c540349ca4444cd2cc5b6cd267cf85cf"
62
62
  }