@applitools/core 2.4.10 → 2.4.12
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 +13 -0
- package/dist/automation/locate.js +37 -1
- package/package.json +2 -2
- package/types/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.4.12 - 2023/4/12
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
### Bug fixes
|
|
9
|
+
- Expose types for eyes-cypress
|
|
10
|
+
|
|
11
|
+
## 2.4.11 - 2023/4/11
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
- Make `locate` to return coordinates that could be directly used with the driver
|
|
15
|
+
### Bug fixes
|
|
16
|
+
- Fix issue when `locate` return wrong type of the region, with `left` and `top` properties instead of `x` and `y`
|
|
17
|
+
|
|
5
18
|
## 2.4.10 - 2023/4/10
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "2.4.12",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@applitools/core-base": "1.1.
|
|
78
|
+
"@applitools/core-base": "1.1.48",
|
|
79
79
|
"@applitools/dom-capture": "11.2.1",
|
|
80
80
|
"@applitools/dom-snapshot": "4.7.9",
|
|
81
81
|
"@applitools/driver": "1.11.41",
|
package/types/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type SpecType } from '@applitools/driver';
|
|
|
6
6
|
import { type Logger } from '@applitools/logger';
|
|
7
7
|
import { type Renderer } from '@applitools/ufg-client';
|
|
8
8
|
import { type ECClient, type ECClientSettings } from '@applitools/ec-client';
|
|
9
|
-
export { ECClient };
|
|
9
|
+
export { ECClient, Renderer };
|
|
10
10
|
export * from './automation/types';
|
|
11
11
|
export type TypedCore<TSpec extends SpecType, TType extends 'classic' | 'ufg'> = TType extends 'ufg' ? UFGCore.Core<TSpec> : ClassicCore.Core<TSpec>;
|
|
12
12
|
export type TypedEyes<TSpec extends SpecType, TType extends 'classic' | 'ufg'> = TType extends 'ufg' ? UFGCore.Eyes<TSpec> : ClassicCore.Eyes<TSpec>;
|