@percy/playwright 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +6 -9
package/index.js CHANGED
@@ -2,7 +2,7 @@ const utils = require('@percy/sdk-utils');
2
2
 
3
3
  // Collect client and environment information
4
4
  const sdkPkg = require('./package.json');
5
- const playwrightPkg = require(require.resolve('./package.json', { paths: [__dirname] }));
5
+ const playwrightPkg = require('playwright/package.json');
6
6
  const CLIENT_INFO = `${sdkPkg.name}/${sdkPkg.version}`;
7
7
  const ENV_INFO = `${playwrightPkg.name}/${playwrightPkg.version}`;
8
8
 
@@ -25,7 +25,7 @@ async function percySnapshot(page, name, options) {
25
25
  }, options);
26
26
 
27
27
  // Post the DOM to the snapshot endpoint with snapshot options and other info
28
- await utils.postSnapshot({
28
+ const response = await utils.postSnapshot({
29
29
  ...options,
30
30
  environmentInfo: ENV_INFO,
31
31
  clientInfo: CLIENT_INFO,
@@ -33,6 +33,7 @@ async function percySnapshot(page, name, options) {
33
33
  domSnapshot,
34
34
  name
35
35
  });
36
+ return response?.body?.data;
36
37
  } catch (err) {
37
38
  log.error(`Could not take DOM snapshot "${name}"`);
38
39
  log.error(err);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@percy/playwright",
3
3
  "description": "Playwright client library for visual testing with Percy",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "license": "MIT",
6
6
  "author": "Perceptual Inc.",
7
7
  "repository": "https://github.com/percy/percy-playwright",
@@ -21,22 +21,19 @@
21
21
  },
22
22
  "scripts": {
23
23
  "lint": "eslint --ignore-path .gitignore .",
24
- "test": "cross-env NODE_ENV=test playwright test",
24
+ "test": "cross-env NODE_ENV=test percy exec --testing -- playwright test",
25
25
  "test:coverage": "nyc yarn test",
26
26
  "test:types": "tsd"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "dependencies": {
32
- "@percy/sdk-utils": "^1.0.0"
33
- },
34
31
  "peerDependencies": {
35
32
  "playwright-core": ">=1"
36
33
  },
37
34
  "devDependencies": {
38
- "@percy/core": "^1.1.2",
39
- "@playwright/test": "^1.22.0",
35
+ "@percy/cli": "^1.28.2",
36
+ "@playwright/test": "^1.24.2",
40
37
  "cross-env": "^7.0.2",
41
38
  "eslint": "^7.18.0",
42
39
  "eslint-config-standard": "^16.0.2",
@@ -45,7 +42,7 @@
45
42
  "eslint-plugin-promise": "^5.1.0",
46
43
  "eslint-plugin-standard": "^5.0.0",
47
44
  "nyc": "^15.1.0",
48
- "playwright": "^1.22.0",
49
- "tsd": "^0.20.0"
45
+ "playwright": "^1.24.2",
46
+ "tsd": "^0.25.0"
50
47
  }
51
48
  }