@applitools/core 4.38.2 → 4.39.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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.39.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.39.0...js/core@4.39.1) (2025-05-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * saveNewTests=false ([#2988](https://github.com/Applitools-Dev/sdk/issues/2988)) ([ac21a76](https://github.com/Applitools-Dev/sdk/commit/ac21a76f5d10dc358f94522869a8010bb537292e))
9
+
10
+ ## [4.39.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.2...js/core@4.39.0) (2025-05-14)
11
+
12
+
13
+ ### Features
14
+
15
+ * add logging for offline execution startup with system details ([#2971](https://github.com/Applitools-Dev/sdk/issues/2971)) ([82eb5cd](https://github.com/Applitools-Dev/sdk/commit/82eb5cdffe5cf1f88f20e62d50f43600b0a06361))
16
+ * mac arm binary | FLD-3010 ([#2950](https://github.com/Applitools-Dev/sdk/issues/2950)) ([0cb7f59](https://github.com/Applitools-Dev/sdk/commit/0cb7f59b851c746e12b3a8a210a505adf3230903))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * missing resources problem ([#2976](https://github.com/Applitools-Dev/sdk/issues/2976)) ([ab0d217](https://github.com/Applitools-Dev/sdk/commit/ab0d217d23a1df4ad24618a9bf00dc84c57cd8bc))
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * @applitools/core-base bumped to 1.25.3
27
+ #### Performance Improvements
28
+
29
+ * batchify log event ([#2970](https://github.com/Applitools-Dev/sdk/issues/2970)) ([9b1556f](https://github.com/Applitools-Dev/sdk/commit/9b1556f0c9ddc64a52b8b3f928c18e35f6fbbc17))
30
+ * @applitools/ec-client bumped to 1.10.14
31
+
32
+
3
33
  ## [4.38.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.1...js/core@4.38.2) (2025-05-11)
4
34
 
5
35
 
@@ -38,11 +38,20 @@ const utils = __importStar(require("@applitools/utils"));
38
38
  const merge_configs_1 = require("./merge-configs");
39
39
  const format_results_1 = require("../utils/format-results");
40
40
  const throat_1 = __importDefault(require("throat"));
41
+ const os_1 = __importDefault(require("os"));
41
42
  const throttledReadFile = (0, throat_1.default)(Number(process.env.APPLITOOLS_FILE_READING_CONCURRENCY) || 1000, fs_1.default.promises.readFile);
42
43
  function getConsoleLogLimit() {
43
44
  var _a;
44
45
  return (_a = utils.general.getEnvValue('OFFLINE_LOG_LIMIT', 'number')) !== null && _a !== void 0 ? _a : 20;
45
46
  }
47
+ function version() {
48
+ try {
49
+ return JSON.parse(fs_1.default.readFileSync(require.resolve('../../package.json'), 'utf-8')).version;
50
+ }
51
+ catch (e) {
52
+ return 'unknown';
53
+ }
54
+ }
46
55
  async function runOfflineSnapshots(options) {
47
56
  var _a;
48
57
  const limitConsoleLogs = getConsoleLogLimit();
@@ -53,7 +62,7 @@ async function runOfflineSnapshots(options) {
53
62
  const startTime = Date.now();
54
63
  const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (0, logger_1.makeLogger)({ format: { label: 'offline-exec' } });
55
64
  const eyesServerSettings = { ...options.config.open, ...options };
56
- const core = (0, core_1.makeCore)();
65
+ const core = (0, core_1.makeCore)({ agentId: `js/core-offline/${version()}`, logger });
57
66
  const account = await core.getAccountInfo({ settings: eyesServerSettings });
58
67
  const ufgClient = await (0, get_ufg_client_1.makeGetUFGClient)({ logger })({
59
68
  settings: { ...account.eyesServer, ...account.ufgServer },
@@ -61,6 +70,7 @@ async function runOfflineSnapshots(options) {
61
70
  const testFolders = (await fs_1.default.promises.readdir(offlineLocationPath))
62
71
  .filter(filename => filename.startsWith('test-'))
63
72
  .sort();
73
+ void logStartupInfo();
64
74
  if (testFolders.length === 1) {
65
75
  logger.console.log(`Running single test from folder ${offlineLocationPath}`);
66
76
  }
@@ -78,6 +88,7 @@ async function runOfflineSnapshots(options) {
78
88
  testResults: allTestResults,
79
89
  totalTime: Date.now() - startTime,
80
90
  jsonFilePath: options.jsonFilePath,
91
+ saveNewTests: options.config.close.updateBaselineIfNew,
81
92
  });
82
93
  if (!isSuccess.onErrors && options.failOnError) {
83
94
  throw new Error(outputStr);
@@ -260,6 +271,21 @@ async function runOfflineSnapshots(options) {
260
271
  logger: uploadLogger,
261
272
  });
262
273
  });
274
+ resourcePromises.push(ufgClient.uploadResource({
275
+ resource: {
276
+ hash: target.snapshot,
277
+ async getter() {
278
+ return {
279
+ id: '',
280
+ url: '',
281
+ value: await throttledReadFile(path_1.default.join(offlineLocationPath, 'resources', target.snapshot.hash)),
282
+ contentType: target.snapshot.contentType,
283
+ hash: target.snapshot,
284
+ };
285
+ },
286
+ },
287
+ logger: uploadLogger,
288
+ }));
263
289
  return Promise.all(resourcePromises);
264
290
  });
265
291
  await Promise.all(promises);
@@ -349,6 +375,48 @@ async function runOfflineSnapshots(options) {
349
375
  const mergedCheckSettings = (0, merge_configs_1.mergeConfigs)(baseSettings, options.config.check);
350
376
  return { mergedCheckSettings, baseTarget };
351
377
  }
378
+ async function logStartupInfo() {
379
+ await core.logEvent({
380
+ logger,
381
+ settings: {
382
+ ...account.eyesServer,
383
+ ...account.ufgServer,
384
+ level: 'Notice',
385
+ event: {
386
+ type: 'offlineExecutionStart',
387
+ timestamp: new Date().toISOString(),
388
+ offlineLocationPath,
389
+ testCount: testFolders.length,
390
+ ufgServerUrl: account.ufgServer.ufgServerUrl,
391
+ CI: process.env.CI,
392
+ config: options.config,
393
+ driver: {
394
+ platform: os_1.default.platform(),
395
+ version: os_1.default.release(),
396
+ arch: os_1.default.arch(),
397
+ cpu: {
398
+ count: os_1.default.cpus().length,
399
+ avgSpeed: os_1.default.cpus().reduce((acc, cpu) => acc + cpu.speed, 0) / os_1.default.cpus().length,
400
+ model: os_1.default.cpus()[0].model,
401
+ },
402
+ memory: {
403
+ total: os_1.default.totalmem(),
404
+ free: os_1.default.freemem(),
405
+ },
406
+ nodeVersion: process.version,
407
+ versions: await Promise.all(['eyes', 'core', 'core-base', 'ufg-client']
408
+ .map(async (name) => ({
409
+ name,
410
+ version: JSON.parse(await throttledReadFile(require.resolve(`@applitools/${name}/package.json`), {
411
+ encoding: 'utf-8',
412
+ })).version,
413
+ }))
414
+ .map(promise => promise.catch(e => `failed to get version: ${e}`))),
415
+ },
416
+ },
417
+ },
418
+ });
419
+ }
352
420
  }
353
421
  exports.runOfflineSnapshots = runOfflineSnapshots;
354
422
  function uniq(arr) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.38.2",
3
+ "version": "4.39.1",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -71,15 +71,16 @@
71
71
  "node20-linux-x64-musl": "./bin/core-alpine",
72
72
  "node20-linux-arm64": "./bin/core-linux-arm64",
73
73
  "node20-darwin-x64": "./bin/core-macos",
74
- "node20-win-x64": "./bin/core-win.exe"
74
+ "node20-win-x64": "./bin/core-win.exe",
75
+ "node20-darwin-arm64": "./bin/core-macos-arm64"
75
76
  }
76
77
  },
77
78
  "dependencies": {
78
- "@applitools/core-base": "1.25.2",
79
+ "@applitools/core-base": "1.25.3",
79
80
  "@applitools/dom-capture": "11.5.5",
80
81
  "@applitools/dom-snapshot": "4.11.21",
81
82
  "@applitools/driver": "1.21.4",
82
- "@applitools/ec-client": "1.10.13",
83
+ "@applitools/ec-client": "1.10.14",
83
84
  "@applitools/logger": "2.1.4",
84
85
  "@applitools/nml-client": "1.9.4",
85
86
  "@applitools/req": "1.7.12",
@@ -113,6 +114,7 @@
113
114
  "@types/semver": "^7.5.8",
114
115
  "@types/yargs": "^17.0.22",
115
116
  "chromedriver": "^131.0.5",
117
+ "crypto": "^1.0.1",
116
118
  "nock": "^13.3.2",
117
119
  "png-async": "^0.9.4",
118
120
  "puppeteer": "^19.11.1",