@applitools/core 4.5.1 → 4.6.0

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,82 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.6.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@4.5.2...js/core@4.6.0) (2024-01-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * added possibility to provide `fallbackBaselineId` in environment objects ([#2146](https://github.com/applitools/eyes.sdk.javascript1/issues/2146)) ([f0782ea](https://github.com/applitools/eyes.sdk.javascript1/commit/f0782ea4c38935f97fc47248ed6a5b67f87b0634))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add environment variable for setting ufg server ufg ([#2147](https://github.com/applitools/eyes.sdk.javascript1/issues/2147)) ([cfc701f](https://github.com/applitools/eyes.sdk.javascript1/commit/cfc701f7a43fed0fe252d4090b9c1dc490063c76))
14
+ * remove local environment id ([#2152](https://github.com/applitools/eyes.sdk.javascript1/issues/2152)) ([59aaeae](https://github.com/applitools/eyes.sdk.javascript1/commit/59aaeaed474fbde78b76ae7ac803960e3ecd8166))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * @applitools/dom-snapshot bumped to 4.7.16
20
+ #### Bug Fixes
21
+
22
+ * handle unparsable values of media attribute in dom snapshot ([a2afe2e](https://github.com/applitools/eyes.sdk.javascript1/commit/a2afe2e18508f44f9c046270da0c1e09fb9aea03))
23
+ * @applitools/nml-client bumped to 1.6.4
24
+ #### Bug Fixes
25
+
26
+ * remove local environment id ([#2152](https://github.com/applitools/eyes.sdk.javascript1/issues/2152)) ([59aaeae](https://github.com/applitools/eyes.sdk.javascript1/commit/59aaeaed474fbde78b76ae7ac803960e3ecd8166))
27
+ * @applitools/ec-client bumped to 1.7.22
28
+
29
+ * @applitools/core-base bumped to 1.9.0
30
+ #### Features
31
+
32
+ * added possibility to provide `fallbackBaselineId` in environment objects ([#2146](https://github.com/applitools/eyes.sdk.javascript1/issues/2146)) ([f0782ea](https://github.com/applitools/eyes.sdk.javascript1/commit/f0782ea4c38935f97fc47248ed6a5b67f87b0634))
33
+
34
+
35
+ #### Bug Fixes
36
+
37
+ * add environment variable for setting ufg server ufg ([#2147](https://github.com/applitools/eyes.sdk.javascript1/issues/2147)) ([cfc701f](https://github.com/applitools/eyes.sdk.javascript1/commit/cfc701f7a43fed0fe252d4090b9c1dc490063c76))
38
+
39
+ ## [4.5.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@4.5.1...js/core@4.5.2) (2024-01-02)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * environment for each check for local environment ([#2135](https://github.com/applitools/eyes.sdk.javascript1/issues/2135)) ([f3a4483](https://github.com/applitools/eyes.sdk.javascript1/commit/f3a44831d41e190aa259367b17e930e7b6f39a04))
45
+ * fixed concurrency splank logging ([#2115](https://github.com/applitools/eyes.sdk.javascript1/issues/2115)) ([83afd7d](https://github.com/applitools/eyes.sdk.javascript1/commit/83afd7dd2b52125fdc233dadbaf774811ea1c738))
46
+ * fixed the issue when custom os name passed through configuration wasn't respected ([359fc0d](https://github.com/applitools/eyes.sdk.javascript1/commit/359fc0df5a9400312605bb9e8842784b7a05ba7d))
47
+
48
+
49
+ ### Dependencies
50
+
51
+ * @applitools/dom-shared bumped to 1.0.12
52
+ #### Bug Fixes
53
+
54
+ * fix error handling in process page poll ([#2127](https://github.com/applitools/eyes.sdk.javascript1/issues/2127)) ([4346026](https://github.com/applitools/eyes.sdk.javascript1/commit/4346026d567b92747df5b4f13fb1e82b849a856e))
55
+ * @applitools/dom-snapshot bumped to 4.7.15
56
+ #### Bug Fixes
57
+
58
+ * fix error handling in process page poll ([#2127](https://github.com/applitools/eyes.sdk.javascript1/issues/2127)) ([4346026](https://github.com/applitools/eyes.sdk.javascript1/commit/4346026d567b92747df5b4f13fb1e82b849a856e))
59
+
60
+
61
+
62
+ * @applitools/nml-client bumped to 1.6.3
63
+ #### Bug Fixes
64
+
65
+ * environment for each check for local environment ([#2135](https://github.com/applitools/eyes.sdk.javascript1/issues/2135)) ([f3a4483](https://github.com/applitools/eyes.sdk.javascript1/commit/f3a44831d41e190aa259367b17e930e7b6f39a04))
66
+ * @applitools/dom-capture bumped to 11.2.5
67
+
68
+ * @applitools/ec-client bumped to 1.7.21
69
+
70
+ * @applitools/core-base bumped to 1.8.0
71
+ #### Features
72
+
73
+ * sorted result regions of locate method ([ef6b249](https://github.com/applitools/eyes.sdk.javascript1/commit/ef6b249ad9d6998d6089423efd93f0220f13d378))
74
+
75
+
76
+ #### Bug Fixes
77
+
78
+ * fixed concurrency splank logging ([#2115](https://github.com/applitools/eyes.sdk.javascript1/issues/2115)) ([83afd7d](https://github.com/applitools/eyes.sdk.javascript1/commit/83afd7dd2b52125fdc233dadbaf774811ea1c738))
79
+
3
80
  ## [4.5.1](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@4.5.0...js/core@4.5.1) (2023-12-19)
4
81
 
5
82
 
@@ -34,10 +34,10 @@ const extract_text_1 = require("../automation/extract-text");
34
34
  const get_nml_client_1 = require("../automation/get-nml-client");
35
35
  const open_eyes_1 = require("./open-eyes");
36
36
  const utils = __importStar(require("@applitools/utils"));
37
- function makeCore({ spec, clients, base, concurrency, agentId = 'core-classic', cwd = process.cwd(), logger: defaultLogger, }) {
37
+ function makeCore({ spec, clients, base: defaultBase, concurrency, agentId = 'core-classic', cwd = process.cwd(), logger: defaultLogger, }) {
38
38
  const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core-classic' } });
39
- logger.log(`Core classic is initialized ${base ? 'with' : 'without'} custom base core`);
40
- base !== null && base !== void 0 ? base : (base = (0, core_base_1.makeCore)({ concurrency, agentId, cwd, logger }));
39
+ logger.log(`Core classic is initialized ${defaultBase ? 'with' : 'without'} custom base core`);
40
+ const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, cwd, logger });
41
41
  return utils.general.extend(base, core => {
42
42
  return {
43
43
  type: 'classic',
@@ -40,11 +40,13 @@ function makeGetBaseEyes({ settings: defaultSettings, eyes, logger: mainLogger,
40
40
  });
41
41
  return getBaseEyesWithCache;
42
42
  async function getBaseEyes({ settings, logger = mainLogger, }) {
43
+ var _a;
43
44
  logger = logger.extend(mainLogger);
44
45
  logger.log(`Command "getBaseEyes" is called with settings`, settings);
45
46
  return eyes.core.base.openEyes({
46
47
  settings: {
47
48
  ...defaultSettings,
49
+ fallbackBaselineId: (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId,
48
50
  environment: { ...defaultSettings.environment, ...settings.environment },
49
51
  },
50
52
  logger,
@@ -54,7 +54,7 @@ function makeOpenEyes({ core, spec, logger: mainLogger }) {
54
54
  const controller = new abort_controller_1.AbortController();
55
55
  const account = await core.getAccountInfo({ settings, logger });
56
56
  return utils.general.extend({}, eyes => {
57
- var _a;
57
+ var _a, _b, _c;
58
58
  return {
59
59
  type: 'classic',
60
60
  core,
@@ -63,7 +63,7 @@ function makeOpenEyes({ core, spec, logger: mainLogger }) {
63
63
  batchId: (_a = settings.batch) === null || _a === void 0 ? void 0 : _a.id,
64
64
  keepBatchOpen: settings.keepBatchOpen,
65
65
  eyesServer: account.eyesServer,
66
- ufgServer: account.ufgServer,
66
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_b = settings.ufgServerUrl) !== null && _b !== void 0 ? _b : (_c = account.ufgServer) === null || _c === void 0 ? void 0 : _c.ufgServerUrl },
67
67
  uploadUrl: account.uploadUrl,
68
68
  stitchingServiceUrl: account.stitchingServiceUrl,
69
69
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -26,40 +26,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.extractDefaultEnvironments = void 0;
27
27
  const utils = __importStar(require("@applitools/utils"));
28
28
  async function extractDefaultEnvironments({ driver, settings, }) {
29
- var _a, _b, _c;
30
- const environment = {};
29
+ var _a, _b;
30
+ const environment = { ...settings === null || settings === void 0 ? void 0 : settings.environment };
31
31
  if (!driver)
32
- return [(_a = settings === null || settings === void 0 ? void 0 : settings.environment) !== null && _a !== void 0 ? _a : environment];
32
+ return [environment];
33
33
  const currentContext = driver.currentContext;
34
34
  try {
35
35
  const driverEnvironment = await driver.getEnvironment();
36
36
  const viewport = await driver.getViewport();
37
37
  const size = await driver.getViewportSize();
38
38
  environment.viewportSize = utils.geometry.scale(size, viewport.viewportScale);
39
+ environment.environmentId = utils.general.guid();
39
40
  if (driverEnvironment.isEC)
40
- environment.ecSessionId = (_b = (await driver.getSessionId())) !== null && _b !== void 0 ? _b : undefined;
41
+ environment.ecSessionId = (_a = (await driver.getSessionId())) !== null && _a !== void 0 ? _a : undefined;
41
42
  if (driverEnvironment.isWeb)
42
43
  environment.userAgent = await driver.getUserAgentLegacy();
43
- if (driverEnvironment.deviceName)
44
+ if (!environment.deviceName && driverEnvironment.deviceName)
44
45
  environment.deviceName = driverEnvironment.deviceName;
45
- if (driverEnvironment.isNative && driverEnvironment.platformName) {
46
- environment.os = driverEnvironment.platformName;
47
- if (driverEnvironment.platformVersion)
48
- environment.os += ` ${driverEnvironment.platformVersion}`;
49
- if (!(settings === null || settings === void 0 ? void 0 : settings.keepPlatformNameAsIs)) {
50
- if (/^android/i.test(environment.os)) {
51
- environment.os = `Android${environment.os.slice(7)}`;
52
- }
53
- if (/^ios/i.test(environment.os)) {
54
- environment.os = `iOS${environment.os.slice(3)}`;
46
+ if (!environment.os) {
47
+ if (driverEnvironment.isNative && driverEnvironment.platformName) {
48
+ environment.os = driverEnvironment.platformName;
49
+ if (driverEnvironment.platformVersion)
50
+ environment.os += ` ${driverEnvironment.platformVersion}`;
51
+ if (!(settings === null || settings === void 0 ? void 0 : settings.keepPlatformNameAsIs)) {
52
+ if (/^android/i.test(environment.os)) {
53
+ environment.os = `Android${environment.os.slice(7)}`;
54
+ }
55
+ if (/^ios/i.test(environment.os)) {
56
+ environment.os = `iOS${environment.os.slice(3)}`;
57
+ }
55
58
  }
56
59
  }
57
- }
58
- else if (driverEnvironment.isReliable &&
59
- driverEnvironment.isChromium &&
60
- ((driverEnvironment.isWindows && Number.parseInt(driverEnvironment.browserVersion) >= 107) ||
61
- (driverEnvironment.isMac && Number.parseInt(driverEnvironment.browserVersion) >= 90))) {
62
- environment.os = `${driverEnvironment.platformName} ${(_c = driverEnvironment.platformVersion) !== null && _c !== void 0 ? _c : ''}`.trim();
60
+ else if (driverEnvironment.isReliable &&
61
+ driverEnvironment.isChromium &&
62
+ ((driverEnvironment.isWindows && Number.parseInt(driverEnvironment.browserVersion) >= 107) ||
63
+ (driverEnvironment.isMac && Number.parseInt(driverEnvironment.browserVersion) >= 90))) {
64
+ environment.os = `${driverEnvironment.platformName} ${(_b = driverEnvironment.platformVersion) !== null && _b !== void 0 ? _b : ''}`.trim();
65
+ }
63
66
  }
64
67
  return [environment];
65
68
  }
package/dist/core.js CHANGED
@@ -42,7 +42,7 @@ const extract_test_environment_1 = require("./utils/extract-test-environment");
42
42
  const validate_sdk_version_1 = require("./utils/validate-sdk-version");
43
43
  const memory_usage_logging_1 = require("./utils/memory-usage-logging");
44
44
  const utils = __importStar(require("@applitools/utils"));
45
- function makeCore({ spec, clients, concurrency, base: defaultBase, environment: defaultEnvironment, agentId = 'core', cwd = process.cwd(), logger: defaultLogger, asyncCache, } = {}) {
45
+ function makeCore({ spec, clients, base: defaultBase, concurrency = utils.general.getEnvValue('CONCURRENCY', 'number'), environment: defaultEnvironment, agentId = 'core', cwd = process.cwd(), logger: defaultLogger, asyncCache, } = {}) {
46
46
  const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core' } });
47
47
  (0, memory_usage_logging_1.startMemoryUsageLogging)({ logger });
48
48
  const environment = (0, extract_test_environment_1.extractTestEnvironment)(defaultEnvironment);
@@ -58,22 +58,11 @@ function makeCore({ spec, clients, concurrency, base: defaultBase, environment:
58
58
  getNMLClient: (0, get_nml_client_1.makeGetNMLClient)({ client: clients === null || clients === void 0 ? void 0 : clients.nml, logger }),
59
59
  getECClient: (0, get_ec_client_1.makeGetECClient)({ logger }),
60
60
  getAccountInfo: (0, get_account_info_1.makeGetAccountInfo)({ core, logger }),
61
- makeManager: (0, make_manager_1.makeMakeManager)({
62
- spec,
63
- clients,
64
- concurrency,
65
- core,
66
- base: defaultBase,
67
- agentId,
68
- cwd,
69
- environment,
70
- asyncCache,
71
- logger,
72
- }),
61
+ makeManager: (0, make_manager_1.makeMakeManager)({ spec, clients, core, agentId, cwd, environment, asyncCache, logger }),
73
62
  locate: (0, locate_1.makeLocate)({ spec, core, logger }),
74
63
  locateText: (0, locate_text_1.makeLocateText)({ spec, core, logger }),
75
64
  extractText: (0, extract_text_1.makeExtractText)({ spec, core, logger }),
76
- openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, clients, core, concurrency, environment, asyncCache, logger }),
65
+ openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, clients, core, environment, asyncCache, logger }),
77
66
  closeBatch: (0, close_batch_1.makeCloseBatch)({ core, logger }),
78
67
  deleteTest: (0, delete_test_1.makeDeleteTest)({ core, logger }),
79
68
  };
@@ -30,16 +30,16 @@ const core_2 = require("./ufg/core");
30
30
  const open_eyes_1 = require("./open-eyes");
31
31
  const get_manager_results_1 = require("./get-manager-results");
32
32
  const utils = __importStar(require("@applitools/utils"));
33
- function makeMakeManager({ spec, clients, concurrency: defaultConcurrency = utils.general.getEnvValue('CONCURRENCY', 'number'), core, base: defaultBase, agentId: defaultAgentId, environment, cwd = process.cwd(), logger: mainLogger, asyncCache, }) {
33
+ function makeMakeManager({ spec, clients, core, base: defaultBase, agentId: defaultAgentId, environment, cwd = process.cwd(), logger: mainLogger, asyncCache, }) {
34
34
  return async function makeManager({ type = 'classic', settings, logger = mainLogger, } = {}) {
35
- var _a, _b, _c, _d, _e;
36
- var _f;
35
+ var _a, _b, _c, _d, _e, _f;
36
+ var _g;
37
37
  logger = logger.extend(mainLogger, { tags: [`manager-${type}-${utils.general.shortid()}`] });
38
38
  settings !== null && settings !== void 0 ? settings : (settings = {});
39
- (_a = settings.concurrency) !== null && _a !== void 0 ? _a : (settings.concurrency = defaultConcurrency !== null && defaultConcurrency !== void 0 ? defaultConcurrency : (utils.types.isInteger(settings.legacyConcurrency) ? settings.legacyConcurrency * 5 : 5));
40
- (_b = settings.batch) !== null && _b !== void 0 ? _b : (settings.batch = {});
41
- (_c = (_f = settings.batch).id) !== null && _c !== void 0 ? _c : (_f.id = (_d = utils.general.getEnvValue('BATCH_ID')) !== null && _d !== void 0 ? _d : `generated-${utils.general.guid()}`);
42
- (_e = settings.agentId) !== null && _e !== void 0 ? _e : (settings.agentId = type === 'ufg' ? defaultAgentId === null || defaultAgentId === void 0 ? void 0 : defaultAgentId.replace(/(\/\d)/, '.visualgrid$1') : defaultAgentId);
39
+ (_a = settings.concurrency) !== null && _a !== void 0 ? _a : (settings.concurrency = (_b = utils.general.getEnvValue('CONCURRENCY', 'number')) !== null && _b !== void 0 ? _b : (utils.types.isInteger(settings.legacyConcurrency) ? settings.legacyConcurrency * 5 : 100));
40
+ (_c = settings.batch) !== null && _c !== void 0 ? _c : (settings.batch = {});
41
+ (_d = (_g = settings.batch).id) !== null && _d !== void 0 ? _d : (_g.id = (_e = utils.general.getEnvValue('BATCH_ID')) !== null && _e !== void 0 ? _e : `generated-${utils.general.guid()}`);
42
+ (_f = settings.agentId) !== null && _f !== void 0 ? _f : (settings.agentId = type === 'ufg' ? defaultAgentId === null || defaultAgentId === void 0 ? void 0 : defaultAgentId.replace(/(\/\d)/, '.visualgrid$1') : defaultAgentId);
43
43
  logger.log('Command "makeManager" is called with settings', settings);
44
44
  const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, cwd, logger });
45
45
  const cores = {
@@ -48,6 +48,10 @@ function makeMakeManager({ spec, clients, concurrency: defaultConcurrency = util
48
48
  };
49
49
  const storage = [];
50
50
  return {
51
+ get concurrency() {
52
+ return base.concurrency;
53
+ },
54
+ base,
51
55
  openEyes: utils.general.wrap((0, open_eyes_1.makeOpenEyes)({ type, clients, batch: settings.batch, spec, core, cores, environment, asyncCache, logger }), async (openEyes, options) => {
52
56
  const eyes = await openEyes(options);
53
57
  storage.push(eyes);
package/dist/open-eyes.js CHANGED
@@ -34,10 +34,10 @@ const close_1 = require("./close");
34
34
  const abort_1 = require("./abort");
35
35
  const get_eyes_results_1 = require("./get-eyes-results");
36
36
  const utils = __importStar(require("@applitools/utils"));
37
- function makeOpenEyes({ type: defaultType = 'classic', clients, concurrency, batch, core, cores, spec, environment, logger: mainLogger, asyncCache, }) {
37
+ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, core, cores, spec, environment, logger: mainLogger, asyncCache, }) {
38
38
  return async function openEyes({ type = defaultType, settings, config, target, logger = mainLogger, }) {
39
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
40
- var _u, _v, _w, _x;
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
40
+ var _w, _x, _y, _z;
41
41
  logger = logger.extend(mainLogger, { tags: [`eyes-${type}-${utils.general.shortid()}`] });
42
42
  settings = { ...config === null || config === void 0 ? void 0 : config.open, ...settings };
43
43
  (_a = settings.userTestId) !== null && _a !== void 0 ? _a : (settings.userTestId = `${settings.testName}--${utils.general.guid()}`);
@@ -45,16 +45,17 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, concurrency, bat
45
45
  (_e = settings.apiKey) !== null && _e !== void 0 ? _e : (settings.apiKey = utils.general.getEnvValue('API_KEY'));
46
46
  (_f = settings.useDnsCache) !== null && _f !== void 0 ? _f : (settings.useDnsCache = utils.general.getEnvValue('USE_DNS_CACHE', 'boolean'));
47
47
  settings.batch = { ...batch, ...settings.batch };
48
- (_g = (_u = settings.batch).id) !== null && _g !== void 0 ? _g : (_u.id = (_h = utils.general.getEnvValue('BATCH_ID')) !== null && _h !== void 0 ? _h : `generated-${utils.general.guid()}`);
49
- (_j = (_v = settings.batch).name) !== null && _j !== void 0 ? _j : (_v.name = utils.general.getEnvValue('BATCH_NAME'));
50
- (_k = (_w = settings.batch).sequenceName) !== null && _k !== void 0 ? _k : (_w.sequenceName = utils.general.getEnvValue('BATCH_SEQUENCE'));
51
- (_l = (_x = settings.batch).notifyOnCompletion) !== null && _l !== void 0 ? _l : (_x.notifyOnCompletion = utils.general.getEnvValue('BATCH_NOTIFY', 'boolean'));
48
+ (_g = (_w = settings.batch).id) !== null && _g !== void 0 ? _g : (_w.id = (_h = utils.general.getEnvValue('BATCH_ID')) !== null && _h !== void 0 ? _h : `generated-${utils.general.guid()}`);
49
+ (_j = (_x = settings.batch).name) !== null && _j !== void 0 ? _j : (_x.name = utils.general.getEnvValue('BATCH_NAME'));
50
+ (_k = (_y = settings.batch).sequenceName) !== null && _k !== void 0 ? _k : (_y.sequenceName = utils.general.getEnvValue('BATCH_SEQUENCE'));
51
+ (_l = (_z = settings.batch).notifyOnCompletion) !== null && _l !== void 0 ? _l : (_z.notifyOnCompletion = utils.general.getEnvValue('BATCH_NOTIFY', 'boolean'));
52
52
  (_m = settings.keepBatchOpen) !== null && _m !== void 0 ? _m : (settings.keepBatchOpen = utils.general.getEnvValue('DONT_CLOSE_BATCHES', 'boolean'));
53
53
  (_o = settings.branchName) !== null && _o !== void 0 ? _o : (settings.branchName = utils.general.getEnvValue('BRANCH'));
54
54
  (_p = settings.parentBranchName) !== null && _p !== void 0 ? _p : (settings.parentBranchName = utils.general.getEnvValue('PARENT_BRANCH'));
55
55
  (_q = settings.baselineBranchName) !== null && _q !== void 0 ? _q : (settings.baselineBranchName = utils.general.getEnvValue('BASELINE_BRANCH'));
56
- (_r = settings.ignoreBaseline) !== null && _r !== void 0 ? _r : (settings.ignoreBaseline = false);
57
- (_s = settings.compareWithParentBranch) !== null && _s !== void 0 ? _s : (settings.compareWithParentBranch = false);
56
+ (_r = settings.ufgServerUrl) !== null && _r !== void 0 ? _r : (settings.ufgServerUrl = utils.general.getEnvValue('UFG_SERVER_URL'));
57
+ (_s = settings.ignoreBaseline) !== null && _s !== void 0 ? _s : (settings.ignoreBaseline = false);
58
+ (_t = settings.compareWithParentBranch) !== null && _t !== void 0 ? _t : (settings.compareWithParentBranch = false);
58
59
  const driver = target && (await (0, driver_1.makeDriver)({ spec, driver: target, logger, customConfig: settings }));
59
60
  const driverEnvironment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
60
61
  const driverUrl = await (driver === null || driver === void 0 ? void 0 : driver.getDriverUrl());
@@ -65,7 +66,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, concurrency, bat
65
66
  event: {
66
67
  type: 'openEyes',
67
68
  userTestId: settings.userTestId,
68
- concurrency,
69
+ concurrency: (_u = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _u !== void 0 ? _u : core.concurrency,
69
70
  environment,
70
71
  driver: {
71
72
  deviceName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.deviceName,
@@ -73,7 +74,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, concurrency, bat
73
74
  browserVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.browserVersion,
74
75
  platformName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformName,
75
76
  platformVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformVersion,
76
- isApplitoolsLib: (_t = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _t === void 0 ? void 0 : _t.instrumented,
77
+ isApplitoolsLib: (_v = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _v === void 0 ? void 0 : _v.instrumented,
77
78
  isEC: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.isEC,
78
79
  },
79
80
  driverUrl,
@@ -86,7 +87,7 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, concurrency, bat
86
87
  settings: settings,
87
88
  target: driver,
88
89
  cores: cores !== null && cores !== void 0 ? cores : {
89
- ufg: (0, core_2.makeCore)({ spec, clients, base: core.base, concurrency: concurrency !== null && concurrency !== void 0 ? concurrency : 5, asyncCache, logger }),
90
+ ufg: (0, core_2.makeCore)({ spec, clients, base: core.base, asyncCache, logger }),
90
91
  classic: (0, core_1.makeCore)({ spec, clients, base: core.base, logger }),
91
92
  },
92
93
  logger,
package/dist/ufg/core.js CHANGED
@@ -35,10 +35,10 @@ const get_nml_client_1 = require("../automation/get-nml-client");
35
35
  const get_ufg_client_1 = require("./get-ufg-client");
36
36
  const open_eyes_1 = require("./open-eyes");
37
37
  const utils = __importStar(require("@applitools/utils"));
38
- function makeCore({ spec, clients, base, concurrency, fetchConcurrency, agentId = 'core-ufg', cwd = process.cwd(), logger: defaultLogger, asyncCache, }) {
38
+ function makeCore({ spec, clients, base: defaultBase, concurrency, fetchConcurrency, agentId = 'core-ufg', cwd = process.cwd(), logger: defaultLogger, asyncCache, }) {
39
39
  const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'core-ufg' } });
40
- logger.log(`Core ufg is initialized ${base ? 'with' : 'without'} custom base core`);
41
- base !== null && base !== void 0 ? base : (base = (0, core_base_1.makeCore)({ concurrency, agentId, cwd, logger }));
40
+ logger.log(`Core ufg is initialized ${defaultBase ? 'with' : 'without'} custom base core`);
41
+ const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, cwd, logger });
42
42
  return utils.general.extend(base, core => {
43
43
  return {
44
44
  type: 'ufg',
@@ -39,6 +39,7 @@ function makeGetBaseEyes({ settings: defaultSettings, eyes, logger: mainLogger,
39
39
  });
40
40
  return getBaseEyesWithCache;
41
41
  async function getBaseEyes({ settings, logger = mainLogger, }) {
42
+ var _a;
42
43
  logger = logger.extend(mainLogger);
43
44
  logger.log(`Command "getBaseEyes" is called with settings`, settings);
44
45
  const ufgClient = await eyes.core.getUFGClient({
@@ -56,6 +57,7 @@ function makeGetBaseEyes({ settings: defaultSettings, eyes, logger: mainLogger,
56
57
  return eyes.core.base.openEyes({
57
58
  settings: {
58
59
  ...defaultSettings,
60
+ fallbackBaselineId: (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId,
59
61
  environment: { ...defaultSettings.environment, ...environment, properties: settings.environment.properties },
60
62
  },
61
63
  logger,
@@ -54,7 +54,7 @@ function makeOpenEyes({ core, spec, logger: mainLogger }) {
54
54
  const controller = new abort_controller_1.AbortController();
55
55
  const account = await core.getAccountInfo({ settings, logger });
56
56
  return utils.general.extend({}, eyes => {
57
- var _a;
57
+ var _a, _b, _c;
58
58
  return {
59
59
  type: 'ufg',
60
60
  core,
@@ -63,7 +63,7 @@ function makeOpenEyes({ core, spec, logger: mainLogger }) {
63
63
  batchId: (_a = settings.batch) === null || _a === void 0 ? void 0 : _a.id,
64
64
  keepBatchOpen: settings.keepBatchOpen,
65
65
  eyesServer: account.eyesServer,
66
- ufgServer: account.ufgServer,
66
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_b = settings.ufgServerUrl) !== null && _b !== void 0 ? _b : (_c = account.ufgServer) === null || _c === void 0 ? void 0 : _c.ufgServerUrl },
67
67
  uploadUrl: account.uploadUrl,
68
68
  stitchingServiceUrl: account.stitchingServiceUrl,
69
69
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -32,6 +32,7 @@ const utils = __importStar(require("@applitools/utils"));
32
32
  function makeCore(options) {
33
33
  const socketPromise = makeClientSocket(options);
34
34
  const core = {
35
+ concurrency: undefined,
35
36
  base: null,
36
37
  async getAccountInfo(options) {
37
38
  const socket = await socketPromise;
@@ -97,6 +98,8 @@ function makeCore(options) {
97
98
  exports.makeCore = makeCore;
98
99
  function makeManager({ socket, core, managerRef, }) {
99
100
  const manager = {
101
+ concurrency: undefined,
102
+ base: null,
100
103
  async openEyes(options) {
101
104
  const eyesRef = await socket.request('EyesManager.openEyes', { ...options, manager: managerRef });
102
105
  return makeEyes({ socket, core, eyesRef });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.5.1",
3
+ "version": "4.6.0",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -74,13 +74,13 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "@applitools/core-base": "1.7.5",
78
- "@applitools/dom-capture": "11.2.4",
79
- "@applitools/dom-snapshot": "4.7.14",
77
+ "@applitools/core-base": "1.9.0",
78
+ "@applitools/dom-capture": "11.2.5",
79
+ "@applitools/dom-snapshot": "4.7.16",
80
80
  "@applitools/driver": "1.16.1",
81
- "@applitools/ec-client": "1.7.20",
81
+ "@applitools/ec-client": "1.7.22",
82
82
  "@applitools/logger": "2.0.14",
83
- "@applitools/nml-client": "1.6.2",
83
+ "@applitools/nml-client": "1.6.4",
84
84
  "@applitools/req": "1.6.4",
85
85
  "@applitools/screenshoter": "3.8.20",
86
86
  "@applitools/snippets": "2.4.24",
@@ -34,10 +34,12 @@ export interface AndroidDeviceEnvironment {
34
34
  export type RenderEnvironment = (DesktopBrowserEnvironment | ChromeEmulationDeviceEnvironment | IOSDeviceEnvironment | AndroidDeviceEnvironment) & {
35
35
  environmentId?: string;
36
36
  properties?: BaseCore.CustomProperty[];
37
+ fallbackBaselineId?: string;
37
38
  };
38
39
  export type ExactEnvironment = BaseCore.Environment & {
39
40
  environmentId?: string;
40
41
  requested?: RenderEnvironment;
42
+ fallbackBaselineId?: string;
41
43
  };
42
44
  export type Environment = RenderEnvironment | ExactEnvironment;
43
45
  export interface Core<TSpec extends SpecType> extends BaseCore.Core {
@@ -14,5 +14,5 @@ type Options<TSpec extends SpecType> = {
14
14
  cwd?: string;
15
15
  logger?: Logger;
16
16
  };
17
- export declare function makeCore<TSpec extends SpecType>({ spec, clients, base, concurrency, agentId, cwd, logger: defaultLogger, }: Options<TSpec>): Core<TSpec>;
17
+ export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, concurrency, agentId, cwd, logger: defaultLogger, }: Options<TSpec>): Core<TSpec>;
18
18
  export {};
package/types/core.d.ts CHANGED
@@ -10,13 +10,13 @@ type Options<TSpec extends SpecType> = {
10
10
  ufg?: UFGClient;
11
11
  nml?: NMLClient;
12
12
  };
13
- concurrency?: number;
14
13
  base?: BaseCore;
15
- agentId?: string;
14
+ concurrency?: number;
16
15
  environment?: Record<string, any>;
16
+ agentId?: string;
17
17
  cwd?: string;
18
18
  logger?: Logger;
19
19
  asyncCache?: AsyncCache;
20
20
  };
21
- export declare function makeCore<TSpec extends SpecType>({ spec, clients, concurrency, base: defaultBase, environment: defaultEnvironment, agentId, cwd, logger: defaultLogger, asyncCache, }?: Options<TSpec>): Core<TSpec, 'classic' | 'ufg'>;
21
+ export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, concurrency, environment: defaultEnvironment, agentId, cwd, logger: defaultLogger, asyncCache, }?: Options<TSpec>): Core<TSpec, 'classic' | 'ufg'>;
22
22
  export {};
@@ -10,7 +10,6 @@ type Options<TSpec extends SpecType> = {
10
10
  ufg?: UFGClient;
11
11
  nml?: NMLClient;
12
12
  };
13
- concurrency?: number;
14
13
  core: Core<TSpec>;
15
14
  base?: BaseCore;
16
15
  agentId?: string;
@@ -19,7 +18,7 @@ type Options<TSpec extends SpecType> = {
19
18
  logger: Logger;
20
19
  asyncCache?: AsyncCache;
21
20
  };
22
- export declare function makeMakeManager<TSpec extends SpecType>({ spec, clients, concurrency: defaultConcurrency, core, base: defaultBase, agentId: defaultAgentId, environment, cwd, logger: mainLogger, asyncCache, }: Options<TSpec>): <TType extends "classic" | "ufg" = "classic">({ type, settings, logger, }?: {
21
+ export declare function makeMakeManager<TSpec extends SpecType>({ spec, clients, core, base: defaultBase, agentId: defaultAgentId, environment, cwd, logger: mainLogger, asyncCache, }: Options<TSpec>): <TType extends "classic" | "ufg" = "classic">({ type, settings, logger, }?: {
23
22
  type?: TType | undefined;
24
23
  settings?: ManagerSettings | undefined;
25
24
  logger?: Logger | undefined;
@@ -9,7 +9,6 @@ type Options<TSpec extends SpecType, TType extends 'classic' | 'ufg'> = {
9
9
  ufg?: UFGClient;
10
10
  nml?: NMLClient;
11
11
  };
12
- concurrency?: number;
13
12
  batch?: Batch;
14
13
  core: Core<TSpec, TType>;
15
14
  cores?: {
@@ -20,7 +19,7 @@ type Options<TSpec extends SpecType, TType extends 'classic' | 'ufg'> = {
20
19
  logger: Logger;
21
20
  asyncCache?: AsyncCache;
22
21
  };
23
- export declare function makeOpenEyes<TSpec extends SpecType, TDefaultType extends 'classic' | 'ufg' = 'classic'>({ type: defaultType, clients, concurrency, batch, core, cores, spec, environment, logger: mainLogger, asyncCache, }: Options<TSpec, TDefaultType>): <TType extends "classic" | "ufg" = TDefaultType>({ type, settings, config, target, logger, }: {
22
+ export declare function makeOpenEyes<TSpec extends SpecType, TDefaultType extends 'classic' | 'ufg' = 'classic'>({ type: defaultType, clients, batch, core, cores, spec, environment, logger: mainLogger, asyncCache, }: Options<TSpec, TDefaultType>): <TType extends "classic" | "ufg" = TDefaultType>({ type, settings, config, target, logger, }: {
24
23
  type?: TType | undefined;
25
24
  settings?: Partial<OpenSettings<TDefaultType> & OpenSettings<TType>> | undefined;
26
25
  config?: (Config<TSpec, TDefaultType> & Config<TSpec, TType>) | undefined;
package/types/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { MaybeArray } from '@applitools/utils';
2
+ import type * as BaseCore from '@applitools/core-base/types';
2
3
  import type * as AutomationCore from './automation/types';
3
4
  import type * as ClassicCore from './classic/types';
4
5
  import type * as UFGCore from './ufg/types';
@@ -47,6 +48,8 @@ export interface Core<TSpec extends SpecType, TDefaultType extends 'classic' | '
47
48
  }): Promise<string[]>;
48
49
  }
49
50
  export interface EyesManager<TSpec extends SpecType, TDefaultType extends 'classic' | 'ufg' = 'classic' | 'ufg'> {
51
+ readonly concurrency: number | undefined;
52
+ readonly base: BaseCore.Core;
50
53
  openEyes<TType extends 'classic' | 'ufg' = TDefaultType>(options: {
51
54
  type?: TType;
52
55
  target?: AutomationCore.DriverTarget<TSpec>;
@@ -18,5 +18,5 @@ type Options<TSpec extends SpecType> = {
18
18
  logger?: Logger;
19
19
  asyncCache?: AsyncCache;
20
20
  };
21
- export declare function makeCore<TSpec extends SpecType>({ spec, clients, base, concurrency, fetchConcurrency, agentId, cwd, logger: defaultLogger, asyncCache, }: Options<TSpec>): Core<TSpec>;
21
+ export declare function makeCore<TSpec extends SpecType>({ spec, clients, base: defaultBase, concurrency, fetchConcurrency, agentId, cwd, logger: defaultLogger, asyncCache, }: Options<TSpec>): Core<TSpec>;
22
22
  export {};