@applitools/core 4.38.1 → 4.38.2
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 +61 -0
- package/dist/offline/run-offline-snapshots.js +47 -39
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.38.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.1...js/core@4.38.2) (2025-05-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* don't kill offline exectuion when one render fails | AD-9892 ([#2962](https://github.com/Applitools-Dev/sdk/issues/2962)) ([add5c43](https://github.com/Applitools-Dev/sdk/commit/add5c43892206dfaa5bf434c45e22a467fa20266))
|
|
9
|
+
* remove redundant file readings and added rendering concurrency limit ([#2956](https://github.com/Applitools-Dev/sdk/issues/2956)) ([b970180](https://github.com/Applitools-Dev/sdk/commit/b97018010fdf12cb0d202192b22f643c16c569d5))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Performance Improvements
|
|
13
|
+
|
|
14
|
+
* avoid retry when x-applitools-dont-retry header is presented | AD-9834 ([#2959](https://github.com/Applitools-Dev/sdk/issues/2959)) ([492dff6](https://github.com/Applitools-Dev/sdk/commit/492dff6ca431e242eb85a2c87d429f8676490e1a))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
|
|
19
|
+
* @applitools/utils bumped to 1.8.2
|
|
20
|
+
#### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* remove redundant file readings and added rendering concurrency limit ([#2956](https://github.com/Applitools-Dev/sdk/issues/2956)) ([b970180](https://github.com/Applitools-Dev/sdk/commit/b97018010fdf12cb0d202192b22f643c16c569d5))
|
|
23
|
+
* @applitools/ufg-client bumped to 1.16.11
|
|
24
|
+
#### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* remove redundant file readings and added rendering concurrency limit ([#2956](https://github.com/Applitools-Dev/sdk/issues/2956)) ([b970180](https://github.com/Applitools-Dev/sdk/commit/b97018010fdf12cb0d202192b22f643c16c569d5))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
* @applitools/logger bumped to 2.1.4
|
|
31
|
+
|
|
32
|
+
* @applitools/dom-snapshot bumped to 4.11.21
|
|
33
|
+
|
|
34
|
+
* @applitools/socket bumped to 1.2.5
|
|
35
|
+
|
|
36
|
+
* @applitools/req bumped to 1.7.12
|
|
37
|
+
|
|
38
|
+
* @applitools/image bumped to 1.1.20
|
|
39
|
+
|
|
40
|
+
* @applitools/driver bumped to 1.21.4
|
|
41
|
+
|
|
42
|
+
* @applitools/spec-driver-webdriver bumped to 1.2.5
|
|
43
|
+
|
|
44
|
+
* @applitools/spec-driver-selenium bumped to 1.5.101
|
|
45
|
+
|
|
46
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.30
|
|
47
|
+
|
|
48
|
+
* @applitools/screenshoter bumped to 3.11.4
|
|
49
|
+
|
|
50
|
+
* @applitools/nml-client bumped to 1.9.4
|
|
51
|
+
|
|
52
|
+
* @applitools/tunnel-client bumped to 1.6.7
|
|
53
|
+
|
|
54
|
+
* @applitools/core-base bumped to 1.25.2
|
|
55
|
+
#### Performance Improvements
|
|
56
|
+
|
|
57
|
+
* avoid retry when x-applitools-dont-retry header is presented | AD-9834 ([#2959](https://github.com/Applitools-Dev/sdk/issues/2959)) ([492dff6](https://github.com/Applitools-Dev/sdk/commit/492dff6ca431e242eb85a2c87d429f8676490e1a))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
* @applitools/ec-client bumped to 1.10.13
|
|
62
|
+
|
|
63
|
+
|
|
3
64
|
## [4.38.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.0...js/core@4.38.1) (2025-05-07)
|
|
4
65
|
|
|
5
66
|
|
|
@@ -46,6 +46,7 @@ function getConsoleLogLimit() {
|
|
|
46
46
|
async function runOfflineSnapshots(options) {
|
|
47
47
|
var _a;
|
|
48
48
|
const limitConsoleLogs = getConsoleLogLimit();
|
|
49
|
+
const throttledRender = (0, throat_1.default)(Number(process.env.APPLITOOLS_RENDER_CONCURRENCY) || 1000, render);
|
|
49
50
|
if (!options.offlineLocationPath)
|
|
50
51
|
throw new Error('offlineLocationPath is required');
|
|
51
52
|
const offlineLocationPath = path_1.default.resolve(options.offlineLocationPath);
|
|
@@ -135,36 +136,53 @@ async function runOfflineSnapshots(options) {
|
|
|
135
136
|
const uploadResourcePromise = uploadResources(targets, logger).then(() => logger.log('uploaded resources for test', testPath));
|
|
136
137
|
if (targets.length === 1) {
|
|
137
138
|
logger.log('only one check found for test', testPath);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
try {
|
|
140
|
+
await uploadResourcePromise;
|
|
141
|
+
const target = targets[0];
|
|
142
|
+
resultsGetter = await runOpenCheckAndClose({
|
|
143
|
+
...target,
|
|
144
|
+
settings: {
|
|
145
|
+
...(0, merge_configs_1.mergeConfigs)((0, merge_configs_1.mergeConfigs)(closeSettings, openSettings), target.settings),
|
|
146
|
+
...account.eyesServer,
|
|
147
|
+
environment: {
|
|
148
|
+
...openSettings.environment,
|
|
149
|
+
...target.settings.environment,
|
|
150
|
+
},
|
|
148
151
|
},
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
}, logger, environment);
|
|
153
|
+
logger.log('finished running checks for test', testPath);
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
logger.log('error running checks for test', testPath, err);
|
|
157
|
+
resultsGetter = await makeAbortedTest(openSettings, environment, logger, err);
|
|
158
|
+
}
|
|
152
159
|
}
|
|
153
160
|
else {
|
|
154
161
|
const eyes = await openEyes(openSettings, environment, logger);
|
|
155
162
|
logger.log('opened eyes for test', testPath);
|
|
156
|
-
await uploadResourcePromise;
|
|
157
163
|
const lastTarget = targets.pop();
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
try {
|
|
165
|
+
await uploadResourcePromise;
|
|
166
|
+
await Promise.all(targets.map((target, index) => runCheck(eyes, target, index, logger)));
|
|
167
|
+
if (lastTarget) {
|
|
168
|
+
lastTarget.settings = (0, merge_configs_1.mergeConfigs)(lastTarget.settings, closeSettings);
|
|
169
|
+
await runCheckAndClose(eyes, lastTarget, targets.length - 1, logger);
|
|
170
|
+
logger.log('finished running checks for test', testPath);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
logger.log('no checks found for test', testPath);
|
|
174
|
+
// on empty test, `checkAndClose` will not be called so we need to call `close` instead
|
|
175
|
+
await eyes.close({ settings: closeSettings });
|
|
176
|
+
}
|
|
163
177
|
}
|
|
164
|
-
|
|
165
|
-
logger.log('
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
catch (err) {
|
|
179
|
+
logger.log('error running checks for test', testPath, err);
|
|
180
|
+
await eyes.abort({
|
|
181
|
+
logger,
|
|
182
|
+
settings: {
|
|
183
|
+
reason: err,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
168
186
|
}
|
|
169
187
|
resultsGetter = eyes;
|
|
170
188
|
}
|
|
@@ -197,11 +215,11 @@ async function runOfflineSnapshots(options) {
|
|
|
197
215
|
}));
|
|
198
216
|
return targets;
|
|
199
217
|
}
|
|
200
|
-
async function makeAbortedTest(openSettings, environment, logger) {
|
|
218
|
+
async function makeAbortedTest(openSettings, environment, logger, reason = 'internal') {
|
|
201
219
|
const eyes = await openEyes(openSettings, environment, logger);
|
|
202
220
|
await eyes.abort({
|
|
203
221
|
settings: {
|
|
204
|
-
reason
|
|
222
|
+
reason,
|
|
205
223
|
},
|
|
206
224
|
});
|
|
207
225
|
return eyes;
|
|
@@ -223,7 +241,7 @@ async function runOfflineSnapshots(options) {
|
|
|
223
241
|
async function uploadResources(targets, logger) {
|
|
224
242
|
const uploadLogger = logger.extend({ tags: ['upload-resources'] });
|
|
225
243
|
const promises = targets.map(async ({ target }) => {
|
|
226
|
-
|
|
244
|
+
const resourcePromises = Object.values(target.resources)
|
|
227
245
|
.filter(isHashedResource)
|
|
228
246
|
.map(async (resource) => {
|
|
229
247
|
return ufgClient.uploadResource({
|
|
@@ -242,16 +260,6 @@ async function runOfflineSnapshots(options) {
|
|
|
242
260
|
logger: uploadLogger,
|
|
243
261
|
});
|
|
244
262
|
});
|
|
245
|
-
resourcePromises = resourcePromises.concat(ufgClient.uploadResource({
|
|
246
|
-
resource: {
|
|
247
|
-
id: '',
|
|
248
|
-
url: '',
|
|
249
|
-
value: await throttledReadFile(path_1.default.join(offlineLocationPath, 'resources', target.snapshot.hash)),
|
|
250
|
-
contentType: target.snapshot.contentType,
|
|
251
|
-
hash: target.snapshot,
|
|
252
|
-
},
|
|
253
|
-
logger: uploadLogger,
|
|
254
|
-
}));
|
|
255
263
|
return Promise.all(resourcePromises);
|
|
256
264
|
});
|
|
257
265
|
await Promise.all(promises);
|
|
@@ -262,7 +270,7 @@ async function runOfflineSnapshots(options) {
|
|
|
262
270
|
async function runCheck(eyes, target, index, logger) {
|
|
263
271
|
var _a;
|
|
264
272
|
const checkLogger = logger.extend({ tags: [`check-${index}`] });
|
|
265
|
-
const { mergedCheckSettings, baseTarget } = await
|
|
273
|
+
const { mergedCheckSettings, baseTarget } = await throttledRender(target, checkLogger);
|
|
266
274
|
(_a = mergedCheckSettings.stepIndex) !== null && _a !== void 0 ? _a : (mergedCheckSettings.stepIndex = index);
|
|
267
275
|
await eyes.check({
|
|
268
276
|
target: { ...baseTarget, isTransformed: true },
|
|
@@ -275,7 +283,7 @@ async function runOfflineSnapshots(options) {
|
|
|
275
283
|
async function runCheckAndClose(eyes, target, index, logger) {
|
|
276
284
|
var _a;
|
|
277
285
|
const checkLogger = logger.extend({ tags: [`check-${index}`] });
|
|
278
|
-
const { mergedCheckSettings, baseTarget } = await
|
|
286
|
+
const { mergedCheckSettings, baseTarget } = await throttledRender(target, checkLogger);
|
|
279
287
|
(_a = mergedCheckSettings.stepIndex) !== null && _a !== void 0 ? _a : (mergedCheckSettings.stepIndex = index);
|
|
280
288
|
await eyes.checkAndClose({
|
|
281
289
|
target: { ...baseTarget, isTransformed: true },
|
|
@@ -287,7 +295,7 @@ async function runOfflineSnapshots(options) {
|
|
|
287
295
|
}
|
|
288
296
|
async function runOpenCheckAndClose(target, logger, actualEnvironment) {
|
|
289
297
|
const checkLogger = logger.extend({ tags: ['open-check-and-close'] });
|
|
290
|
-
const { mergedCheckSettings, baseTarget } = await
|
|
298
|
+
const { mergedCheckSettings, baseTarget } = await throttledRender(target, checkLogger);
|
|
291
299
|
const settings = (0, merge_configs_1.mergeConfigs)(target.settings, mergedCheckSettings);
|
|
292
300
|
return core.base.openCheckAndCloseEyes({
|
|
293
301
|
target: { ...baseTarget, isTransformed: true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.38.
|
|
3
|
+
"version": "4.38.2",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -75,20 +75,20 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@applitools/core-base": "1.25.
|
|
78
|
+
"@applitools/core-base": "1.25.2",
|
|
79
79
|
"@applitools/dom-capture": "11.5.5",
|
|
80
|
-
"@applitools/dom-snapshot": "4.11.
|
|
81
|
-
"@applitools/driver": "1.21.
|
|
82
|
-
"@applitools/ec-client": "1.10.
|
|
83
|
-
"@applitools/logger": "2.1.
|
|
84
|
-
"@applitools/nml-client": "1.9.
|
|
85
|
-
"@applitools/req": "1.7.
|
|
86
|
-
"@applitools/screenshoter": "3.11.
|
|
80
|
+
"@applitools/dom-snapshot": "4.11.21",
|
|
81
|
+
"@applitools/driver": "1.21.4",
|
|
82
|
+
"@applitools/ec-client": "1.10.13",
|
|
83
|
+
"@applitools/logger": "2.1.4",
|
|
84
|
+
"@applitools/nml-client": "1.9.4",
|
|
85
|
+
"@applitools/req": "1.7.12",
|
|
86
|
+
"@applitools/screenshoter": "3.11.4",
|
|
87
87
|
"@applitools/snippets": "2.6.5",
|
|
88
|
-
"@applitools/socket": "1.2.
|
|
89
|
-
"@applitools/spec-driver-webdriver": "1.2.
|
|
90
|
-
"@applitools/ufg-client": "1.16.
|
|
91
|
-
"@applitools/utils": "1.8.
|
|
88
|
+
"@applitools/socket": "1.2.5",
|
|
89
|
+
"@applitools/spec-driver-webdriver": "1.2.5",
|
|
90
|
+
"@applitools/ufg-client": "1.16.11",
|
|
91
|
+
"@applitools/utils": "1.8.2",
|
|
92
92
|
"@types/ws": "8.5.5",
|
|
93
93
|
"abort-controller": "3.0.0",
|
|
94
94
|
"chalk": "4.1.2",
|
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@applitools/bongo": "^5.10.0",
|
|
104
104
|
"@applitools/sea": "^1.0.0",
|
|
105
|
-
"@applitools/spec-driver-puppeteer": "^1.4.
|
|
106
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
105
|
+
"@applitools/spec-driver-puppeteer": "^1.4.30",
|
|
106
|
+
"@applitools/spec-driver-selenium": "^1.5.101",
|
|
107
107
|
"@applitools/test-server": "^1.2.2",
|
|
108
108
|
"@applitools/test-utils": "^1.5.17",
|
|
109
|
-
"@applitools/tunnel-client": "^1.6.
|
|
109
|
+
"@applitools/tunnel-client": "^1.6.7",
|
|
110
110
|
"@types/mocha": "^10.0.7",
|
|
111
111
|
"@types/node": "^12.20.55",
|
|
112
112
|
"@types/selenium-webdriver": "^4.1.2",
|