@applitools/core 2.3.5 → 2.3.7
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 +15 -0
- package/dist/core.js +1 -1
- package/dist/ufg/utils/take-snapshots.js +1 -2
- package/dist/universal/core-server.js +2 -6
- package/package.json +15 -13
- package/types/ufg/utils/generate-safe-selectors.d.ts +1 -1
- package/dist/ufg/utils/extract-broker-url.js +0 -52
- package/types/ufg/utils/extract-broker-url.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.3.7 - 2023/2/23
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
- Added caching for broker url to avoid looking for the nml element multiple times
|
|
9
|
+
- Passing density metric for PPI support in the sdk
|
|
10
|
+
### Bug fixes
|
|
11
|
+
- Fixed issue with universal protocol when manager ref was deleted once `EyesManager.getResults` was called
|
|
12
|
+
- Fixed vulnerabilities of EC client
|
|
13
|
+
|
|
14
|
+
## 2.3.6 - 2023/2/17
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
### Bug fixes
|
|
18
|
+
- Update some type declarations
|
|
19
|
+
|
|
5
20
|
## 2.3.5 - 2023/2/17
|
|
6
21
|
|
|
7
22
|
### Features
|
package/dist/core.js
CHANGED
|
@@ -52,7 +52,7 @@ function makeCore({ spec, concurrency, core, agentId = 'core', cwd = process.cwd
|
|
|
52
52
|
locateText: (0, locate_text_1.makeLocateText)({ spec, core, logger }),
|
|
53
53
|
extractText: (0, extract_text_1.makeExtractText)({ spec, core, logger }),
|
|
54
54
|
openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, core, concurrency, logger }),
|
|
55
|
-
makeManager: (0, make_manager_1.makeMakeManager)({ spec, concurrency, agentId, logger }),
|
|
55
|
+
makeManager: (0, make_manager_1.makeMakeManager)({ spec, core, concurrency, agentId, logger }),
|
|
56
56
|
closeBatch: (0, close_batch_1.makeCloseBatch)({ core, logger }),
|
|
57
57
|
deleteTest: (0, delete_test_1.makeDeleteTest)({ core, logger }),
|
|
58
58
|
makeECClient: (0, make_ec_client_1.makeMakeECClient)({ core, logger }),
|
|
@@ -18,7 +18,6 @@ exports.takeSnapshots = void 0;
|
|
|
18
18
|
const take_dom_snapshots_1 = require("./take-dom-snapshots");
|
|
19
19
|
const take_vhses_1 = require("./take-vhses");
|
|
20
20
|
const nml_client_1 = require("@applitools/nml-client");
|
|
21
|
-
const extract_broker_url_1 = require("./extract-broker-url");
|
|
22
21
|
__exportStar(require("./take-dom-snapshots"), exports);
|
|
23
22
|
__exportStar(require("./take-vhses"), exports);
|
|
24
23
|
async function takeSnapshots({ driver, settings, hooks, provides, logger, }) {
|
|
@@ -26,7 +25,7 @@ async function takeSnapshots({ driver, settings, hooks, provides, logger, }) {
|
|
|
26
25
|
return (0, take_dom_snapshots_1.takeDomSnapshots)({ driver, settings, hooks, provides, logger });
|
|
27
26
|
}
|
|
28
27
|
else {
|
|
29
|
-
const brokerUrl = await
|
|
28
|
+
const brokerUrl = await driver.extractBrokerUrl();
|
|
30
29
|
if (brokerUrl) {
|
|
31
30
|
return (await (0, nml_client_1.takeSnapshots)({ url: brokerUrl, settings, logger }));
|
|
32
31
|
}
|
|
@@ -142,9 +142,7 @@ printStdout = false, ...handlerOptions } = {}) {
|
|
|
142
142
|
});
|
|
143
143
|
socket.command('EyesManager.getResults', async ({ manager, ...options }) => {
|
|
144
144
|
var _a;
|
|
145
|
-
|
|
146
|
-
refer.destroy(manager);
|
|
147
|
-
return results;
|
|
145
|
+
return (_a = refer.deref(manager)) === null || _a === void 0 ? void 0 : _a.getResults(options);
|
|
148
146
|
});
|
|
149
147
|
socket.command('Eyes.check', async ({ eyes, ...options }) => {
|
|
150
148
|
var _a;
|
|
@@ -164,9 +162,7 @@ printStdout = false, ...handlerOptions } = {}) {
|
|
|
164
162
|
});
|
|
165
163
|
socket.command('Eyes.getResults', async ({ eyes, ...options }) => {
|
|
166
164
|
var _a;
|
|
167
|
-
|
|
168
|
-
refer.destroy(eyes);
|
|
169
|
-
return results;
|
|
165
|
+
return (_a = refer.deref(eyes)) === null || _a === void 0 ? void 0 : _a.getResults(options);
|
|
170
166
|
});
|
|
171
167
|
socket.command('Debug.getHistory', async () => {
|
|
172
168
|
return getHistory();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"build:bin:arm64": "pkg . --target node14-linux-arm64 --output ./bin/core-linux-arm64",
|
|
51
51
|
"build:bin:zip": "zip -j ./bin/core.zip $(find ./bin -type f -not -name '*.zip' -not -name '*.tar.gz' | xargs)",
|
|
52
52
|
"build:bin:tgz": "tar -czf ./bin/core.tar.gz $(find ./bin -type f -not -name '*.zip' -not -name '*.tar.gz' | xargs)",
|
|
53
|
-
"test": "mocha --
|
|
53
|
+
"test": "mocha --config .mocharc.cvg.js",
|
|
54
54
|
"test:sanity": "yarn test:unit",
|
|
55
55
|
"test:bin": "mocha --no-timeouts -r ts-node/register --parallel --jobs 15 './test/bin/**/*.spec.ts'",
|
|
56
56
|
"test:e2e": "mocha --no-timeouts -r ts-node/register --parallel --jobs 15 './test/e2e/**/*.spec.ts'",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"deps": "bongo deps",
|
|
63
63
|
"preversion": "bongo preversion --verify-pending-changes --skip-deps",
|
|
64
64
|
"version": "bongo version --with-pending-changes",
|
|
65
|
-
"postversion": "bongo postversion
|
|
65
|
+
"postversion": "bongo postversion"
|
|
66
66
|
},
|
|
67
67
|
"pkg": {
|
|
68
68
|
"scripts": "./dist/cli/cli.js",
|
|
@@ -73,19 +73,19 @@
|
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@applitools/core-base": "1.1.
|
|
76
|
+
"@applitools/core-base": "1.1.39",
|
|
77
77
|
"@applitools/dom-capture": "11.2.1",
|
|
78
78
|
"@applitools/dom-snapshot": "4.7.3",
|
|
79
|
-
"@applitools/driver": "1.11.
|
|
80
|
-
"@applitools/ec-client": "1.2.
|
|
79
|
+
"@applitools/driver": "1.11.34",
|
|
80
|
+
"@applitools/ec-client": "1.2.11",
|
|
81
81
|
"@applitools/logger": "1.1.46",
|
|
82
|
-
"@applitools/nml-client": "1.3.
|
|
82
|
+
"@applitools/nml-client": "1.3.37",
|
|
83
83
|
"@applitools/req": "1.1.30",
|
|
84
|
-
"@applitools/screenshoter": "3.7.
|
|
84
|
+
"@applitools/screenshoter": "3.7.28",
|
|
85
85
|
"@applitools/snippets": "2.4.15",
|
|
86
86
|
"@applitools/socket": "1.0.8",
|
|
87
|
-
"@applitools/spec-driver-webdriver": "1.0.
|
|
88
|
-
"@applitools/ufg-client": "1.1.
|
|
87
|
+
"@applitools/spec-driver-webdriver": "1.0.14",
|
|
88
|
+
"@applitools/ufg-client": "1.1.27",
|
|
89
89
|
"@applitools/utils": "1.3.30",
|
|
90
90
|
"@types/ws": "8.5.4",
|
|
91
91
|
"abort-controller": "3.0.0",
|
|
@@ -98,9 +98,10 @@
|
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"@applitools/bongo": "^2.2.5",
|
|
101
|
-
"@applitools/
|
|
102
|
-
"@applitools/spec-driver-
|
|
103
|
-
"@applitools/spec-driver-
|
|
101
|
+
"@applitools/sdk-coverage-tests": "^2.7.10",
|
|
102
|
+
"@applitools/spec-driver-puppeteer": "^1.1.46",
|
|
103
|
+
"@applitools/spec-driver-selenium": "^1.5.31",
|
|
104
|
+
"@applitools/spec-driver-webdriverio": "^1.4.29",
|
|
104
105
|
"@applitools/test-server": "^1.1.26",
|
|
105
106
|
"@applitools/test-utils": "^1.5.12",
|
|
106
107
|
"@types/mocha": "^9.1.1",
|
|
@@ -109,6 +110,7 @@
|
|
|
109
110
|
"@types/yargs": "^17.0.22",
|
|
110
111
|
"chromedriver": "^106.0.0",
|
|
111
112
|
"mocha": "^10.0.0",
|
|
113
|
+
"mocha-multi": "^1.1.7",
|
|
112
114
|
"nock": "^13.2.8",
|
|
113
115
|
"pkg": "^5.8.0",
|
|
114
116
|
"png-async": "^0.9.4",
|
|
@@ -9,7 +9,7 @@ export declare function generateSafeSelectors<TSpec extends SpecType>({ context,
|
|
|
9
9
|
elementReference: ElementReference<TSpec>;
|
|
10
10
|
} | {
|
|
11
11
|
safeSelector: CommonSelector<never>;
|
|
12
|
-
originalSelector:
|
|
12
|
+
originalSelector: CommonSelector<never> | null;
|
|
13
13
|
elementReference: ElementReference<TSpec>;
|
|
14
14
|
})[];
|
|
15
15
|
cleanupGeneratedSelectors: () => Promise<void>;
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.extractBrokerUrl = void 0;
|
|
27
|
-
const utils = __importStar(require("@applitools/utils"));
|
|
28
|
-
async function extractBrokerUrl({ driver, logger, }) {
|
|
29
|
-
if (!driver.isNative)
|
|
30
|
-
return null;
|
|
31
|
-
logger.log('Broker url extraction is started');
|
|
32
|
-
const element = await driver.element({ type: 'accessibility id', selector: 'Applitools_View' });
|
|
33
|
-
if (!element)
|
|
34
|
-
return null;
|
|
35
|
-
try {
|
|
36
|
-
let result;
|
|
37
|
-
do {
|
|
38
|
-
result = JSON.parse(await element.getText());
|
|
39
|
-
if (result.nextPath) {
|
|
40
|
-
logger.log('Broker url was extraction finished successfully with value', result.nextPath);
|
|
41
|
-
return result.nextPath;
|
|
42
|
-
}
|
|
43
|
-
await utils.general.sleep(1000);
|
|
44
|
-
} while (!result.error);
|
|
45
|
-
logger.error('Broker url extraction has failed with error', result.error);
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.extractBrokerUrl = extractBrokerUrl;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type SpecType, type Driver } from '@applitools/driver';
|
|
2
|
-
import { type Logger } from '@applitools/logger';
|
|
3
|
-
export declare function extractBrokerUrl<TSpec extends SpecType>({ driver, logger, }: {
|
|
4
|
-
driver: Driver<TSpec>;
|
|
5
|
-
logger: Logger;
|
|
6
|
-
}): Promise<string | null>;
|