@applitools/core 2.4.9 → 2.4.11

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
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.4.11 - 2023/4/11
6
+
7
+ ### Features
8
+ - Make `locate` to return coordinates that could be directly used with the driver
9
+ ### Bug fixes
10
+ - Fix issue when `locate` return wrong type of the region, with `left` and `top` properties instead of `x` and `y`
11
+
12
+ ## 2.4.10 - 2023/4/10
13
+
14
+ ### Features
15
+ ### Bug fixes
16
+ - Improved appium prefixed capabilities parsing
17
+
5
18
  ## 2.4.9 - 2023/4/7
6
19
 
7
20
  ### Features
@@ -1,8 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.makeLocate = void 0;
4
27
  const driver_1 = require("@applitools/driver");
5
28
  const take_screenshot_1 = require("./utils/take-screenshot");
29
+ const utils = __importStar(require("@applitools/utils"));
6
30
  function makeLocate({ spec, core, logger: defaultLogger }) {
7
31
  return async function locate({ settings, target, logger = defaultLogger, }) {
8
32
  logger.log(`Command "locate" is called with settings`, settings);
@@ -17,7 +41,19 @@ function makeLocate({ spec, core, logger: defaultLogger }) {
17
41
  settings: settings,
18
42
  logger,
19
43
  });
20
- return results;
44
+ const environment = await driver.getEnvironment();
45
+ const viewport = await driver.getViewport();
46
+ return Object.entries(results).reduce((results, [key, regions]) => {
47
+ results[key] = regions.map(region => {
48
+ var _a;
49
+ region = utils.geometry.offset(region, (_a = viewport.viewportLocation) !== null && _a !== void 0 ? _a : { x: 0, y: 0 });
50
+ region = utils.geometry.scale(region, 1 / viewport.viewportScale);
51
+ if (environment.isNative && environment.isAndroid)
52
+ region = utils.geometry.scale(region, viewport.pixelRatio);
53
+ return region;
54
+ });
55
+ return results;
56
+ }, {});
21
57
  };
22
58
  }
23
59
  exports.makeLocate = makeLocate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "2.4.9",
3
+ "version": "2.4.11",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -75,19 +75,19 @@
75
75
  ]
76
76
  },
77
77
  "dependencies": {
78
- "@applitools/core-base": "1.1.46",
78
+ "@applitools/core-base": "1.1.48",
79
79
  "@applitools/dom-capture": "11.2.1",
80
80
  "@applitools/dom-snapshot": "4.7.9",
81
- "@applitools/driver": "1.11.40",
82
- "@applitools/ec-client": "1.2.19",
81
+ "@applitools/driver": "1.11.41",
82
+ "@applitools/ec-client": "1.2.20",
83
83
  "@applitools/logger": "1.1.48",
84
- "@applitools/nml-client": "1.3.45",
85
- "@applitools/req": "1.1.33",
86
- "@applitools/screenshoter": "3.7.36",
84
+ "@applitools/nml-client": "1.3.46",
85
+ "@applitools/req": "1.1.34",
86
+ "@applitools/screenshoter": "3.7.37",
87
87
  "@applitools/snippets": "2.4.19",
88
88
  "@applitools/socket": "1.0.10",
89
- "@applitools/spec-driver-webdriver": "1.0.21",
90
- "@applitools/ufg-client": "1.2.7",
89
+ "@applitools/spec-driver-webdriver": "1.0.22",
90
+ "@applitools/ufg-client": "1.2.8",
91
91
  "@applitools/utils": "1.3.32",
92
92
  "@types/ws": "8.5.4",
93
93
  "abort-controller": "3.0.0",
@@ -100,9 +100,9 @@
100
100
  "devDependencies": {
101
101
  "@applitools/bongo": "^3.0.3",
102
102
  "@applitools/sdk-coverage-tests": "^3.0.2",
103
- "@applitools/spec-driver-puppeteer": "^1.1.53",
104
- "@applitools/spec-driver-selenium": "^1.5.38",
105
- "@applitools/spec-driver-webdriverio": "^1.4.36",
103
+ "@applitools/spec-driver-puppeteer": "^1.1.54",
104
+ "@applitools/spec-driver-selenium": "^1.5.39",
105
+ "@applitools/spec-driver-webdriverio": "^1.4.37",
106
106
  "@applitools/test-server": "^1.1.28",
107
107
  "@applitools/test-utils": "^1.5.16",
108
108
  "@types/node": "^12.20.55",