@applitools/eyes-browser 1.0.4 → 1.0.6

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,93 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.6](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.5...js/eyes-browser@1.0.6) (2024-01-30)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/snippets bumped to 2.4.25
9
+ #### Bug Fixes
10
+
11
+ * losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
12
+ * @applitools/spec-driver-webdriver bumped to 1.0.55
13
+
14
+ * @applitools/spec-driver-selenium bumped to 1.5.69
15
+
16
+ * @applitools/spec-driver-puppeteer bumped to 1.3.5
17
+
18
+ * @applitools/driver bumped to 1.16.2
19
+ #### Bug Fixes
20
+
21
+ * losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
22
+
23
+
24
+
25
+ * @applitools/core bumped to 4.7.0
26
+ #### Features
27
+
28
+ * added support of proxy server url env var ([#2159](https://github.com/applitools/eyes.sdk.javascript1/issues/2159)) ([2f69c3d](https://github.com/applitools/eyes.sdk.javascript1/commit/2f69c3d37d7af9be1f459fd3d5f41b361161b5bf))
29
+
30
+
31
+ #### Bug Fixes
32
+
33
+ * losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
34
+
35
+
36
+
37
+ * @applitools/screenshoter bumped to 3.8.21
38
+
39
+ * @applitools/nml-client bumped to 1.6.5
40
+
41
+ * @applitools/ec-client bumped to 1.7.23
42
+
43
+ * @applitools/eyes bumped to 1.13.6
44
+
45
+
46
+ ## [1.0.5](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.4...js/eyes-browser@1.0.5) (2024-01-16)
47
+
48
+
49
+ ### Dependencies
50
+
51
+ * @applitools/dom-snapshot bumped to 4.7.16
52
+ #### Bug Fixes
53
+
54
+ * handle unparsable values of media attribute in dom snapshot ([a2afe2e](https://github.com/applitools/eyes.sdk.javascript1/commit/a2afe2e18508f44f9c046270da0c1e09fb9aea03))
55
+ * @applitools/nml-client bumped to 1.6.4
56
+ #### Bug Fixes
57
+
58
+ * remove local environment id ([#2152](https://github.com/applitools/eyes.sdk.javascript1/issues/2152)) ([59aaeae](https://github.com/applitools/eyes.sdk.javascript1/commit/59aaeaed474fbde78b76ae7ac803960e3ecd8166))
59
+ * @applitools/core bumped to 4.6.0
60
+ #### Features
61
+
62
+ * 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))
63
+
64
+
65
+ #### Bug Fixes
66
+
67
+ * 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))
68
+ * remove local environment id ([#2152](https://github.com/applitools/eyes.sdk.javascript1/issues/2152)) ([59aaeae](https://github.com/applitools/eyes.sdk.javascript1/commit/59aaeaed474fbde78b76ae7ac803960e3ecd8166))
69
+
70
+
71
+
72
+ * @applitools/ec-client bumped to 1.7.22
73
+
74
+ * @applitools/core-base bumped to 1.9.0
75
+ #### Features
76
+
77
+ * 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))
78
+
79
+
80
+ #### Bug Fixes
81
+
82
+ * 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))
83
+ * @applitools/eyes bumped to 1.13.5
84
+ #### Bug Fixes
85
+
86
+ * fixed default value in `useSystemScreenshot` method of check settings ([42a773c](https://github.com/applitools/eyes.sdk.javascript1/commit/42a773cc57e8e5de528a049b376159615892003b))
87
+
88
+
89
+
90
+
3
91
  ## [1.0.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.3...js/eyes-browser@1.0.4) (2024-01-02)
4
92
 
5
93
 
package/dist/index.js CHANGED
@@ -20360,7 +20360,9 @@ var require_requests = __commonJS({
20360
20360
  ignoreBaseline: settings.ignoreBaseline,
20361
20361
  saveDiffs: settings.saveDiffs,
20362
20362
  timeout: settings.abortIdleTestTimeout,
20363
- isComponentAgent: settings.isComponentTest
20363
+ isComponentAgent: settings.isComponentTest,
20364
+ fallbackExpectedOutput: settings.fallbackBaselineId
20365
+ // mapping to the right field is the api
20364
20366
  }
20365
20367
  },
20366
20368
  expected: [200, 201],
@@ -21058,25 +21060,34 @@ var require_extract_branching_timestamp = __commonJS({
21058
21060
  Object.defineProperty(exports, "__esModule", { value: true });
21059
21061
  exports.extractBranchingTimestamp = void 0;
21060
21062
  var utils34 = __importStar(require_browser3());
21063
+ var logger_1 = require_browser6();
21061
21064
  exports.extractBranchingTimestamp = utils34.general.cachify(extractGitBranchingTimestamp);
21062
- async function extractGitBranchingTimestamp({ branchName, parentBranchName }, options) {
21065
+ async function extractGitBranchingTimestamp({ branchName, parentBranchName, execOptions, logger = (0, logger_1.makeLogger)() }) {
21063
21066
  var _a;
21067
+ logger = logger.extend({ tags: [`extract-branching-timestamp-${utils34.general.shortid()}`] });
21064
21068
  const command = `HASH=$(git merge-base ${branchName} ${parentBranchName}) && git show -q --format=%cI $HASH`;
21065
- let result = await utils34.process.execute(command, options);
21069
+ let result = await executeWithLog(command);
21066
21070
  if (result.stderr) {
21067
21071
  const [, missingBranch] = (_a = result.stderr.match(/Not a valid object name ([^\s]+)/)) !== null && _a !== void 0 ? _a : [];
21068
21072
  if (missingBranch) {
21069
- result = await utils34.process.execute(`git fetch origin ${missingBranch}:${missingBranch} && ${command}`, options);
21073
+ result = await executeWithLog(`git fetch origin ${missingBranch}:${missingBranch} && ${command}`);
21070
21074
  }
21071
21075
  }
21072
21076
  if (!result.stdout) {
21073
- result = await utils34.process.execute(`git fetch origin --unshallow && ${command}`, options);
21077
+ result = await executeWithLog(`git fetch origin --unshallow && ${command}`);
21074
21078
  }
21075
21079
  const timestamp = result.stdout.replace(/\s/g, "");
21076
21080
  if (!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}/.test(timestamp)) {
21077
21081
  throw new Error(`stderr: ${result.stderr}, stdout: ${result.stdout}`);
21078
21082
  }
21079
21083
  return timestamp;
21084
+ async function executeWithLog(command2) {
21085
+ logger.log(`executing command: ${command2}`);
21086
+ const result2 = await utils34.process.execute(command2, execOptions);
21087
+ if (result2.stderr && result2.code)
21088
+ logger.log(`exit code: ${result2.code}, stderr: ${result2.stderr}`);
21089
+ return result2;
21090
+ }
21080
21091
  }
21081
21092
  }
21082
21093
  });
@@ -27807,7 +27818,12 @@ var require_open_eyes = __commonJS({
27807
27818
  parentBranchName = branches.parentBranchName;
27808
27819
  }
27809
27820
  if (branchName && parentBranchName && branchName !== parentBranchName) {
27810
- settings.gitBranchingTimestamp = await (0, extract_branching_timestamp_1.extractBranchingTimestamp)({ branchName, parentBranchName }, { cwd });
27821
+ settings.gitBranchingTimestamp = await (0, extract_branching_timestamp_1.extractBranchingTimestamp)({
27822
+ branchName,
27823
+ parentBranchName,
27824
+ execOptions: { cwd },
27825
+ logger
27826
+ });
27811
27827
  logger.log("Branching timestamp successfully extracted", settings.gitBranchingTimestamp);
27812
27828
  }
27813
27829
  } catch (err) {
@@ -27821,9 +27837,14 @@ var require_open_eyes = __commonJS({
27821
27837
  return new Promise((resolve, reject) => {
27822
27838
  throttle(() => {
27823
27839
  return new Promise(async (done) => {
27840
+ var _a2;
27824
27841
  try {
27825
27842
  const controller = new abort_controller_1.AbortController();
27826
27843
  const eyesRequests = await requests.openEyes({ settings, logger });
27844
+ eyesRequests.test.ufgServer = {
27845
+ ...eyesRequests.test.ufgServer,
27846
+ ufgServerUrl: (_a2 = settings.ufgServerUrl) !== null && _a2 !== void 0 ? _a2 : eyesRequests.test.ufgServer.ufgServerUrl
27847
+ };
27827
27848
  resolve(utils34.general.extend(eyesRequests, {
27828
27849
  check: (0, check_1.makeCheck)({ requests: eyesRequests, signal: controller.signal, logger }),
27829
27850
  checkAndClose: (0, check_and_close_1.makeCheckAndClose)({ requests: eyesRequests, done, signal: controller.signal, logger }),
@@ -28706,7 +28727,7 @@ var require_dist3 = __commonJS({
28706
28727
  return t(function() {
28707
28728
  var t2, n, r;
28708
28729
  try {
28709
- t2 = window.top.document === window.document || "root-context" === window.document["applitools-marker"];
28730
+ t2 = window.top.document === window.document || "root-context" === window.parent.document["applitools-marker"];
28710
28731
  } catch (e2) {
28711
28732
  t2 = false;
28712
28733
  }
@@ -31769,7 +31790,10 @@ var require_driver = __commonJS({
31769
31790
  this._currentContext = context;
31770
31791
  }
31771
31792
  async reloadPage() {
31772
- await this.mainContext.execute(snippets.reloadPage).catch(() => null);
31793
+ if (this._spec.reload)
31794
+ await this._spec.reload(this.target);
31795
+ else
31796
+ await this.mainContext.execute(snippets.reloadPage).catch(() => null);
31773
31797
  const refreshThis = await this.refresh({ reset: false });
31774
31798
  const scrollingElement = await this.mainContext.getScrollingElement();
31775
31799
  await (scrollingElement === null || scrollingElement === void 0 ? void 0 : scrollingElement.refresh());
@@ -32611,6 +32635,59 @@ var require_set_viewport_size = __commonJS({
32611
32635
  }
32612
32636
  });
32613
32637
 
32638
+ // ../core/dist/utils/populate-eyes-server-settings.js
32639
+ var require_populate_eyes_server_settings = __commonJS({
32640
+ "../core/dist/utils/populate-eyes-server-settings.js"(exports) {
32641
+ "use strict";
32642
+ init_process();
32643
+ init_setImmediate();
32644
+ init_buffer();
32645
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
32646
+ if (k2 === void 0)
32647
+ k2 = k;
32648
+ var desc = Object.getOwnPropertyDescriptor(m, k);
32649
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32650
+ desc = { enumerable: true, get: function() {
32651
+ return m[k];
32652
+ } };
32653
+ }
32654
+ Object.defineProperty(o, k2, desc);
32655
+ } : function(o, m, k, k2) {
32656
+ if (k2 === void 0)
32657
+ k2 = k;
32658
+ o[k2] = m[k];
32659
+ });
32660
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
32661
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
32662
+ } : function(o, v) {
32663
+ o["default"] = v;
32664
+ });
32665
+ var __importStar = exports && exports.__importStar || function(mod) {
32666
+ if (mod && mod.__esModule)
32667
+ return mod;
32668
+ var result = {};
32669
+ if (mod != null) {
32670
+ for (var k in mod)
32671
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
32672
+ __createBinding(result, mod, k);
32673
+ }
32674
+ __setModuleDefault(result, mod);
32675
+ return result;
32676
+ };
32677
+ Object.defineProperty(exports, "__esModule", { value: true });
32678
+ exports.populateEyesServerSettings = void 0;
32679
+ var utils34 = __importStar(require_browser3());
32680
+ function populateEyesServerSettings(settings) {
32681
+ var _a, _b, _c, _d, _e, _f;
32682
+ (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : settings.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
32683
+ (_d = settings.apiKey) !== null && _d !== void 0 ? _d : settings.apiKey = utils34.general.getEnvValue("API_KEY");
32684
+ (_e = settings.proxy) !== null && _e !== void 0 ? _e : settings.proxy = utils34.general.getEnvValue("PROXY_URL") ? { url: utils34.general.getEnvValue("PROXY_URL") } : void 0;
32685
+ (_f = settings.useDnsCache) !== null && _f !== void 0 ? _f : settings.useDnsCache = utils34.general.getEnvValue("USE_DNS_CACHE", "boolean");
32686
+ }
32687
+ exports.populateEyesServerSettings = populateEyesServerSettings;
32688
+ }
32689
+ });
32690
+
32614
32691
  // ../core/dist/get-account-info.js
32615
32692
  var require_get_account_info2 = __commonJS({
32616
32693
  "../core/dist/get-account-info.js"(exports) {
@@ -32652,13 +32729,12 @@ var require_get_account_info2 = __commonJS({
32652
32729
  };
32653
32730
  Object.defineProperty(exports, "__esModule", { value: true });
32654
32731
  exports.makeGetAccountInfo = void 0;
32732
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
32655
32733
  var utils34 = __importStar(require_browser3());
32656
32734
  function makeGetAccountInfo({ core, logger: mainLogger }) {
32657
32735
  return async function getAccountInfo({ settings, logger = mainLogger }) {
32658
- var _a, _b, _c, _d;
32659
32736
  logger = logger.extend(mainLogger, { tags: [`get-account-info-${utils34.general.shortid()}`] });
32660
- (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : settings.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
32661
- (_d = settings.apiKey) !== null && _d !== void 0 ? _d : settings.apiKey = utils34.general.getEnvValue("API_KEY");
32737
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
32662
32738
  return core.base.getAccountInfo({ settings, logger });
32663
32739
  };
32664
32740
  }
@@ -32837,7 +32913,6 @@ var require_requests2 = __commonJS({
32837
32913
  function makeNMLRequests({ settings, logger: mainLogger }) {
32838
32914
  let brokerUrl = settings.brokerUrl;
32839
32915
  const req2 = (0, req_broker_1.makeReqBroker)({ settings, logger: mainLogger });
32840
- const localEnvironmentId = utils34.general.guid();
32841
32916
  const getSupportedEnvironmentsWithCache = utils34.general.cachify(getSupportedEnvironments, () => "default");
32842
32917
  return {
32843
32918
  getSupportedEnvironments: getSupportedEnvironmentsWithCache,
@@ -32856,7 +32931,7 @@ var require_requests2 = __commonJS({
32856
32931
  const { localEnvironment, renderEnvironments, environmentSettings } = settings2.environments.reduce((result, environment) => {
32857
32932
  var _a;
32858
32933
  if (!utils34.types.has(environment, "iosDeviceInfo") && !utils34.types.has(environment, "androidDeviceInfo")) {
32859
- result.localEnvironment = { ...environment, environmentId: localEnvironmentId };
32934
+ result.localEnvironment = environment;
32860
32935
  } else {
32861
32936
  const deviceInfo = utils34.types.has(environment, "iosDeviceInfo") ? environment.iosDeviceInfo : environment.androidDeviceInfo;
32862
32937
  const orientation = deviceInfo.screenOrientation === "landscape" ? "landscapeLeft" : (_a = deviceInfo.screenOrientation) !== null && _a !== void 0 ? _a : "portrait";
@@ -35539,11 +35614,13 @@ var require_get_base_eyes = __commonJS({
35539
35614
  });
35540
35615
  return getBaseEyesWithCache;
35541
35616
  async function getBaseEyes({ settings, logger = mainLogger }) {
35617
+ var _a;
35542
35618
  logger = logger.extend(mainLogger);
35543
35619
  logger.log(`Command "getBaseEyes" is called with settings`, settings);
35544
35620
  return eyes.core.base.openEyes({
35545
35621
  settings: {
35546
35622
  ...defaultSettings,
35623
+ fallbackBaselineId: (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId,
35547
35624
  environment: { ...defaultSettings.environment, ...settings.environment }
35548
35625
  },
35549
35626
  logger
@@ -36428,6 +36505,7 @@ var require_extract_default_environments = __commonJS({
36428
36505
  const viewport = await driver.getViewport();
36429
36506
  const size = await driver.getViewportSize();
36430
36507
  environment.viewportSize = utils34.geometry.scale(size, viewport.viewportScale);
36508
+ environment.environmentId = utils34.general.guid();
36431
36509
  if (driverEnvironment.isEC)
36432
36510
  environment.ecSessionId = (_a = await driver.getSessionId()) !== null && _a !== void 0 ? _a : void 0;
36433
36511
  if (driverEnvironment.isWeb)
@@ -36531,7 +36609,7 @@ var require_open_eyes2 = __commonJS({
36531
36609
  const controller = new abort_controller_1.AbortController();
36532
36610
  const account = await core.getAccountInfo({ settings, logger });
36533
36611
  return utils34.general.extend({}, (eyes) => {
36534
- var _a2;
36612
+ var _a2, _b2, _c2;
36535
36613
  return {
36536
36614
  type: "classic",
36537
36615
  core,
@@ -36540,7 +36618,7 @@ var require_open_eyes2 = __commonJS({
36540
36618
  batchId: (_a2 = settings.batch) === null || _a2 === void 0 ? void 0 : _a2.id,
36541
36619
  keepBatchOpen: settings.keepBatchOpen,
36542
36620
  eyesServer: account.eyesServer,
36543
- ufgServer: account.ufgServer,
36621
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_b2 = settings.ufgServerUrl) !== null && _b2 !== void 0 ? _b2 : (_c2 = account.ufgServer) === null || _c2 === void 0 ? void 0 : _c2.ufgServerUrl },
36544
36622
  uploadUrl: account.uploadUrl,
36545
36623
  stitchingServiceUrl: account.stitchingServiceUrl,
36546
36624
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -36677,14 +36755,13 @@ var require_locate3 = __commonJS({
36677
36755
  Object.defineProperty(exports, "__esModule", { value: true });
36678
36756
  exports.makeLocate = void 0;
36679
36757
  var core_1 = require_core2();
36758
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
36680
36759
  var utils34 = __importStar(require_browser3());
36681
36760
  function makeLocate({ spec, core, logger: mainLogger }) {
36682
36761
  return async function locate({ target, settings, config, logger = mainLogger }) {
36683
- var _a, _b, _c, _d;
36684
36762
  logger = logger.extend(mainLogger, { tags: [`locate-${utils34.general.shortid()}`] });
36685
36763
  settings = { ...config === null || config === void 0 ? void 0 : config.open, ...config === null || config === void 0 ? void 0 : config.screenshot, ...settings };
36686
- (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : settings.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
36687
- (_d = settings.apiKey) !== null && _d !== void 0 ? _d : settings.apiKey = utils34.general.getEnvValue("API_KEY");
36764
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
36688
36765
  const classicCore = (0, core_1.makeCore)({ spec, base: core.base, logger });
36689
36766
  const results = await classicCore.locate({ target, settings, logger });
36690
36767
  return results;
@@ -36736,14 +36813,13 @@ var require_locate_text3 = __commonJS({
36736
36813
  Object.defineProperty(exports, "__esModule", { value: true });
36737
36814
  exports.makeLocateText = void 0;
36738
36815
  var core_1 = require_core2();
36816
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
36739
36817
  var utils34 = __importStar(require_browser3());
36740
36818
  function makeLocateText({ spec, core, logger: mainLogger }) {
36741
36819
  return async function locateText({ target, settings, config, logger = mainLogger }) {
36742
- var _a, _b, _c, _d;
36743
36820
  logger = logger.extend(mainLogger, { tags: [`locate-text-${utils34.general.shortid()}`] });
36744
36821
  settings = { ...config === null || config === void 0 ? void 0 : config.open, ...config === null || config === void 0 ? void 0 : config.screenshot, ...settings };
36745
- (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : settings.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
36746
- (_d = settings.apiKey) !== null && _d !== void 0 ? _d : settings.apiKey = utils34.general.getEnvValue("API_KEY");
36822
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
36747
36823
  const classicCore = (0, core_1.makeCore)({ spec, base: core.base, logger });
36748
36824
  const results = await classicCore.locateText({ target, settings, logger });
36749
36825
  return results;
@@ -36795,17 +36871,17 @@ var require_extract_text3 = __commonJS({
36795
36871
  Object.defineProperty(exports, "__esModule", { value: true });
36796
36872
  exports.makeExtractText = void 0;
36797
36873
  var core_1 = require_core2();
36874
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
36798
36875
  var utils34 = __importStar(require_browser3());
36799
36876
  function makeExtractText({ spec, core, logger: mainLogger }) {
36800
36877
  return async function extractText({ target, settings, config, logger = mainLogger }) {
36801
36878
  logger = logger.extend(mainLogger, { tags: [`extract-text-${utils34.general.shortid()}`] });
36802
36879
  settings = utils34.types.isArray(settings) ? settings : [settings];
36803
36880
  settings = settings.map((settings2) => {
36804
- var _a, _b, _c, _d, _e;
36881
+ var _a;
36805
36882
  settings2 = { ...config === null || config === void 0 ? void 0 : config.open, ...config === null || config === void 0 ? void 0 : config.screenshot, ...settings2 };
36806
36883
  (_a = settings2.userCommandId) !== null && _a !== void 0 ? _a : settings2.userCommandId = `extract-text--${utils34.general.guid()}`;
36807
- (_b = settings2.eyesServerUrl) !== null && _b !== void 0 ? _b : settings2.eyesServerUrl = (_d = (_c = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _c !== void 0 ? _c : utils34.general.getEnvValue("SERVER_URL")) !== null && _d !== void 0 ? _d : "https://eyesapi.applitools.com";
36808
- (_e = settings2.apiKey) !== null && _e !== void 0 ? _e : settings2.apiKey = utils34.general.getEnvValue("API_KEY");
36884
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings2);
36809
36885
  return settings2;
36810
36886
  });
36811
36887
  const classicCore = (0, core_1.makeCore)({ spec, base: core.base, logger });
@@ -76334,6 +76410,7 @@ var require_get_base_eyes2 = __commonJS({
76334
76410
  });
76335
76411
  return getBaseEyesWithCache;
76336
76412
  async function getBaseEyes({ settings, logger = mainLogger }) {
76413
+ var _a;
76337
76414
  logger = logger.extend(mainLogger);
76338
76415
  logger.log(`Command "getBaseEyes" is called with settings`, settings);
76339
76416
  const ufgClient = await eyes.core.getUFGClient({
@@ -76351,6 +76428,7 @@ var require_get_base_eyes2 = __commonJS({
76351
76428
  return eyes.core.base.openEyes({
76352
76429
  settings: {
76353
76430
  ...defaultSettings,
76431
+ fallbackBaselineId: (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId,
76354
76432
  environment: { ...defaultSettings.environment, ...environment, properties: settings.environment.properties }
76355
76433
  },
76356
76434
  logger
@@ -80393,20 +80471,24 @@ var require_processPagePollCjs = __commonJS({
80393
80471
  const { display: n3 } = t4.defaultView.getComputedStyle(e4), { width: r2, height: o2 } = e4.getBoundingClientRect();
80394
80472
  return "none" === n3 || 0 === r2 || 0 === o2;
80395
80473
  }, uh = function(e4) {
80396
- return Gu.toPlainObject(Gu.parse(e4.toLowerCase(), { context: "mediaQueryList" })).children.some((e5) => {
80397
- const t4 = e5.children.reduce((e6, t5) => ("Identifier" === t5.type && "and" === t5.name ? e6.push([]) : e6[e6.length - 1].push(t5), e6), [[]]);
80398
- return t4.every((e6) => {
80399
- let t5, n3;
80400
- if (1 === e6.length)
80401
- [n3] = e6;
80402
- else {
80403
- if (2 !== e6.length)
80404
- return false;
80405
- [t5, n3] = e6;
80406
- }
80407
- return !(t5 && ("Identifier" !== t5.type || !["not", "only"].includes(t5.name))) && ("MediaFeature" === n3.type || ("Identifier" === n3.type && ["all", "screen"].includes(n3.name) ? !t5 || "not" !== t5.name : t5 && "not" === t5.name));
80474
+ try {
80475
+ return Gu.toPlainObject(Gu.parse(e4.toLowerCase(), { context: "mediaQueryList" })).children.some((e5) => {
80476
+ const t4 = e5.children.reduce((e6, t5) => ("Identifier" === t5.type && "and" === t5.name ? e6.push([]) : e6[e6.length - 1].push(t5), e6), [[]]);
80477
+ return t4.every((e6) => {
80478
+ let t5, n3;
80479
+ if (1 === e6.length)
80480
+ [n3] = e6;
80481
+ else {
80482
+ if (2 !== e6.length)
80483
+ return false;
80484
+ [t5, n3] = e6;
80485
+ }
80486
+ return !(t5 && ("Identifier" !== t5.type || !["not", "only"].includes(t5.name))) && ("MediaFeature" === n3.type || ("Identifier" === n3.type && ["all", "screen"].includes(n3.name) ? !t5 || "not" !== t5.name : t5 && "not" === t5.name));
80487
+ });
80408
80488
  });
80409
- });
80489
+ } catch {
80490
+ return false;
80491
+ }
80410
80492
  }, hh = Qu, dh = Su, ph = /* @__PURE__ */ new Set(["date", "datetime-local", "email", "month", "number", "password", "search", "tel", "text", "time", "url", "week"]), mh = /^on[a-z]+$/;
80411
80493
  function fh({ attributes: e4 = {} }) {
80412
80494
  return Object.keys(e4).filter((t4) => e4[t4] && e4[t4].name);
@@ -82073,7 +82155,7 @@ creating temp style for access.`), r2 = Em(e4);
82073
82155
  function D2(e5) {
82074
82156
  return t5.defaultView && t5.defaultView.frameElement && t5.defaultView.frameElement.getAttribute(e5);
82075
82157
  }
82076
- }(t4).then((e4) => (u2("processPage end"), e4.scriptVersion = "4.7.15", e4));
82158
+ }(t4).then((e4) => (u2("processPage end"), e4.scriptVersion = "4.7.16", e4));
82077
82159
  };
82078
82160
  window[mf] = window[mf] || {};
82079
82161
  const bf = pf(gf, window[mf], ff);
@@ -83324,7 +83406,7 @@ var require_open_eyes3 = __commonJS({
83324
83406
  const controller = new abort_controller_1.AbortController();
83325
83407
  const account = await core.getAccountInfo({ settings, logger });
83326
83408
  return utils34.general.extend({}, (eyes) => {
83327
- var _a2;
83409
+ var _a2, _b2, _c2;
83328
83410
  return {
83329
83411
  type: "ufg",
83330
83412
  core,
@@ -83333,7 +83415,7 @@ var require_open_eyes3 = __commonJS({
83333
83415
  batchId: (_a2 = settings.batch) === null || _a2 === void 0 ? void 0 : _a2.id,
83334
83416
  keepBatchOpen: settings.keepBatchOpen,
83335
83417
  eyesServer: account.eyesServer,
83336
- ufgServer: account.ufgServer,
83418
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_b2 = settings.ufgServerUrl) !== null && _b2 !== void 0 ? _b2 : (_c2 = account.ufgServer) === null || _c2 === void 0 ? void 0 : _c2.ufgServerUrl },
83337
83419
  uploadUrl: account.uploadUrl,
83338
83420
  stitchingServiceUrl: account.stitchingServiceUrl,
83339
83421
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -83870,28 +83952,28 @@ var require_open_eyes4 = __commonJS({
83870
83952
  var close_1 = require_close3();
83871
83953
  var abort_1 = require_abort3();
83872
83954
  var get_eyes_results_1 = require_get_eyes_results();
83955
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
83873
83956
  var utils34 = __importStar(require_browser3());
83874
83957
  function makeOpenEyes({ type: defaultType = "classic", clients, batch, core, cores, spec, environment, logger: mainLogger, asyncCache }) {
83875
83958
  return async function openEyes({ type = defaultType, settings, config, target, logger = mainLogger }) {
83876
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
83877
- var _v, _w, _x, _y;
83959
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
83960
+ var _r, _s, _t, _u;
83878
83961
  logger = logger.extend(mainLogger, { tags: [`eyes-${type}-${utils34.general.shortid()}`] });
83879
83962
  settings = { ...config === null || config === void 0 ? void 0 : config.open, ...settings };
83963
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
83880
83964
  (_a = settings.userTestId) !== null && _a !== void 0 ? _a : settings.userTestId = `${settings.testName}--${utils34.general.guid()}`;
83881
- (_b = settings.eyesServerUrl) !== null && _b !== void 0 ? _b : settings.eyesServerUrl = (_d = (_c = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _c !== void 0 ? _c : utils34.general.getEnvValue("SERVER_URL")) !== null && _d !== void 0 ? _d : "https://eyesapi.applitools.com";
83882
- (_e = settings.apiKey) !== null && _e !== void 0 ? _e : settings.apiKey = utils34.general.getEnvValue("API_KEY");
83883
- (_f = settings.useDnsCache) !== null && _f !== void 0 ? _f : settings.useDnsCache = utils34.general.getEnvValue("USE_DNS_CACHE", "boolean");
83884
83965
  settings.batch = { ...batch, ...settings.batch };
83885
- (_g = (_v = settings.batch).id) !== null && _g !== void 0 ? _g : _v.id = (_h = utils34.general.getEnvValue("BATCH_ID")) !== null && _h !== void 0 ? _h : `generated-${utils34.general.guid()}`;
83886
- (_j = (_w = settings.batch).name) !== null && _j !== void 0 ? _j : _w.name = utils34.general.getEnvValue("BATCH_NAME");
83887
- (_k = (_x = settings.batch).sequenceName) !== null && _k !== void 0 ? _k : _x.sequenceName = utils34.general.getEnvValue("BATCH_SEQUENCE");
83888
- (_l = (_y = settings.batch).notifyOnCompletion) !== null && _l !== void 0 ? _l : _y.notifyOnCompletion = utils34.general.getEnvValue("BATCH_NOTIFY", "boolean");
83889
- (_m = settings.keepBatchOpen) !== null && _m !== void 0 ? _m : settings.keepBatchOpen = utils34.general.getEnvValue("DONT_CLOSE_BATCHES", "boolean");
83890
- (_o = settings.branchName) !== null && _o !== void 0 ? _o : settings.branchName = utils34.general.getEnvValue("BRANCH");
83891
- (_p = settings.parentBranchName) !== null && _p !== void 0 ? _p : settings.parentBranchName = utils34.general.getEnvValue("PARENT_BRANCH");
83892
- (_q = settings.baselineBranchName) !== null && _q !== void 0 ? _q : settings.baselineBranchName = utils34.general.getEnvValue("BASELINE_BRANCH");
83893
- (_r = settings.ignoreBaseline) !== null && _r !== void 0 ? _r : settings.ignoreBaseline = false;
83894
- (_s = settings.compareWithParentBranch) !== null && _s !== void 0 ? _s : settings.compareWithParentBranch = false;
83966
+ (_b = (_r = settings.batch).id) !== null && _b !== void 0 ? _b : _r.id = (_c = utils34.general.getEnvValue("BATCH_ID")) !== null && _c !== void 0 ? _c : `generated-${utils34.general.guid()}`;
83967
+ (_d = (_s = settings.batch).name) !== null && _d !== void 0 ? _d : _s.name = utils34.general.getEnvValue("BATCH_NAME");
83968
+ (_e = (_t = settings.batch).sequenceName) !== null && _e !== void 0 ? _e : _t.sequenceName = utils34.general.getEnvValue("BATCH_SEQUENCE");
83969
+ (_f = (_u = settings.batch).notifyOnCompletion) !== null && _f !== void 0 ? _f : _u.notifyOnCompletion = utils34.general.getEnvValue("BATCH_NOTIFY", "boolean");
83970
+ (_g = settings.keepBatchOpen) !== null && _g !== void 0 ? _g : settings.keepBatchOpen = utils34.general.getEnvValue("DONT_CLOSE_BATCHES", "boolean");
83971
+ (_h = settings.branchName) !== null && _h !== void 0 ? _h : settings.branchName = utils34.general.getEnvValue("BRANCH");
83972
+ (_j = settings.parentBranchName) !== null && _j !== void 0 ? _j : settings.parentBranchName = utils34.general.getEnvValue("PARENT_BRANCH");
83973
+ (_k = settings.baselineBranchName) !== null && _k !== void 0 ? _k : settings.baselineBranchName = utils34.general.getEnvValue("BASELINE_BRANCH");
83974
+ (_l = settings.ufgServerUrl) !== null && _l !== void 0 ? _l : settings.ufgServerUrl = utils34.general.getEnvValue("UFG_SERVER_URL");
83975
+ (_m = settings.ignoreBaseline) !== null && _m !== void 0 ? _m : settings.ignoreBaseline = false;
83976
+ (_o = settings.compareWithParentBranch) !== null && _o !== void 0 ? _o : settings.compareWithParentBranch = false;
83895
83977
  const driver = target && await (0, driver_1.makeDriver)({ spec, driver: target, logger, customConfig: settings });
83896
83978
  const driverEnvironment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
83897
83979
  const driverUrl = await (driver === null || driver === void 0 ? void 0 : driver.getDriverUrl());
@@ -83902,7 +83984,7 @@ var require_open_eyes4 = __commonJS({
83902
83984
  event: {
83903
83985
  type: "openEyes",
83904
83986
  userTestId: settings.userTestId,
83905
- concurrency: (_t = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _t !== void 0 ? _t : core.concurrency,
83987
+ concurrency: (_p = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _p !== void 0 ? _p : core.concurrency,
83906
83988
  environment,
83907
83989
  driver: {
83908
83990
  deviceName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.deviceName,
@@ -83910,7 +83992,7 @@ var require_open_eyes4 = __commonJS({
83910
83992
  browserVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.browserVersion,
83911
83993
  platformName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformName,
83912
83994
  platformVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformVersion,
83913
- isApplitoolsLib: (_u = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _u === void 0 ? void 0 : _u.instrumented,
83995
+ isApplitoolsLib: (_q = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _q === void 0 ? void 0 : _q.instrumented,
83914
83996
  isEC: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.isEC
83915
83997
  },
83916
83998
  driverUrl
@@ -84195,7 +84277,7 @@ var require_make_manager = __commonJS({
84195
84277
  var _g;
84196
84278
  logger = logger.extend(mainLogger, { tags: [`manager-${type}-${utils34.general.shortid()}`] });
84197
84279
  settings !== null && settings !== void 0 ? settings : settings = {};
84198
- (_a = settings.concurrency) !== null && _a !== void 0 ? _a : settings.concurrency = (_b = utils34.general.getEnvValue("CONCURRENCY", "number")) !== null && _b !== void 0 ? _b : utils34.types.isInteger(settings.legacyConcurrency) ? settings.legacyConcurrency * 5 : 5;
84280
+ (_a = settings.concurrency) !== null && _a !== void 0 ? _a : settings.concurrency = (_b = utils34.general.getEnvValue("CONCURRENCY", "number")) !== null && _b !== void 0 ? _b : utils34.types.isInteger(settings.legacyConcurrency) ? settings.legacyConcurrency * 5 : 100;
84199
84281
  (_c = settings.batch) !== null && _c !== void 0 ? _c : settings.batch = {};
84200
84282
  (_d = (_g = settings.batch).id) !== null && _d !== void 0 ? _d : _g.id = (_e = utils34.general.getEnvValue("BATCH_ID")) !== null && _e !== void 0 ? _e : `generated-${utils34.general.guid()}`;
84201
84283
  (_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;
@@ -84265,14 +84347,13 @@ var require_close_batch2 = __commonJS({
84265
84347
  };
84266
84348
  Object.defineProperty(exports, "__esModule", { value: true });
84267
84349
  exports.makeCloseBatch = void 0;
84350
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
84268
84351
  var utils34 = __importStar(require_browser3());
84269
84352
  function makeCloseBatch({ core, logger: mainLogger }) {
84270
84353
  return async function closeBatch2({ settings, logger = mainLogger }) {
84271
84354
  logger = logger.extend(mainLogger, { tags: [`close-batch-${utils34.general.shortid()}`] });
84272
84355
  (utils34.types.isArray(settings) ? settings : [settings]).forEach((settings2) => {
84273
- var _a, _b, _c, _d;
84274
- (_a = settings2.eyesServerUrl) !== null && _a !== void 0 ? _a : settings2.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
84275
- (_d = settings2.apiKey) !== null && _d !== void 0 ? _d : settings2.apiKey = utils34.general.getEnvValue("API_KEY");
84356
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings2);
84276
84357
  });
84277
84358
  return core.base.closeBatch({ settings, logger });
84278
84359
  };
@@ -84322,14 +84403,13 @@ var require_delete_test2 = __commonJS({
84322
84403
  };
84323
84404
  Object.defineProperty(exports, "__esModule", { value: true });
84324
84405
  exports.makeDeleteTest = void 0;
84406
+ var populate_eyes_server_settings_1 = require_populate_eyes_server_settings();
84325
84407
  var utils34 = __importStar(require_browser3());
84326
84408
  function makeDeleteTest({ core, logger: mainLogger }) {
84327
84409
  return async function deleteTest({ settings, logger = mainLogger }) {
84328
84410
  logger = logger.extend(mainLogger, { tags: [`delete-test-${utils34.general.shortid()}`] });
84329
84411
  (utils34.types.isArray(settings) ? settings : [settings]).forEach((settings2) => {
84330
- var _a, _b, _c, _d;
84331
- (_a = settings2.eyesServerUrl) !== null && _a !== void 0 ? _a : settings2.eyesServerUrl = (_c = (_b = utils34.general.getEnvValue("EYES_SERVER_URL")) !== null && _b !== void 0 ? _b : utils34.general.getEnvValue("SERVER_URL")) !== null && _c !== void 0 ? _c : "https://eyesapi.applitools.com";
84332
- (_d = settings2.apiKey) !== null && _d !== void 0 ? _d : settings2.apiKey = utils34.general.getEnvValue("API_KEY");
84412
+ (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings2);
84333
84413
  });
84334
84414
  return core.base.deleteTest({ settings, logger });
84335
84415
  };
@@ -84401,7 +84481,7 @@ var require_package2 = __commonJS({
84401
84481
  "../core/package.json"(exports, module) {
84402
84482
  module.exports = {
84403
84483
  name: "@applitools/core",
84404
- version: "4.5.2",
84484
+ version: "4.7.0",
84405
84485
  homepage: "https://applitools.com",
84406
84486
  bugs: {
84407
84487
  url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -87049,6 +87129,9 @@ var require_spec_driver3 = __commonJS({
87049
87129
  },
87050
87130
  async switchWorld(driver, name) {
87051
87131
  return socket.request("Driver.switchWorld", { driver, name });
87132
+ },
87133
+ async reload(driver) {
87134
+ return socket.request("Driver.reload", { driver });
87052
87135
  }
87053
87136
  };
87054
87137
  return spec.reduce((spec2, name) => {
@@ -88142,7 +88225,7 @@ var require_package3 = __commonJS({
88142
88225
  "../eyes/package.json"(exports, module) {
88143
88226
  module.exports = {
88144
88227
  name: "@applitools/eyes",
88145
- version: "1.13.4",
88228
+ version: "1.13.6",
88146
88229
  keywords: [
88147
88230
  "applitools",
88148
88231
  "eyes",
@@ -90054,7 +90137,7 @@ var CheckSettingsAutomationFluent = class extends CheckSettingsBaseFluent {
90054
90137
  visualGridOptions(options) {
90055
90138
  return this.ufgOptions(options);
90056
90139
  }
90057
- useSystemScreenshot(useSystemScreenshot) {
90140
+ useSystemScreenshot(useSystemScreenshot = true) {
90058
90141
  this._settings.useSystemScreenshot = useSystemScreenshot;
90059
90142
  return this;
90060
90143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-browser",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "browser",
@@ -48,7 +48,7 @@
48
48
  "test": "run --top-level mocha './test/**/*.spec.ts'"
49
49
  },
50
50
  "dependencies": {
51
- "@applitools/eyes": "1.13.4"
51
+ "@applitools/eyes": "1.13.6"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^12.20.55",
@@ -204,7 +204,7 @@ export declare class CheckSettingsAutomationFluent<TSpec extends Core.SpecType =
204
204
  visualGridOptions(options: {
205
205
  [key: string]: any;
206
206
  }): this;
207
- useSystemScreenshot(useSystemScreenshot: boolean): this;
207
+ useSystemScreenshot(useSystemScreenshot?: boolean): this;
208
208
  timeout(timeout: number): this;
209
209
  waitBeforeCapture(waitBeforeCapture: number): this;
210
210
  lazyLoad(options?: LazyLoadOptions | boolean): this;