@applitools/eyes-puppeteer 1.13.0 → 1.14.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/CHANGELOG.md CHANGED
@@ -11,6 +11,20 @@
11
11
 
12
12
 
13
13
 
14
+ ## 1.14.1 - 2023/3/22
15
+
16
+ ### Features
17
+ ### Bug fixes
18
+ - Fixed slowness during ufg tests
19
+ - Optimized number of requests during polling
20
+
21
+ ## 1.14.0 - 2023/2/21
22
+
23
+ ### Features
24
+ - Additional internal event logs
25
+ - Crop screenshot image base on account info
26
+ ### Bug fixes
27
+
14
28
  ## 1.13.0 - 2022/12/20
15
29
 
16
30
  ### Features
package/README.md CHANGED
@@ -29,6 +29,7 @@
29
29
  - [Scroll root element](#scroll-root-element)
30
30
  - [Tag (`withName`)](#tag-withname)
31
31
  - [Lazy loading (`lazyLoad`)](#lazy-loading-lazyload)
32
+ - [Density metrics](#density-metrics-densitymetrics)
32
33
  - [Other checkSettings configuration](#other-checksettings-configuration)
33
34
  - [close](#close)
34
35
  - [Runners](#runners)
@@ -386,6 +387,23 @@ Other details:
386
387
  - The SDK will repeatedly scroll the page using the `scrollLength` until either the page cannot be scrolled further or the `maxAmountToScroll` has been reached (whichever happens first)
387
388
  - If more time is needed for additional content to load, then increase the waitingTime to a value higher than 500 milliseconds. If better performance is desired and additional content lazily loads faster than the default waitingTime, then reduce it to a value below 500 milliseconds
388
389
 
390
+ ##### Density metrics (`densityMetrics`)
391
+
392
+ In order to set the density metrics for the screenshot, use the `densityMetrics` method. This method accepts a object value with the following properties:
393
+
394
+ - `xdpi` - The exact physical pixels per inch of the screen in the X dimension.
395
+ - `ydpi` - The exact physical pixels per inch of the screen in the Y dimension.
396
+ - `scaleRatio` - The scale ratio.
397
+
398
+ ```js
399
+ // set density metrics
400
+ eyes.check(Target.window().densityMetrics({
401
+ xdpi: 100,
402
+ ydpi: 100,
403
+ scaleRatio: 1
404
+ }))
405
+ ```
406
+
389
407
  ###### Other checkSettings configuration
390
408
 
391
409
  <!-- TODO add explanation -->
package/dist/api.js CHANGED
@@ -26,33 +26,30 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.closeBatch = exports.BatchClose = exports.Target = exports.CheckSettings = exports.CheckSettingsAutomation = exports.Configuration = exports.Eyes = void 0;
30
- const core_1 = require("@applitools/core");
31
- const api = __importStar(require("@applitools/eyes-api"));
29
+ exports.closeBatch = exports.BatchClose = exports.Configuration = exports.Target = exports.TargetAutomation = exports.CheckSettings = exports.CheckSettingsAutomation = exports.Eyes = void 0;
30
+ const eyes = __importStar(require("@applitools/eyes"));
32
31
  const spec = __importStar(require("@applitools/spec-driver-puppeteer"));
33
- const sdk = (0, core_1.makeCore)({
34
- agentId: `eyes.puppeteer/${require('../package.json').version}`,
35
- spec,
36
- });
37
- __exportStar(require("@applitools/eyes-api"), exports);
38
- class Eyes extends api.Eyes {
32
+ __exportStar(require("@applitools/eyes"), exports);
33
+ const sdk = { agentId: `eyes.puppeteer/${require('../package.json').version}`, spec };
34
+ class Eyes extends eyes.Eyes {
39
35
  }
40
36
  exports.Eyes = Eyes;
41
- Eyes._spec = sdk;
42
- class Configuration extends api.Configuration {
43
- }
44
- exports.Configuration = Configuration;
45
- Configuration._spec = sdk;
46
- class CheckSettingsAutomation extends api.CheckSettingsAutomation {
37
+ Eyes._sdk = sdk;
38
+ class CheckSettingsAutomation extends eyes.CheckSettingsAutomation {
47
39
  }
48
40
  exports.CheckSettingsAutomation = CheckSettingsAutomation;
49
- CheckSettingsAutomation._spec = sdk;
41
+ CheckSettingsAutomation._spec = spec;
50
42
  class CheckSettings extends CheckSettingsAutomation {
51
43
  }
52
44
  exports.CheckSettings = CheckSettings;
53
- exports.Target = { ...api.Target, spec: sdk };
54
- class BatchClose extends api.BatchClose {
45
+ exports.TargetAutomation = { ...eyes.TargetAutomation, spec };
46
+ exports.Target = { ...eyes.Target, spec };
47
+ class Configuration extends eyes.Configuration {
48
+ }
49
+ exports.Configuration = Configuration;
50
+ Configuration._spec = spec;
51
+ class BatchClose extends eyes.BatchClose {
55
52
  }
56
53
  exports.BatchClose = BatchClose;
57
- BatchClose._spec = sdk;
58
- exports.closeBatch = api.closeBatch(sdk);
54
+ BatchClose._sdk = sdk;
55
+ exports.closeBatch = eyes.closeBatch(sdk);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-puppeteer",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "description": "Applitools Eyes SDK for Puppeteer",
5
5
  "keywords": [
6
6
  "eyes-puppeteer",
@@ -38,58 +38,33 @@
38
38
  "types"
39
39
  ],
40
40
  "scripts": {
41
- "lint": "eslint '**/*.ts'",
42
- "build": "ttsc",
41
+ "lint": "node ../../node_modules/.bin/eslint '**/*.ts'",
42
+ "build": "node ../../node_modules/.bin/ttsc --project ./tsconfig.build.json",
43
43
  "generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/universal-sdk/js/config.js --name 'eyes-puppeteer'",
44
44
  "test": "yarn test:coverage",
45
+ "test:coverage": "yarn generate:tests && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-puppeteer' APPLITOOLS_BATCH_ID=$(uuidgen) MOCHA_GROUP=coverage node ../../node_modules/.bin/mocha './test/generic/*.spec.js' --parallel --jobs ${MOCHA_JOBS:-15} --exit",
45
46
  "test:sanity": "echo 'create sanity suite'",
46
- "test:coverage": "yarn generate:tests && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-puppeteer' APPLITOOLS_BATCH_ID=$(uuidgen) XUNIT_FILE=coverage-test-report.xml mocha --exit --config .mocharc.cvg.js",
47
- "report": "coverage-tests report https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes-puppeteer'",
48
- "docker:build": "docker build -t applitools/puppeteer-chrome .",
49
- "docker:rebuild": "docker build --no-cache -t applitools/puppeteer-chrome .",
50
- "docker:run": "yarn docker:build && docker run -e NODE_AUTH_TOKEN --env APPLITOOLS_API_KEY=$APPLITOOLS_API_KEY_SDK --env APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-puppeteer' --env APPLITOOLS_BATCH_ID=$(uuidgen) --env XUNIT_FILE=coverage-test-report.xml -it --init --rm -v $(pwd):/sandbox applitools/puppeteer-chrome",
47
+ "report": "bongo report --name 'puppeteer'",
51
48
  "upgrade:framework": "if [ ! -z $APPLITOOLS_PUPPETEER_VERSION ]; then packagejson=`cat package.json`; yarn upgrade --no-lockfile puppeteer@$APPLITOOLS_PUPPETEER_VERSION; echo \"$packagejson\" > package.json; fi",
52
49
  "deps": "bongo deps",
53
- "gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='puppeteer' -f links='types test-utils sdk-shared eyes-sdk-core visual-grid-client eyes-api spec-driver-puppeteer utils driver snippets screenshoter'",
50
+ "gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='puppeteer' -f links='types test-utils eyes-sdk-core visual-grid-client eyes spec-driver-puppeteer utils driver snippets screenshoter'",
54
51
  "gh:publish": "gh workflow run publish-puppeteer.yml --ref $(git rev-parse --abbrev-ref HEAD)",
55
- "preversion": "bongo preversion --verifyPendingChanges && yarn build",
52
+ "preversion": "bongo preversion --verifyPendingChanges",
56
53
  "version": "bongo version --withPendingChanges",
57
- "postversion": "bongo postversion"
58
- },
59
- "husky": {
60
- "hooks": {
61
- "pre-push": "yarn bongo lint"
62
- }
54
+ "postversion": "bongo postversion",
55
+ "postpublish": "bongo send-release-notification --name 'puppeteer'"
63
56
  },
64
57
  "dependencies": {
65
- "@applitools/core": "1.3.3",
66
- "@applitools/eyes-api": "1.11.2",
67
- "@applitools/spec-driver-puppeteer": "1.1.28"
58
+ "@applitools/eyes": "1.0.2",
59
+ "@applitools/spec-driver-puppeteer": "1.1.49"
68
60
  },
69
61
  "devDependencies": {
70
- "@applitools/api-extractor": "1.2.11",
71
- "@applitools/bongo": "^2.2.0",
72
- "@applitools/scripts": "1.2.0",
73
- "@applitools/sdk-coverage-tests": "2.7.10",
74
- "@applitools/sdk-shared": "0.9.15",
75
- "@applitools/test-utils": "1.5.4",
76
- "@types/mocha": "^9.1.1",
77
- "@types/node": "12",
78
- "@typescript-eslint/eslint-plugin": "^5.27.0",
79
- "@typescript-eslint/parser": "^5.27.0",
80
- "eslint": "^8.16.0",
81
- "eslint-config-prettier": "^8.5.0",
82
- "eslint-plugin-mocha-no-only": "^1.1.1",
83
- "eslint-plugin-node": "^11.1.0",
84
- "eslint-plugin-prettier": "^4.0.0",
85
- "husky": "^4.3.8",
86
- "mocha": "^9.2.2",
87
- "prettier": "^2.6.2",
88
- "puppeteer": "^18.0.5",
89
- "spec-xunit-file": "0.0.1-3",
90
- "ts-node": "^10.8.0",
91
- "ttypescript": "^1.5.13",
92
- "typescript": "^4.7.2"
62
+ "@applitools/api-extractor": "1.2.12",
63
+ "@applitools/bongo": "^3.0.2",
64
+ "@applitools/sdk-coverage-tests": "3.0.0",
65
+ "@applitools/test-utils": "1.5.14",
66
+ "@types/node": "^12.20.55",
67
+ "puppeteer": "^18.0.5"
93
68
  },
94
69
  "peerDependencies": {
95
70
  "puppeteer": ">=5.3.0"