@applitools/core 2.3.15 → 2.4.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 +8 -1
- package/dist/ufg/check-and-close.js +1 -0
- package/dist/ufg/check.js +1 -0
- package/dist/ufg/core.js +2 -33
- package/dist/ufg/get-ufg-client.js +2 -2
- package/package.json +19 -20
- package/types/ufg/core.d.ts +1 -1
- package/types/ufg/get-ufg-client.d.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 2.
|
|
5
|
+
## 2.4.1 - 2023/3/17
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
- Improved extraction of nml element
|
|
9
|
+
### Bug fixes
|
|
10
|
+
- Fixed issue with concurrency of the renders in ufg mode
|
|
11
|
+
|
|
12
|
+
## 2.4.0 - 2023/3/12
|
|
6
13
|
|
|
7
14
|
### Features
|
|
8
15
|
### Bug fixes
|
|
@@ -208,6 +208,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, spec, signal, logger:
|
|
|
208
208
|
includeFullPageSize: Boolean(settings.pageId),
|
|
209
209
|
type: snapshotType,
|
|
210
210
|
renderer,
|
|
211
|
+
rendererUniqueId: baseEyes.test.rendererUniqueId,
|
|
211
212
|
rendererId: baseEyes.test.rendererId,
|
|
212
213
|
},
|
|
213
214
|
signal,
|
package/dist/ufg/check.js
CHANGED
|
@@ -209,6 +209,7 @@ function makeCheck({ eyes, target: defaultTarget, spec, signal, logger: defaultL
|
|
|
209
209
|
includeFullPageSize: Boolean(settings.pageId),
|
|
210
210
|
type: snapshotType,
|
|
211
211
|
renderer,
|
|
212
|
+
rendererUniqueId: baseEyes.test.rendererUniqueId,
|
|
212
213
|
rendererId: baseEyes.test.rendererId,
|
|
213
214
|
},
|
|
214
215
|
signal,
|
package/dist/ufg/core.js
CHANGED
|
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.makeCore = void 0;
|
|
30
27
|
const logger_1 = require("@applitools/logger");
|
|
@@ -38,43 +35,15 @@ const get_ufg_client_1 = require("./get-ufg-client");
|
|
|
38
35
|
const get_nml_client_1 = require("./get-nml-client");
|
|
39
36
|
const open_eyes_1 = require("./open-eyes");
|
|
40
37
|
const utils = __importStar(require("@applitools/utils"));
|
|
41
|
-
const throat_1 = __importDefault(require("throat"));
|
|
42
38
|
function makeCore({ concurrency, spec, clients, base, agentId = 'core-ufg', cwd = process.cwd(), logger: defaultLogger, }) {
|
|
43
39
|
var _a;
|
|
44
40
|
const logger = (_a = defaultLogger === null || defaultLogger === void 0 ? void 0 : defaultLogger.extend({ label: 'core-ufg' })) !== null && _a !== void 0 ? _a : (0, logger_1.makeLogger)({ label: 'core-ufg' });
|
|
45
41
|
logger.log(`Core ufg is initialized ${base ? 'with' : 'without'} custom base core`);
|
|
46
|
-
base !== null && base !== void 0 ? base : (base = (0, core_base_1.makeCore)({ agentId, cwd, logger }));
|
|
42
|
+
base !== null && base !== void 0 ? base : (base = (0, core_base_1.makeCore)({ agentId, concurrency, cwd, logger }));
|
|
47
43
|
return utils.general.extend(base, core => {
|
|
48
|
-
const throttle = (0, throat_1.default)(concurrency);
|
|
49
44
|
return {
|
|
50
45
|
type: 'ufg',
|
|
51
|
-
base:
|
|
52
|
-
// open eyes with concurrency
|
|
53
|
-
openEyes: utils.general.wrap(base.openEyes, (openEyes, options) => {
|
|
54
|
-
return new Promise((resolve, rejects) => {
|
|
55
|
-
throttle(() => {
|
|
56
|
-
return new Promise(async (done) => {
|
|
57
|
-
try {
|
|
58
|
-
const eyes = await openEyes(options);
|
|
59
|
-
resolve(utils.general.extend(eyes, {
|
|
60
|
-
// release concurrency slot when closed
|
|
61
|
-
close: utils.general.wrap(eyes.close, (close, options) => close(options).finally(done)),
|
|
62
|
-
// release concurrency slot when aborted
|
|
63
|
-
abort: utils.general.wrap(eyes.abort, (abort, options) => abort(options).finally(done)),
|
|
64
|
-
// release concurrency slot when checkAndClose is done
|
|
65
|
-
checkAndClose: utils.general.wrap(eyes.checkAndClose, (checkAndClose, options) => checkAndClose(options).finally(done)),
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
rejects(error);
|
|
70
|
-
// release concurrency slot when error thrown
|
|
71
|
-
done();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}),
|
|
77
|
-
}),
|
|
46
|
+
base: base,
|
|
78
47
|
getViewportSize: spec && (0, get_viewport_size_1.makeGetViewportSize)({ spec, logger }),
|
|
79
48
|
setViewportSize: spec && (0, set_viewport_size_1.makeSetViewportSize)({ spec, logger }),
|
|
80
49
|
locate: (0, locate_1.makeLocate)({ spec, core, logger }),
|
|
@@ -31,8 +31,8 @@ function makeGetUFGClient({ client, logger: defaultLogger }) {
|
|
|
31
31
|
if (client)
|
|
32
32
|
getUFGClientWithCache.setCachedValue('default', Promise.resolve(client));
|
|
33
33
|
return getUFGClientWithCache;
|
|
34
|
-
async function getUFGClient({ config,
|
|
35
|
-
return (0, ufg_client_1.makeUFGClient)({ config,
|
|
34
|
+
async function getUFGClient({ config, logger = defaultLogger }) {
|
|
35
|
+
return (0, ufg_client_1.makeUFGClient)({ config, logger });
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.makeGetUFGClient = makeGetUFGClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -75,25 +75,24 @@
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@applitools/core-base": "1.1.
|
|
78
|
+
"@applitools/core-base": "1.1.42",
|
|
79
79
|
"@applitools/dom-capture": "11.2.1",
|
|
80
|
-
"@applitools/dom-snapshot": "4.7.
|
|
81
|
-
"@applitools/driver": "1.11.
|
|
82
|
-
"@applitools/ec-client": "1.2.
|
|
83
|
-
"@applitools/logger": "1.1.
|
|
84
|
-
"@applitools/nml-client": "1.3.
|
|
85
|
-
"@applitools/req": "1.1.
|
|
86
|
-
"@applitools/screenshoter": "3.7.
|
|
87
|
-
"@applitools/snippets": "2.4.
|
|
88
|
-
"@applitools/socket": "1.0.
|
|
89
|
-
"@applitools/spec-driver-webdriver": "1.0.
|
|
90
|
-
"@applitools/ufg-client": "1.2.
|
|
91
|
-
"@applitools/utils": "1.3.
|
|
80
|
+
"@applitools/dom-snapshot": "4.7.6",
|
|
81
|
+
"@applitools/driver": "1.11.37",
|
|
82
|
+
"@applitools/ec-client": "1.2.16",
|
|
83
|
+
"@applitools/logger": "1.1.48",
|
|
84
|
+
"@applitools/nml-client": "1.3.40",
|
|
85
|
+
"@applitools/req": "1.1.32",
|
|
86
|
+
"@applitools/screenshoter": "3.7.31",
|
|
87
|
+
"@applitools/snippets": "2.4.17",
|
|
88
|
+
"@applitools/socket": "1.0.10",
|
|
89
|
+
"@applitools/spec-driver-webdriver": "1.0.17",
|
|
90
|
+
"@applitools/ufg-client": "1.2.3",
|
|
91
|
+
"@applitools/utils": "1.3.32",
|
|
92
92
|
"@types/ws": "8.5.4",
|
|
93
93
|
"abort-controller": "3.0.0",
|
|
94
94
|
"chalk": "4.1.2",
|
|
95
95
|
"node-fetch": "2.6.7",
|
|
96
|
-
"throat": "6.0.1",
|
|
97
96
|
"webdriver": "7.30.0",
|
|
98
97
|
"ws": "8.12.0",
|
|
99
98
|
"yargs": "17.6.2"
|
|
@@ -101,11 +100,11 @@
|
|
|
101
100
|
"devDependencies": {
|
|
102
101
|
"@applitools/bongo": "^3.0.1",
|
|
103
102
|
"@applitools/sdk-coverage-tests": "^3.0.0",
|
|
104
|
-
"@applitools/spec-driver-puppeteer": "^1.1.
|
|
105
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
106
|
-
"@applitools/spec-driver-webdriverio": "^1.4.
|
|
107
|
-
"@applitools/test-server": "^1.1.
|
|
108
|
-
"@applitools/test-utils": "^1.5.
|
|
103
|
+
"@applitools/spec-driver-puppeteer": "^1.1.49",
|
|
104
|
+
"@applitools/spec-driver-selenium": "^1.5.34",
|
|
105
|
+
"@applitools/spec-driver-webdriverio": "^1.4.32",
|
|
106
|
+
"@applitools/test-server": "^1.1.28",
|
|
107
|
+
"@applitools/test-utils": "^1.5.14",
|
|
109
108
|
"@types/node": "^12.20.55",
|
|
110
109
|
"@types/selenium-webdriver": "^4.1.2",
|
|
111
110
|
"@types/yargs": "^17.0.22",
|
package/types/ufg/core.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { type NMLClient } from '@applitools/nml-client';
|
|
|
5
5
|
import { type SpecType, type SpecDriver } from '@applitools/driver';
|
|
6
6
|
import { type Logger } from '@applitools/logger';
|
|
7
7
|
type Options<TSpec extends SpecType> = {
|
|
8
|
-
concurrency: number;
|
|
9
8
|
spec?: SpecDriver<TSpec>;
|
|
10
9
|
clients?: {
|
|
11
10
|
ufg?: UFGClient;
|
|
@@ -13,6 +12,7 @@ type Options<TSpec extends SpecType> = {
|
|
|
13
12
|
};
|
|
14
13
|
base?: BaseCore;
|
|
15
14
|
agentId?: string;
|
|
15
|
+
concurrency?: number;
|
|
16
16
|
cwd?: string;
|
|
17
17
|
logger?: Logger;
|
|
18
18
|
};
|
|
@@ -4,9 +4,8 @@ type Options = {
|
|
|
4
4
|
client?: UFGClient;
|
|
5
5
|
logger: Logger;
|
|
6
6
|
};
|
|
7
|
-
export declare function makeGetUFGClient({ client, logger: defaultLogger }: Options): (({ config,
|
|
7
|
+
export declare function makeGetUFGClient({ client, logger: defaultLogger }: Options): (({ config, logger }: {
|
|
8
8
|
config: UFGRequestsConfig;
|
|
9
|
-
concurrency?: number | undefined;
|
|
10
9
|
logger?: Logger | undefined;
|
|
11
10
|
}) => Promise<UFGClient>) & {
|
|
12
11
|
getCachedValues(): Promise<UFGClient>[];
|