@applitools/core 4.20.1 → 4.20.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 +35 -0
- package/dist/cli/cli.js +5 -0
- package/dist/core.js +2 -2
- package/dist/run-offline-snapshots.js +7 -7
- package/dist/ufg/get-ufg-client.js +1 -1
- package/package.json +10 -10
- package/types/run-offline-snapshots.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.20.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.20.1...js/core@4.20.2) (2024-10-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* cache key for offline execution ([#2552](https://github.com/Applitools-Dev/sdk/issues/2552)) ([d0d1138](https://github.com/Applitools-Dev/sdk/commit/d0d11386be0f82c9e59e753bd0dc97aa3b05d93e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/driver bumped to 1.19.2
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* cache key for offline execution ([#2552](https://github.com/Applitools-Dev/sdk/issues/2552)) ([d0d1138](https://github.com/Applitools-Dev/sdk/commit/d0d11386be0f82c9e59e753bd0dc97aa3b05d93e))
|
|
17
|
+
* @applitools/spec-driver-selenium bumped to 1.5.85
|
|
18
|
+
|
|
19
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.14
|
|
20
|
+
|
|
21
|
+
* @applitools/ufg-client bumped to 1.13.1
|
|
22
|
+
#### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* cache key for offline execution ([#2552](https://github.com/Applitools-Dev/sdk/issues/2552)) ([d0d1138](https://github.com/Applitools-Dev/sdk/commit/d0d11386be0f82c9e59e753bd0dc97aa3b05d93e))
|
|
25
|
+
* @applitools/spec-driver-webdriver bumped to 1.1.14
|
|
26
|
+
|
|
27
|
+
* @applitools/screenshoter bumped to 3.8.38
|
|
28
|
+
|
|
29
|
+
* @applitools/nml-client bumped to 1.8.12
|
|
30
|
+
|
|
31
|
+
* @applitools/core-base bumped to 1.17.2
|
|
32
|
+
#### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* cache key for offline execution ([#2552](https://github.com/Applitools-Dev/sdk/issues/2552)) ([d0d1138](https://github.com/Applitools-Dev/sdk/commit/d0d11386be0f82c9e59e753bd0dc97aa3b05d93e))
|
|
35
|
+
* @applitools/ec-client bumped to 1.9.8
|
|
36
|
+
|
|
37
|
+
|
|
3
38
|
## [4.20.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.20.0...js/core@4.20.1) (2024-10-01)
|
|
4
39
|
|
|
5
40
|
|
package/dist/cli/cli.js
CHANGED
|
@@ -161,6 +161,11 @@ yargs_1.default
|
|
|
161
161
|
description: 'path to offline snapshots folder',
|
|
162
162
|
type: 'string',
|
|
163
163
|
},
|
|
164
|
+
failOnDiff: {
|
|
165
|
+
description: 'should exit process with non-zero exit code, thereby failing the CI job',
|
|
166
|
+
type: 'boolean',
|
|
167
|
+
default: false,
|
|
168
|
+
},
|
|
164
169
|
})
|
|
165
170
|
.fail((_msg, err, _yargs) => {
|
|
166
171
|
if (err) {
|
package/dist/core.js
CHANGED
|
@@ -49,10 +49,10 @@ function makeCore({ spec, clients, base: defaultBase, concurrency = utils.genera
|
|
|
49
49
|
const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core' } });
|
|
50
50
|
(0, memory_usage_logging_1.startMemoryUsageLogging)({ logger });
|
|
51
51
|
const environment = (0, extract_test_environment_1.extractTestEnvironment)(defaultEnvironment);
|
|
52
|
-
|
|
52
|
+
const offlineLocationPath = (0, ensure_offline_folder_1.ensureOfflineFolder)();
|
|
53
|
+
logger.log(`[pid=${process.pid} Core is initialized ${defaultBase ? 'with' : 'without'} custom base core ${offlineLocationPath ? `and offline location ${offlineLocationPath} ` : ''}and environment `, environment);
|
|
53
54
|
if (environment.sdk)
|
|
54
55
|
(0, validate_sdk_version_1.validateSdkVersion)(environment.sdk, { logger });
|
|
55
|
-
const offlineLocationPath = (0, ensure_offline_folder_1.ensureOfflineFolder)();
|
|
56
56
|
const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, cwd, logger, offlineLocationPath });
|
|
57
57
|
const cores = {
|
|
58
58
|
ufg: (0, core_2.makeCore)({ spec, clients, base, asyncCache, logger, offlineLocationPath }),
|
|
@@ -59,8 +59,8 @@ async function runOfflineSnapshots(options) {
|
|
|
59
59
|
throw new Error(`Unable to find offline executions in ${options.offlineLocationPath}`);
|
|
60
60
|
}
|
|
61
61
|
const allTestResults = (await Promise.all(executionFolders.map(runExecution))).flat();
|
|
62
|
-
const {
|
|
63
|
-
if (
|
|
62
|
+
const { isSuccess, outputStr } = processResults({ testResults: allTestResults, totalTime: Date.now() - startTime });
|
|
63
|
+
if (!isSuccess && options.failOnDiff) {
|
|
64
64
|
throw new Error(outputStr);
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
@@ -272,19 +272,19 @@ function processResults({ testResults, totalTime, saveNewTests = true, failOnDif
|
|
|
272
272
|
// if (Number(testConcurrency) === 5) {
|
|
273
273
|
// outputStr += `\n${concurrencyMsg}\n`
|
|
274
274
|
// }
|
|
275
|
-
let
|
|
275
|
+
let isSuccess;
|
|
276
276
|
if (errors.length) {
|
|
277
|
-
|
|
277
|
+
isSuccess = false;
|
|
278
278
|
}
|
|
279
279
|
else if (failOnDiff) {
|
|
280
|
-
|
|
280
|
+
isSuccess = !warnForUnsavedNewTests && passedOrNew.length && !unresolvedOrFailed.length;
|
|
281
281
|
}
|
|
282
282
|
else {
|
|
283
|
-
|
|
283
|
+
isSuccess = true;
|
|
284
284
|
}
|
|
285
285
|
return {
|
|
286
286
|
outputStr,
|
|
287
|
-
|
|
287
|
+
isSuccess,
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
function testResultsOutput(results, warnForUnsavedNewTests) {
|
|
@@ -29,7 +29,7 @@ const utils = __importStar(require("@applitools/utils"));
|
|
|
29
29
|
function makeGetUFGClient({ client, fetchConcurrency, offlineLocationPath, logger: mainLogger, asyncCache, }) {
|
|
30
30
|
// we are caching by the server config, therefor if the user creates another Runner / manager with the same server config but different
|
|
31
31
|
// fetchConcurrency, it will not take any affect.
|
|
32
|
-
const getUFGClientWithCache = utils.general.cachify(getUFGClient, ([options]) => client ? 'default' : [{ ...options.settings, fetchConcurrency: undefined }]);
|
|
32
|
+
const getUFGClientWithCache = utils.general.cachify(getUFGClient, ([options]) => client ? 'default' : [{ ...options.settings, fetchConcurrency: undefined, offlineLocationPath }]);
|
|
33
33
|
if (client)
|
|
34
34
|
getUFGClientWithCache.setCachedValue('default', Promise.resolve(client));
|
|
35
35
|
return getUFGClientWithCache;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.2",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -74,19 +74,19 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@applitools/core-base": "1.17.
|
|
77
|
+
"@applitools/core-base": "1.17.2",
|
|
78
78
|
"@applitools/dom-capture": "11.5.0",
|
|
79
79
|
"@applitools/dom-snapshot": "4.11.3",
|
|
80
|
-
"@applitools/driver": "1.19.
|
|
81
|
-
"@applitools/ec-client": "1.9.
|
|
80
|
+
"@applitools/driver": "1.19.2",
|
|
81
|
+
"@applitools/ec-client": "1.9.8",
|
|
82
82
|
"@applitools/logger": "2.0.18",
|
|
83
|
-
"@applitools/nml-client": "1.8.
|
|
83
|
+
"@applitools/nml-client": "1.8.12",
|
|
84
84
|
"@applitools/req": "1.7.2",
|
|
85
|
-
"@applitools/screenshoter": "3.8.
|
|
85
|
+
"@applitools/screenshoter": "3.8.38",
|
|
86
86
|
"@applitools/snippets": "2.5.0",
|
|
87
87
|
"@applitools/socket": "1.1.18",
|
|
88
|
-
"@applitools/spec-driver-webdriver": "1.1.
|
|
89
|
-
"@applitools/ufg-client": "1.13.
|
|
88
|
+
"@applitools/spec-driver-webdriver": "1.1.14",
|
|
89
|
+
"@applitools/ufg-client": "1.13.1",
|
|
90
90
|
"@applitools/utils": "1.7.4",
|
|
91
91
|
"@types/ws": "8.5.5",
|
|
92
92
|
"abort-controller": "3.0.0",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@applitools/bongo": "^5.10.0",
|
|
102
102
|
"@applitools/sea": "^1.0.0",
|
|
103
|
-
"@applitools/spec-driver-puppeteer": "^1.4.
|
|
104
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
103
|
+
"@applitools/spec-driver-puppeteer": "^1.4.14",
|
|
104
|
+
"@applitools/spec-driver-selenium": "^1.5.85",
|
|
105
105
|
"@applitools/test-server": "^1.2.2",
|
|
106
106
|
"@applitools/test-utils": "^1.5.17",
|
|
107
107
|
"@applitools/tunnel-client": "^1.5.8",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type EyesServerSettings } from './types';
|
|
2
2
|
export type OfflineSnapshotsSettings = EyesServerSettings & {
|
|
3
3
|
offlineLocationPath: string;
|
|
4
|
+
failOnDiff: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare function runOfflineSnapshots(options: OfflineSnapshotsSettings): Promise<void>;
|