@applitools/core 4.32.0 → 4.32.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.32.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.32.1...js/core@4.32.2) (2025-03-06)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add environment variable aliases (_NAME suffix) ([#2791](https://github.com/Applitools-Dev/sdk/issues/2791)) ([67501a4](https://github.com/Applitools-Dev/sdk/commit/67501a4f5491319ca62949a56ee03face08a59e5))
9
+ * support test concurrency in offline mode ([#2831](https://github.com/Applitools-Dev/sdk/issues/2831)) ([3b7d137](https://github.com/Applitools-Dev/sdk/commit/3b7d137a9b34bb5c564e0a5c7d3fb2520ef8a167))
10
+
11
+ ## [4.32.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.32.0...js/core@4.32.1) (2025-03-04)
12
+
13
+
14
+ ### Dependencies
15
+
16
+ * @applitools/ufg-client bumped to 1.16.7
17
+ #### Bug Fixes
18
+
19
+ * handle failure for large body in render request ([a4d2c1a](https://github.com/Applitools-Dev/sdk/commit/a4d2c1a408c8ed31ecd5446415dc8af04eb7b688))
20
+ * trigger release ([#2829](https://github.com/Applitools-Dev/sdk/issues/2829)) ([c9ea327](https://github.com/Applitools-Dev/sdk/commit/c9ea327c806163e23031be7c0b5b40bf02dbebc3))
21
+
3
22
  ## [4.32.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.31.4...js/core@4.32.0) (2025-03-04)
4
23
 
5
24
 
@@ -37,6 +37,7 @@ const chalk_1 = __importDefault(require("chalk"));
37
37
  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
+ const throat_1 = __importDefault(require("throat"));
40
41
  function getConsoleLogLimit() {
41
42
  var _a;
42
43
  return (_a = utils.general.getEnvValue('OFFLINE_LOG_LIMIT', 'number')) !== null && _a !== void 0 ? _a : 20;
@@ -104,8 +105,10 @@ async function runOfflineSnapshots(options) {
104
105
  else {
105
106
  logger.console.log(messages.join('\n'));
106
107
  }
108
+ const testConcurrency = utils.general.getEnvValue('TEST_CONCURRENCY', 'number');
109
+ const runTestThrottled = testConcurrency ? (0, throat_1.default)(testConcurrency, runTest) : runTest;
107
110
  const results = await Promise.all(preparedTests.map(async ({ testPath, openSettings, testLogger }) => {
108
- return runTest(testPath, openSettings, testLogger);
111
+ return runTestThrottled(testPath, openSettings, testLogger);
109
112
  }));
110
113
  const batchIds = [...new Set(results.map(t => t.batchId))];
111
114
  const allTestResults = results.map(t => t.results);
package/dist/open-eyes.js CHANGED
@@ -39,8 +39,8 @@ const core_base_1 = require("@applitools/core-base");
39
39
  const extract_git_info_1 = require("./utils/extract-git-info");
40
40
  function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDuplicateTests, core, cores, spec, environment, logger: mainLogger, asyncCache, cwd = process.cwd(), }) {
41
41
  return async function openEyes({ type = defaultType, settings: openSettings, config, target, logger = mainLogger, }) {
42
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
43
- var _z, _0, _1, _2, _3;
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
43
+ var _2, _3, _4, _5, _6;
44
44
  logger = logger.extend(mainLogger, { tags: [`eyes-${type}-${utils.general.shortid()}`] });
45
45
  const settings = { environments: config === null || config === void 0 ? void 0 : config.check.environments, ...config === null || config === void 0 ? void 0 : config.open, ...openSettings };
46
46
  const eyesServerSettings = (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
@@ -48,22 +48,22 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
48
48
  logger.mask(eyesServerSettings.eyesServerUrl);
49
49
  (_a = settings.userTestId) !== null && _a !== void 0 ? _a : (settings.userTestId = `${settings.testName}--${utils.general.guid()}`);
50
50
  settings.batch = { ...batch, ...settings.batch };
51
- (_b = (_z = settings.batch).id) !== null && _b !== void 0 ? _b : (_z.id = (_c = utils.general.getEnvValue('BATCH_ID')) !== null && _c !== void 0 ? _c : `generated-${utils.general.guid()}`);
52
- (_d = (_0 = settings.batch).buildId) !== null && _d !== void 0 ? _d : (_0.buildId = utils.general.getEnvValue('BATCH_BUILD_ID'));
53
- (_e = (_1 = settings.batch).name) !== null && _e !== void 0 ? _e : (_1.name = utils.general.getEnvValue('BATCH_NAME'));
54
- (_f = (_2 = settings.batch).sequenceName) !== null && _f !== void 0 ? _f : (_2.sequenceName = utils.general.getEnvValue('BATCH_SEQUENCE'));
55
- (_g = (_3 = settings.batch).notifyOnCompletion) !== null && _g !== void 0 ? _g : (_3.notifyOnCompletion = utils.general.getEnvValue('BATCH_NOTIFY', 'boolean'));
51
+ (_b = (_2 = settings.batch).id) !== null && _b !== void 0 ? _b : (_2.id = (_c = utils.general.getEnvValue('BATCH_ID')) !== null && _c !== void 0 ? _c : `generated-${utils.general.guid()}`);
52
+ (_d = (_3 = settings.batch).buildId) !== null && _d !== void 0 ? _d : (_3.buildId = utils.general.getEnvValue('BATCH_BUILD_ID'));
53
+ (_e = (_4 = settings.batch).name) !== null && _e !== void 0 ? _e : (_4.name = utils.general.getEnvValue('BATCH_NAME'));
54
+ (_f = (_5 = settings.batch).sequenceName) !== null && _f !== void 0 ? _f : (_5.sequenceName = utils.general.getEnvValue('BATCH_SEQUENCE'));
55
+ (_g = (_6 = settings.batch).notifyOnCompletion) !== null && _g !== void 0 ? _g : (_6.notifyOnCompletion = utils.general.getEnvValue('BATCH_NOTIFY', 'boolean'));
56
56
  (_h = settings.keepBatchOpen) !== null && _h !== void 0 ? _h : (settings.keepBatchOpen = utils.general.getEnvValue('DONT_CLOSE_BATCHES', 'boolean'));
57
- (_j = settings.branchName) !== null && _j !== void 0 ? _j : (settings.branchName = utils.general.getEnvValue('BRANCH'));
58
- (_k = settings.parentBranchName) !== null && _k !== void 0 ? _k : (settings.parentBranchName = utils.general.getEnvValue('PARENT_BRANCH'));
59
- (_l = settings.baselineBranchName) !== null && _l !== void 0 ? _l : (settings.baselineBranchName = utils.general.getEnvValue('BASELINE_BRANCH'));
60
- (_m = settings.gitBranchingTimestamp) !== null && _m !== void 0 ? _m : (settings.gitBranchingTimestamp = utils.general.getEnvValue('GIT_MERGE_BASE_TIMESTAMP'));
61
- (_o = settings.latestCommitInfo) !== null && _o !== void 0 ? _o : (settings.latestCommitInfo = getLatestCommitInfoFromEnvVars(logger));
62
- (_p = settings.ufgServerUrl) !== null && _p !== void 0 ? _p : (settings.ufgServerUrl = utils.general.getEnvValue('UFG_SERVER_URL'));
63
- (_q = settings.ignoreBaseline) !== null && _q !== void 0 ? _q : (settings.ignoreBaseline = false);
64
- (_r = settings.compareWithParentBranch) !== null && _r !== void 0 ? _r : (settings.compareWithParentBranch = false);
65
- (_s = settings.removeDuplicateTests) !== null && _s !== void 0 ? _s : (settings.removeDuplicateTests = removeDuplicateTests);
66
- (_t = settings.latestCommitInfo) !== null && _t !== void 0 ? _t : (settings.latestCommitInfo = await (0, extract_git_info_1.extractLatestCommitInfo)({ execOptions: { cwd }, logger }));
57
+ (_j = settings.branchName) !== null && _j !== void 0 ? _j : (settings.branchName = (_k = utils.general.getEnvValue('BRANCH')) !== null && _k !== void 0 ? _k : utils.general.getEnvValue('BRANCH_NAME'));
58
+ (_l = settings.parentBranchName) !== null && _l !== void 0 ? _l : (settings.parentBranchName = (_m = utils.general.getEnvValue('PARENT_BRANCH')) !== null && _m !== void 0 ? _m : utils.general.getEnvValue('PARENT_BRANCH_NAME'));
59
+ (_o = settings.baselineBranchName) !== null && _o !== void 0 ? _o : (settings.baselineBranchName = (_p = utils.general.getEnvValue('BASELINE_BRANCH')) !== null && _p !== void 0 ? _p : utils.general.getEnvValue('BASELINE_BRANCH_NAME'));
60
+ (_q = settings.gitBranchingTimestamp) !== null && _q !== void 0 ? _q : (settings.gitBranchingTimestamp = utils.general.getEnvValue('GIT_MERGE_BASE_TIMESTAMP'));
61
+ (_r = settings.latestCommitInfo) !== null && _r !== void 0 ? _r : (settings.latestCommitInfo = getLatestCommitInfoFromEnvVars(logger));
62
+ (_s = settings.ufgServerUrl) !== null && _s !== void 0 ? _s : (settings.ufgServerUrl = utils.general.getEnvValue('UFG_SERVER_URL'));
63
+ (_t = settings.ignoreBaseline) !== null && _t !== void 0 ? _t : (settings.ignoreBaseline = false);
64
+ (_u = settings.compareWithParentBranch) !== null && _u !== void 0 ? _u : (settings.compareWithParentBranch = false);
65
+ (_v = settings.removeDuplicateTests) !== null && _v !== void 0 ? _v : (settings.removeDuplicateTests = removeDuplicateTests);
66
+ (_w = settings.latestCommitInfo) !== null && _w !== void 0 ? _w : (settings.latestCommitInfo = await (0, extract_git_info_1.extractLatestCommitInfo)({ execOptions: { cwd }, logger }));
67
67
  if (settings.latestCommitInfo && !(0, extract_git_info_1.isISODate)(settings.latestCommitInfo.timestamp)) {
68
68
  logger.warn(`latestCommitInfo.timestamp is an invalid ISO date string: ${settings.latestCommitInfo.timestamp}`);
69
69
  settings.latestCommitInfo = undefined;
@@ -93,11 +93,11 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
93
93
  const driverEnvironment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
94
94
  const driverUrl = await (driver === null || driver === void 0 ? void 0 : driver.getDriverUrl());
95
95
  const multiDeviceTargets = [];
96
- for (const checkEnv of (_u = settings.environments) !== null && _u !== void 0 ? _u : []) {
97
- if (utils.types.has(checkEnv, 'iosDeviceInfo') && ((_v = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _v === void 0 ? void 0 : _v.instrumented)) {
96
+ for (const checkEnv of (_x = settings.environments) !== null && _x !== void 0 ? _x : []) {
97
+ if (utils.types.has(checkEnv, 'iosDeviceInfo') && ((_y = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _y === void 0 ? void 0 : _y.instrumented)) {
98
98
  multiDeviceTargets.push({
99
99
  deviceInfo: checkEnv.iosDeviceInfo.deviceName,
100
- orientation: (_w = checkEnv.iosDeviceInfo.screenOrientation) !== null && _w !== void 0 ? _w : 'portrait',
100
+ orientation: (_z = checkEnv.iosDeviceInfo.screenOrientation) !== null && _z !== void 0 ? _z : 'portrait',
101
101
  });
102
102
  }
103
103
  }
@@ -108,7 +108,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
108
108
  event: {
109
109
  type: 'openEyes',
110
110
  userTestId: settings.userTestId,
111
- concurrency: (_x = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _x !== void 0 ? _x : core.concurrency,
111
+ concurrency: (_0 = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _0 !== void 0 ? _0 : core.concurrency,
112
112
  environment,
113
113
  driver: {
114
114
  deviceName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.deviceName,
@@ -116,7 +116,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
116
116
  browserVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.browserVersion,
117
117
  platformName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformName,
118
118
  platformVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformVersion,
119
- isApplitoolsLib: (_y = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _y === void 0 ? void 0 : _y.instrumented,
119
+ isApplitoolsLib: (_1 = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _1 === void 0 ? void 0 : _1.instrumented,
120
120
  isEC: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.isEC,
121
121
  },
122
122
  driverUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.32.0",
3
+ "version": "4.32.2",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -87,7 +87,7 @@
87
87
  "@applitools/snippets": "2.6.4",
88
88
  "@applitools/socket": "1.2.2",
89
89
  "@applitools/spec-driver-webdriver": "1.1.26",
90
- "@applitools/ufg-client": "1.16.6",
90
+ "@applitools/ufg-client": "1.16.7",
91
91
  "@applitools/utils": "1.7.8",
92
92
  "@types/ws": "8.5.5",
93
93
  "abort-controller": "3.0.0",