@percy/playwright 1.0.6-beta.1 → 1.0.6

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +10 -6
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -106,7 +106,7 @@ const desired_cap = {
106
106
  - `page` (**required**) - A `playwright` page instance
107
107
  - `name` (**required**) - The snapshot name; must be unique to each snapshot
108
108
  - `options` (**optional**) - There are various options supported by percyScreenshot to server further functionality.
109
- - `sync` - Boolean value by default it falls back to `false`, Gives the processed result around screenshot [From CLI v1.28.0-beta.0+]
109
+ - `sync` - Boolean value by default it falls back to `false`, Gives the processed result around screenshot [From CLI v1.28.8+]
110
110
  - `fullPage` - Boolean value by default it falls back to `false`, Takes full page screenshot [From CLI v1.27.6+]
111
111
  - `freezeAnimatedImage` - Boolean value by default it falls back to `false`, you can pass `true` and percy will freeze image based animations.
112
112
  - `freezeImageBySelectors` - List of selectors. Images will be freezed which are passed using selectors. For this to work `freezeAnimatedImage` must be set to true.
package/index.js CHANGED
@@ -9,7 +9,7 @@ const ENV_INFO = `${playwrightPkg.name}/${playwrightPkg.version}`;
9
9
  const log = utils.logger('playwright');
10
10
 
11
11
  // Take a DOM snapshot and post it to the snapshot endpoint
12
- async function percySnapshot(page, name, options) {
12
+ const percySnapshot = async function(page, name, options) {
13
13
  if (!page) throw new Error('A Playwright `page` object is required.');
14
14
  if (!name) throw new Error('The `name` argument is required.');
15
15
  if (!(await utils.isPercyEnabled())) return;
@@ -39,15 +39,15 @@ async function percySnapshot(page, name, options) {
39
39
  log.error(`Could not take DOM snapshot "${name}"`);
40
40
  log.error(err);
41
41
  }
42
- }
42
+ };
43
43
 
44
44
  // Takes Playwright screenshot with Automate
45
- async function percyScreenshot(page, name, options) {
45
+ const percyScreenshot = async function(page, name, options) {
46
46
  if (!page) throw new Error('A Playwright `page` object is required.');
47
47
  if (!name) throw new Error('The `name` argument is required.');
48
48
  if (!(await utils.isPercyEnabled())) return;
49
49
  if (Utils.projectType() !== 'automate') {
50
- throw new Error('Invalid function call - percyScreenshot(). Please use percySnapshot() function for taking screenshot. percyScreenshot() should be used only while using Percy with Automate. For more information on usage of PercySnapshot(), refer doc for your language https://docs.percy.io/docs/end-to-end-testing');
50
+ throw new Error('Invalid function call - percyScreenshot(). Please use percySnapshot() function for taking screenshot. percyScreenshot() should be used only while using Percy with Automate. For more information on usage of PercySnapshot(), refer doc for your language https://www.browserstack.com/docs/percy/integrate/overview');
51
51
  }
52
52
 
53
53
  try {
@@ -71,6 +71,10 @@ async function percyScreenshot(page, name, options) {
71
71
  log.error(`Could not take percy screenshot "${name}"`);
72
72
  log.error(err);
73
73
  }
74
- }
74
+ };
75
75
 
76
- module.exports = { percySnapshot, percyScreenshot, CLIENT_INFO, ENV_INFO };
76
+ module.exports = percySnapshot;
77
+ module.exports.percySnapshot = percySnapshot;
78
+ module.exports.percyScreenshot = percyScreenshot;
79
+ module.exports.CLIENT_INFO = CLIENT_INFO;
80
+ module.exports.ENV_INFO = ENV_INFO;
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.6-beta.1",
4
+ "version": "1.0.6",
5
5
  "license": "MIT",
6
6
  "author": "Perceptual Inc.",
7
7
  "repository": "https://github.com/percy/percy-playwright",
@@ -29,13 +29,13 @@
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public",
32
- "tag": "beta"
32
+ "tag": "latest"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "playwright-core": ">=1"
36
36
  },
37
37
  "devDependencies": {
38
- "@percy/cli": "^1.28.8-beta.3",
38
+ "@percy/cli": "^1.28.8",
39
39
  "@playwright/test": "^1.24.2",
40
40
  "babel-eslint": "^10.1.0",
41
41
  "cross-env": "^7.0.2",