@argos-ci/playwright 1.2.1 → 1.3.0

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.mjs CHANGED
@@ -123,7 +123,12 @@ async function argosScreenshot(page, name, { element, has, hasText, viewports, .
123
123
  injectArgos(page)
124
124
  ]);
125
125
  const originalViewportSize = getViewportSize(page);
126
- await page.evaluate(()=>window.__ARGOS__.prepareForScreenshot());
126
+ const fullPage = options.fullPage !== undefined ? options.fullPage : handle === page;
127
+ await page.evaluate(({ fullPage })=>window.__ARGOS__.prepareForScreenshot({
128
+ fullPage
129
+ }), {
130
+ fullPage
131
+ });
127
132
  async function collectMetadata(testInfo) {
128
133
  const [colorScheme, mediaType, libMetadata, testMetadata] = await Promise.all([
129
134
  page.evaluate(()=>window.__ARGOS__.getColorScheme()),
@@ -168,7 +173,7 @@ async function argosScreenshot(page, name, { element, has, hasText, viewports, .
168
173
  handle.screenshot({
169
174
  path: screenshotPath ?? undefined,
170
175
  type: "png",
171
- fullPage: handle === page,
176
+ fullPage,
172
177
  mask: [
173
178
  page.locator('[data-visual-test="blackout"]')
174
179
  ],
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 getAttachementFilename(name) {
12
+ function getAttachmentFilename(name) {
13
13
  if (name.startsWith("argos/screenshot")) {
14
14
  return `${getOriginalAttachmentName(name)}.png`;
15
15
  }
@@ -151,7 +151,7 @@ class ArgosReporter {
151
151
  async onTestEnd(test, result) {
152
152
  await Promise.all(result.attachments.map(async (attachment)=>{
153
153
  if (checkIsArgosScreenshot(attachment) || checkIsArgosScreenshotMetadata(attachment)) {
154
- const path = join(this.uploadDir, getAttachementFilename(attachment.name));
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.1",
4
+ "version": "1.3.0",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -42,12 +42,12 @@
42
42
  "node": ">=16.0.0"
43
43
  },
44
44
  "dependencies": {
45
- "@argos-ci/browser": "1.0.0",
46
- "@argos-ci/core": "1.2.0",
45
+ "@argos-ci/browser": "1.1.0",
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.2",
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": "cb1cd503c540349ca4444cd2cc5b6cd267cf85cf"
61
+ "gitHead": "0cdfcea5b55b54a44228d03919168b25e5dec70f"
62
62
  }