@applitools/core 4.0.2 → 4.1.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,60 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.1.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@4.0.2...js/core@4.1.0) (2023-11-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * added warning when driver used with capabilities that may conflict with applitools lib workflow ([#2011](https://github.com/applitools/eyes.sdk.javascript1/issues/2011)) ([081006d](https://github.com/applitools/eyes.sdk.javascript1/commit/081006d879894db03a2713129b66586496b6eb02))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed issue that caused dom snapshots to be taken for different viewport sizes when layout breakpoints were explicitly turned off ([4121876](https://github.com/applitools/eyes.sdk.javascript1/commit/4121876189f133b6023cfea52ca91c02c31079fb))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * @applitools/dom-shared bumped to 1.0.11
19
+ #### Bug Fixes
20
+
21
+ * (java/eyes-appium-java5): fix incorrect stitchMode mapping in checkSettings ([c70428e](https://github.com/applitools/eyes.sdk.javascript1/commit/c70428ec83e26b8b5e398ff11814f8376ca97d56))
22
+ * @applitools/dom-capture bumped to 11.2.4
23
+ #### Bug Fixes
24
+
25
+ * (java/eyes-appium-java5): fix incorrect stitchMode mapping in checkSettings ([c70428e](https://github.com/applitools/eyes.sdk.javascript1/commit/c70428ec83e26b8b5e398ff11814f8376ca97d56))
26
+
27
+
28
+
29
+ * @applitools/dom-snapshot bumped to 4.7.13
30
+ #### Bug Fixes
31
+
32
+ * (java/eyes-appium-java5): fix incorrect stitchMode mapping in checkSettings ([c70428e](https://github.com/applitools/eyes.sdk.javascript1/commit/c70428ec83e26b8b5e398ff11814f8376ca97d56))
33
+ * handled duplicated style properties in inline style tags ([#2014](https://github.com/applitools/eyes.sdk.javascript1/issues/2014)) ([2f8bada](https://github.com/applitools/eyes.sdk.javascript1/commit/2f8bada9cd44c65a69e54cbd08f57534632f12d2))
34
+
35
+
36
+
37
+ * @applitools/spec-driver-webdriver bumped to 1.0.49
38
+
39
+ * @applitools/spec-driver-selenium bumped to 1.5.63
40
+
41
+ * @applitools/spec-driver-puppeteer bumped to 1.2.5
42
+
43
+ * @applitools/driver bumped to 1.15.0
44
+ #### Features
45
+
46
+ * added warning when driver used with capabilities that may conflict with applitools lib workflow ([#2011](https://github.com/applitools/eyes.sdk.javascript1/issues/2011)) ([081006d](https://github.com/applitools/eyes.sdk.javascript1/commit/081006d879894db03a2713129b66586496b6eb02))
47
+ * @applitools/ufg-client bumped to 1.9.7
48
+ #### Bug Fixes
49
+
50
+ * added retries on ufg requests that respond with 503 status code ([7d78917](https://github.com/applitools/eyes.sdk.javascript1/commit/7d78917d559fa182c6723ca34cef2118cf08a036))
51
+ * @applitools/screenshoter bumped to 3.8.15
52
+
53
+ * @applitools/nml-client bumped to 1.5.15
54
+
55
+ * @applitools/ec-client bumped to 1.7.15
56
+
57
+
3
58
  ## [4.0.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@4.0.1...js/core@4.0.2) (2023-10-30)
4
59
 
5
60
 
package/dist/check.js CHANGED
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.makeCheck = void 0;
30
30
  const driver_1 = require("@applitools/driver");
31
31
  const utils = __importStar(require("@applitools/utils"));
32
+ const lang = __importStar(require("./lang"));
32
33
  const chalk_1 = __importDefault(require("chalk"));
33
34
  function makeCheck({ type: defaultType = 'classic', eyes, target: defaultTarget, spec, logger: mainLogger, }) {
34
35
  let stepIndex = 0;
@@ -57,7 +58,7 @@ function makeCheck({ type: defaultType = 'classic', eyes, target: defaultTarget,
57
58
  settings.stepIndex = stepIndex++;
58
59
  (_p = settings.waitBetweenStitches) !== null && _p !== void 0 ? _p : (settings.waitBetweenStitches = utils.types.isObject(settings.lazyLoad) ? settings.lazyLoad.waitingTime : 100);
59
60
  if (settings.matchLevel === 'Content') {
60
- logger.console.log(chalk_1.default.yellow(`The "Content" match level value has been deprecated, use "IgnoreColors" instead.`));
61
+ logger.console.log(chalk_1.default.yellow(lang.matchLevelContentDeprecatedWarning));
61
62
  }
62
63
  const driver = (0, driver_1.isDriver)(target, spec)
63
64
  ? await (0, driver_1.makeDriver)({ spec, driver: target, reset: target === defaultTarget, logger })
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.makeCheckAndClose = void 0;
27
30
  const driver_1 = require("@applitools/driver");
@@ -31,10 +34,12 @@ const wait_for_lazy_load_1 = require("../automation/utils/wait-for-lazy-load");
31
34
  const uniquify_environments_1 = require("../automation/utils/uniquify-environments");
32
35
  const to_environment_key_1 = require("../automation/utils/to-environment-key");
33
36
  const abort_error_1 = require("../errors/abort-error");
37
+ const chalk_1 = __importDefault(require("chalk"));
34
38
  const utils = __importStar(require("@applitools/utils"));
39
+ const lang = __importStar(require("../lang"));
35
40
  function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultEnvironments = [], spec, signal, logger: mainLogger, }) {
36
41
  return async function checkAndClose({ target = defaultTarget, settings = {}, logger = mainLogger, } = {}) {
37
- var _a, _b;
42
+ var _a, _b, _c;
38
43
  logger = logger.extend(mainLogger);
39
44
  logger.log('Command "checkAndClose" is called with settings', settings);
40
45
  if (!target)
@@ -70,7 +75,9 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
70
75
  });
71
76
  }
72
77
  const { elementReferencesToCalculate, getBaseCheckSettings } = (0, to_base_check_settings_1.toBaseCheckSettings)({ settings });
73
- if (driverEnvironment.isWeb || !driverEnvironment.isApplitoolsLib || settings.screenshotMode === 'default') {
78
+ if (driverEnvironment.isWeb ||
79
+ !((_c = driverEnvironment.applitoolsLib) === null || _c === void 0 ? void 0 : _c.instrumented) ||
80
+ settings.screenshotMode === 'default') {
74
81
  const screenshots = await (0, take_screenshots_1.takeScreenshots)({
75
82
  driver,
76
83
  settings: {
@@ -89,6 +96,13 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
89
96
  });
90
97
  }
91
98
  else {
99
+ if (driverEnvironment.applitoolsLib.conflictingCapabilities) {
100
+ const message = lang.applitoolsLibConflictingCapabilitiesWarning({
101
+ conflictingCapabilities: driverEnvironment.applitoolsLib.conflictingCapabilities,
102
+ });
103
+ logger.console.log(chalk_1.default.yellow(message));
104
+ logger.log(message);
105
+ }
92
106
  const nmlClient = await eyes.core.getNMLClient({
93
107
  driver,
94
108
  settings: { ...eyes.test.eyesServer, supportedEnvironmentsUrl: eyes.test.supportedEnvironmentsUrl },
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.makeCheck = void 0;
27
30
  const driver_1 = require("@applitools/driver");
@@ -31,10 +34,12 @@ const wait_for_lazy_load_1 = require("../automation/utils/wait-for-lazy-load");
31
34
  const uniquify_environments_1 = require("../automation/utils/uniquify-environments");
32
35
  const to_environment_key_1 = require("../automation/utils/to-environment-key");
33
36
  const abort_error_1 = require("../errors/abort-error");
37
+ const chalk_1 = __importDefault(require("chalk"));
34
38
  const utils = __importStar(require("@applitools/utils"));
39
+ const lang = __importStar(require("../lang"));
35
40
  function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironments = [], spec, signal, logger: mainLogger, }) {
36
41
  return async function check({ target = defaultTarget, settings = {}, logger = mainLogger, } = {}) {
37
- var _a, _b;
42
+ var _a, _b, _c;
38
43
  logger = logger.extend(mainLogger);
39
44
  logger.log('Command "check" is called with settings', settings);
40
45
  if (!target)
@@ -70,7 +75,9 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
70
75
  });
71
76
  }
72
77
  const { elementReferencesToCalculate, getBaseCheckSettings } = (0, to_base_check_settings_1.toBaseCheckSettings)({ settings });
73
- if (driverEnvironment.isWeb || !driverEnvironment.isApplitoolsLib || settings.screenshotMode === 'default') {
78
+ if (driverEnvironment.isWeb ||
79
+ !((_c = driverEnvironment.applitoolsLib) === null || _c === void 0 ? void 0 : _c.instrumented) ||
80
+ settings.screenshotMode === 'default') {
74
81
  const screenshots = await (0, take_screenshots_1.takeScreenshots)({
75
82
  driver,
76
83
  settings: {
@@ -89,6 +96,13 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
89
96
  });
90
97
  }
91
98
  else {
99
+ if (driverEnvironment.applitoolsLib.conflictingCapabilities) {
100
+ const message = lang.applitoolsLibConflictingCapabilitiesWarning({
101
+ conflictingCapabilities: driverEnvironment.applitoolsLib.conflictingCapabilities,
102
+ });
103
+ logger.console.log(chalk_1.default.yellow(message));
104
+ logger.log(message);
105
+ }
92
106
  const nmlClient = await eyes.core.getNMLClient({
93
107
  driver,
94
108
  settings: { ...eyes.test.eyesServer, supportedEnvironmentsUrl: eyes.test.supportedEnvironmentsUrl },
package/dist/lang.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applitoolsLibConflictingCapabilitiesWarning = exports.requestedEnvironmentOutOfDriverBoundsWarning = exports.breakpointOutOfDriverBoundsWarning = exports.requestedEnvironmentSmallerThenBreakpointWarning = exports.edgeUfgEnvironmentDeprecatedWarning = exports.matchLevelContentDeprecatedWarning = void 0;
4
+ exports.matchLevelContentDeprecatedWarning = `The "Content" match level value has been deprecated, use "IgnoreColors" instead.`;
5
+ exports.edgeUfgEnvironmentDeprecatedWarning = `The 'edge' option that is being used in your browsers' configuration will soon be deprecated. Please change it to either 'edgelegacy' for the legacy version or to 'edgechromium' for the new Chromium-based version. Please note, when using the built-in BrowserType enum, then the values are BrowserType.EDGE_LEGACY and BrowserType.EDGE_CHROMIUM, respectively.`;
6
+ const requestedEnvironmentSmallerThenBreakpointWarning = (options) => {
7
+ const browsers = options.browsers.map(({ name, width }) => `(${name}, ${width})`).join(', ');
8
+ return `The following configuration's viewport-widths are smaller than the smallest configured layout breakpoint (${options.breakpoint} pixels): [${browsers}]. As a fallback, the resources that will be used for these configurations have been captured on a viewport-width of ${options.breakpoint} - 1 pixels. If an additional layout breakpoint is needed for you to achieve better results - please add it to your configuration.`;
9
+ };
10
+ exports.requestedEnvironmentSmallerThenBreakpointWarning = requestedEnvironmentSmallerThenBreakpointWarning;
11
+ const breakpointOutOfDriverBoundsWarning = (options) => {
12
+ const browsers = options.browsers.map(({ name, width }) => `(${name}, ${width})`).join(', ');
13
+ return `One of the configured layout breakpoints is ${options.requiredWidth} pixels, while your local browser has a limit of ${options.actualWidth}, so the SDK couldn't resize it to the desired size. As a fallback, the resources that will be used for the following configurations: [${browsers}] have been captured on the browser's limit (${options.actualWidth} pixels). To resolve this, you may use a headless browser as it can be resized to any size.`;
14
+ };
15
+ exports.breakpointOutOfDriverBoundsWarning = breakpointOutOfDriverBoundsWarning;
16
+ const requestedEnvironmentOutOfDriverBoundsWarning = (options) => {
17
+ const browsers = options.browsers.map(({ name }) => `(${name})`).join(', ');
18
+ return `The following configurations [${browsers}] have a viewport-width of ${options.requiredWidth} pixels, while your local browser has a limit of ${options.actualWidth} pixels, so the SDK couldn't resize it to the desired size. As a fallback, the resources that will be used for these checkpoints have been captured on the browser's limit (${options.actualWidth} pixels). To resolve this, you may use a headless browser as it can be resized to any size.`;
19
+ };
20
+ exports.requestedEnvironmentOutOfDriverBoundsWarning = requestedEnvironmentOutOfDriverBoundsWarning;
21
+ const applitoolsLibConflictingCapabilitiesWarning = (options) => {
22
+ const conflictingCapabilities = Object.entries(options.conflictingCapabilities)
23
+ .map(entry => entry.join(': '))
24
+ .join(', ');
25
+ return `We have identified ${conflictingCapabilities} in your driver capabilities, this may prevent Applitools Native Library from loading. If you are not sure whether this will cause a problem, contact Support.`;
26
+ };
27
+ exports.applitoolsLibConflictingCapabilitiesWarning = applitoolsLibConflictingCapabilitiesWarning;
@@ -34,6 +34,7 @@ const uniquify_environments_1 = require("../automation/utils/uniquify-environmen
34
34
  const to_environment_key_1 = require("../automation/utils/to-environment-key");
35
35
  const abort_error_1 = require("../errors/abort-error");
36
36
  const utils = __importStar(require("@applitools/utils"));
37
+ const lang = __importStar(require("../lang"));
37
38
  const chalk_1 = __importDefault(require("chalk"));
38
39
  function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultEnvironments = [], spec, signal, logger: mainLogger, }) {
39
40
  return async function checkAndClose({ target = defaultTarget, settings = {}, logger = mainLogger, } = {}) {
@@ -132,8 +133,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
132
133
  const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
133
134
  const ufgEnvironment = environment;
134
135
  if (utils.types.has(ufgEnvironment, 'name') && ufgEnvironment.name === 'edge') {
135
- const message = chalk_1.default.yellow(`The 'edge' option that is being used in your browsers' configuration will soon be deprecated. Please change it to either 'edgelegacy' for the legacy version or to 'edgechromium' for the new Chromium-based version. Please note, when using the built-in BrowserType enum, then the values are BrowserType.EDGE_LEGACY and BrowserType.EDGE_CHROMIUM, respectively.`);
136
- environmentLogger.console.log(message);
136
+ environmentLogger.console.log(chalk_1.default.yellow(lang.edgeUfgEnvironmentDeprecatedWarning));
137
137
  }
138
138
  try {
139
139
  if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
package/dist/ufg/check.js CHANGED
@@ -34,6 +34,7 @@ const uniquify_environments_1 = require("../automation/utils/uniquify-environmen
34
34
  const to_environment_key_1 = require("../automation/utils/to-environment-key");
35
35
  const abort_error_1 = require("../errors/abort-error");
36
36
  const utils = __importStar(require("@applitools/utils"));
37
+ const lang = __importStar(require("../lang"));
37
38
  const chalk_1 = __importDefault(require("chalk"));
38
39
  function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironments = [], spec, signal, logger: mainLogger, }) {
39
40
  return async function check({ target = defaultTarget, settings = {}, logger = mainLogger, } = {}) {
@@ -132,8 +133,7 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
132
133
  const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
133
134
  const ufgEnvironment = environment;
134
135
  if (utils.types.has(ufgEnvironment, 'name') && ufgEnvironment.name === 'edge') {
135
- const message = chalk_1.default.yellow(`The 'edge' option that is being used in your browsers' configuration will soon be deprecated. Please change it to either 'edgelegacy' for the legacy version or to 'edgechromium' for the new Chromium-based version. Please note, when using the built-in BrowserType enum, then the values are BrowserType.EDGE_LEGACY and BrowserType.EDGE_CHROMIUM, respectively.`);
136
- environmentLogger.console.log(message);
136
+ environmentLogger.console.log(chalk_1.default.yellow(lang.edgeUfgEnvironmentDeprecatedWarning));
137
137
  }
138
138
  try {
139
139
  if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
@@ -35,9 +35,10 @@ const calculate_regions_1 = require("./calculate-regions");
35
35
  const wait_for_lazy_load_1 = require("../../automation/utils/wait-for-lazy-load");
36
36
  const chalk_1 = __importDefault(require("chalk"));
37
37
  const utils = __importStar(require("@applitools/utils"));
38
+ const lang = __importStar(require("../../lang"));
38
39
  __exportStar(require("./take-dom-snapshot"), exports);
39
40
  async function takeDomSnapshots({ driver, settings, hooks, provides, logger, }) {
40
- var _a, _b, _c, _d, _e, _f;
41
+ var _a, _b, _c, _d, _e, _f, _g;
41
42
  // calculating cookies here once so that we (a) don't do it for each dom snapshot, and (b) do it before generating safe selectors
42
43
  const features = await driver.getFeatures();
43
44
  settings.cookies = features.allCookies ? await driver.getCookies().catch(() => []) : [];
@@ -58,9 +59,9 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
58
59
  logger,
59
60
  });
60
61
  }
61
- if (!settings.layoutBreakpoints) {
62
+ if (!((_a = settings.layoutBreakpoints) === null || _a === void 0 ? void 0 : _a.breakpoints)) {
62
63
  logger.log(`taking single dom snapshot`);
63
- await ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _a === void 0 ? void 0 : _a.call(hooks));
64
+ await ((_b = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _b === void 0 ? void 0 : _b.call(hooks));
64
65
  await waitBeforeCapture();
65
66
  // it's important that we calculate safe selectors as close as possible to taking the dom snapshot
66
67
  if (settings.calculateRegionsOptions) {
@@ -70,10 +71,10 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
70
71
  });
71
72
  }
72
73
  const snapshot = await (0, take_dom_snapshot_1.takeDomSnapshot)({ context: currentContext, settings, logger });
73
- await ((_b = calculateRegionsResults === null || calculateRegionsResults === void 0 ? void 0 : calculateRegionsResults.cleanupGeneratedSelectors) === null || _b === void 0 ? void 0 : _b.call(calculateRegionsResults));
74
+ await ((_c = calculateRegionsResults === null || calculateRegionsResults === void 0 ? void 0 : calculateRegionsResults.cleanupGeneratedSelectors) === null || _c === void 0 ? void 0 : _c.call(calculateRegionsResults));
74
75
  return Array(settings.environments.length).fill({ snapshot, ...calculateRegionsResults });
75
76
  }
76
- const isStrictBreakpoints = utils.types.isArray((_c = settings.layoutBreakpoints) === null || _c === void 0 ? void 0 : _c.breakpoints);
77
+ const isStrictBreakpoints = utils.types.isArray((_d = settings.layoutBreakpoints) === null || _d === void 0 ? void 0 : _d.breakpoints);
77
78
  const requiredWidths = await settings.environments.reduce(async (prev, environment, index) => {
78
79
  const { name, width } = (await extractEnvironmentInfo(environment));
79
80
  const requiredWidths = await prev;
@@ -88,12 +89,11 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
88
89
  }, Promise.resolve(new Map()));
89
90
  const smallestBreakpoint = Math.min(...(isStrictBreakpoints ? settings.layoutBreakpoints.breakpoints : []));
90
91
  if (isStrictBreakpoints && requiredWidths.has(smallestBreakpoint - 1)) {
91
- const smallestBrowsers = requiredWidths
92
- .get(smallestBreakpoint - 1)
93
- .map(({ name, width }) => `(${name}, ${width})`)
94
- .join(', ');
95
- const message = chalk_1.default.yellow(`The following configuration's viewport-widths are smaller than the smallest configured layout breakpoint (${smallestBreakpoint} pixels): [${smallestBrowsers}]. As a fallback, the resources that will be used for these configurations have been captured on a viewport-width of ${smallestBreakpoint} - 1 pixels. If an additional layout breakpoint is needed for you to achieve better results - please add it to your configuration.`);
96
- logger.console.log(message);
92
+ const message = lang.requestedEnvironmentSmallerThenBreakpointWarning({
93
+ breakpoint: smallestBreakpoint,
94
+ browsers: requiredWidths.get(smallestBreakpoint - 1),
95
+ });
96
+ logger.console.log(chalk_1.default.yellow(message));
97
97
  }
98
98
  logger.log(`taking multiple dom snapshots for breakpoints:`, settings.layoutBreakpoints.breakpoints);
99
99
  logger.log(`required widths: ${[...requiredWidths.keys()].join(', ')}`);
@@ -101,7 +101,7 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
101
101
  const snapshotsResults = Array(settings.environments.length);
102
102
  if (requiredWidths.has(viewportSize.width)) {
103
103
  logger.log(`taking dom snapshot for existing width ${viewportSize.width}`);
104
- await ((_d = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _d === void 0 ? void 0 : _d.call(hooks));
104
+ await ((_e = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _e === void 0 ? void 0 : _e.call(hooks));
105
105
  await waitBeforeCapture();
106
106
  // it's important that we calculate safe selectors as close as possible to taking the dom snapshot
107
107
  if (settings.calculateRegionsOptions) {
@@ -120,26 +120,32 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
120
120
  try {
121
121
  await driver.setViewportSize({ width: requiredWidth, height: viewportSize.height });
122
122
  }
123
- catch (err) {
124
- logger.error(err);
123
+ catch (error) {
124
+ logger.error(`Failed to set viewport size to ${requiredWidth} du to error: `, error);
125
125
  const actualViewportSize = await driver.getViewportSize();
126
126
  if (isStrictBreakpoints) {
127
- const failedBrowsers = browsersInfo.map(({ name, width }) => `(${name}, ${width})`).join(', ');
128
- const message = chalk_1.default.yellow(`One of the configured layout breakpoints is ${requiredWidth} pixels, while your local browser has a limit of ${actualViewportSize.width}, so the SDK couldn't resize it to the desired size. As a fallback, the resources that will be used for the following configurations: [${failedBrowsers}] have been captured on the browser's limit (${actualViewportSize.width} pixels). To resolve this, you may use a headless browser as it can be resized to any size.`);
129
- logger.console.log(message);
127
+ const message = lang.breakpointOutOfDriverBoundsWarning({
128
+ requiredWidth,
129
+ actualWidth: actualViewportSize.width,
130
+ browsers: browsersInfo,
131
+ });
132
+ logger.console.log(chalk_1.default.yellow(message));
130
133
  logger.log(message);
131
134
  }
132
135
  else {
133
- const failedBrowsers = browsersInfo.map(({ name }) => `(${name})`).join(', ');
134
- const message = chalk_1.default.yellow(`The following configurations [${failedBrowsers}] have a viewport-width of ${requiredWidth} pixels, while your local browser has a limit of ${actualViewportSize.width} pixels, so the SDK couldn't resize it to the desired size. As a fallback, the resources that will be used for these checkpoints have been captured on the browser's limit (${actualViewportSize.width} pixels). To resolve this, you may use a headless browser as it can be resized to any size.`);
135
- logger.console.log(message);
136
+ const message = lang.requestedEnvironmentOutOfDriverBoundsWarning({
137
+ requiredWidth,
138
+ actualWidth: actualViewportSize.width,
139
+ browsers: browsersInfo,
140
+ });
141
+ logger.console.log(chalk_1.default.yellow(message));
136
142
  logger.log(message);
137
143
  }
138
144
  }
139
145
  if (settings.layoutBreakpoints.reload) {
140
146
  await driver.reloadPage();
141
147
  }
142
- await ((_e = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _e === void 0 ? void 0 : _e.call(hooks));
148
+ await ((_f = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _f === void 0 ? void 0 : _f.call(hooks));
143
149
  await waitBeforeCapture();
144
150
  if (settings.layoutBreakpoints.reload) {
145
151
  // it's important that we calculate safe selectors as close as possible to taking the dom snapshot
@@ -161,7 +167,7 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
161
167
  await waitBeforeCapture();
162
168
  }
163
169
  else {
164
- (_f = calculateRegionsResults === null || calculateRegionsResults === void 0 ? void 0 : calculateRegionsResults.cleanupGeneratedSelectors) === null || _f === void 0 ? void 0 : _f.call(calculateRegionsResults);
170
+ (_g = calculateRegionsResults === null || calculateRegionsResults === void 0 ? void 0 : calculateRegionsResults.cleanupGeneratedSelectors) === null || _g === void 0 ? void 0 : _g.call(calculateRegionsResults);
165
171
  }
166
172
  return snapshotsResults;
167
173
  function calculateBreakpoint({ breakpoints, value }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -69,18 +69,18 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@applitools/core-base": "1.7.2",
72
- "@applitools/dom-capture": "11.2.3",
73
- "@applitools/dom-snapshot": "4.7.12",
74
- "@applitools/driver": "1.14.4",
75
- "@applitools/ec-client": "1.7.14",
72
+ "@applitools/dom-capture": "11.2.4",
73
+ "@applitools/dom-snapshot": "4.7.13",
74
+ "@applitools/driver": "1.15.0",
75
+ "@applitools/ec-client": "1.7.15",
76
76
  "@applitools/logger": "2.0.12",
77
- "@applitools/nml-client": "1.5.14",
77
+ "@applitools/nml-client": "1.5.15",
78
78
  "@applitools/req": "1.6.2",
79
- "@applitools/screenshoter": "3.8.14",
79
+ "@applitools/screenshoter": "3.8.15",
80
80
  "@applitools/snippets": "2.4.24",
81
81
  "@applitools/socket": "1.1.12",
82
- "@applitools/spec-driver-webdriver": "1.0.48",
83
- "@applitools/ufg-client": "1.9.6",
82
+ "@applitools/spec-driver-webdriver": "1.0.49",
83
+ "@applitools/ufg-client": "1.9.7",
84
84
  "@applitools/utils": "1.6.2",
85
85
  "@types/ws": "8.5.5",
86
86
  "abort-controller": "3.0.0",
@@ -91,10 +91,10 @@
91
91
  "yargs": "17.7.2"
92
92
  },
93
93
  "devDependencies": {
94
- "@applitools/bongo": "^5.7.0",
94
+ "@applitools/bongo": "^5.7.4",
95
95
  "@applitools/sea": "^1.0.0",
96
- "@applitools/spec-driver-puppeteer": "^1.2.4",
97
- "@applitools/spec-driver-selenium": "^1.5.62",
96
+ "@applitools/spec-driver-puppeteer": "^1.2.5",
97
+ "@applitools/spec-driver-selenium": "^1.5.63",
98
98
  "@applitools/test-server": "^1.2.2",
99
99
  "@applitools/test-utils": "^1.5.17",
100
100
  "@applitools/tunnel-client": "^1.3.0",
@@ -0,0 +1,27 @@
1
+ export declare const matchLevelContentDeprecatedWarning = "The \"Content\" match level value has been deprecated, use \"IgnoreColors\" instead.";
2
+ export declare const edgeUfgEnvironmentDeprecatedWarning = "The 'edge' option that is being used in your browsers' configuration will soon be deprecated. Please change it to either 'edgelegacy' for the legacy version or to 'edgechromium' for the new Chromium-based version. Please note, when using the built-in BrowserType enum, then the values are BrowserType.EDGE_LEGACY and BrowserType.EDGE_CHROMIUM, respectively.";
3
+ export declare const requestedEnvironmentSmallerThenBreakpointWarning: (options: {
4
+ breakpoint: number;
5
+ browsers: {
6
+ name: string;
7
+ width: number;
8
+ }[];
9
+ }) => string;
10
+ export declare const breakpointOutOfDriverBoundsWarning: (options: {
11
+ requiredWidth: number;
12
+ actualWidth: number;
13
+ browsers: {
14
+ name: string;
15
+ width: number;
16
+ }[];
17
+ }) => string;
18
+ export declare const requestedEnvironmentOutOfDriverBoundsWarning: (options: {
19
+ requiredWidth: number;
20
+ actualWidth: number;
21
+ browsers: {
22
+ name: string;
23
+ }[];
24
+ }) => string;
25
+ export declare const applitoolsLibConflictingCapabilitiesWarning: (options: {
26
+ conflictingCapabilities: Record<string, any>;
27
+ }) => string;