@applitools/eyes-browser 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/index.js +251 -127
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,88 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.2...js/eyes-browser@1.0.3) (2023-12-19)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/spec-driver-webdriver bumped to 1.0.54
9
+ #### Bug Fixes
10
+
11
+ * fixed extraction of the driver server url ([ddc6449](https://github.com/applitools/eyes.sdk.javascript1/commit/ddc6449fc72166ab26c99e9ba7bb83c05fd591d6))
12
+
13
+
14
+
15
+ * @applitools/spec-driver-selenium bumped to 1.5.68
16
+
17
+ * @applitools/spec-driver-puppeteer bumped to 1.3.4
18
+
19
+ * @applitools/driver bumped to 1.16.1
20
+ #### Bug Fixes
21
+
22
+ * fixed bug with screenshot not being properly scaled on ios devices with appium 2 ([#2092](https://github.com/applitools/eyes.sdk.javascript1/issues/2092)) ([26678bf](https://github.com/applitools/eyes.sdk.javascript1/commit/26678bfe254def506ea82e6a645519d6567fb3fd))
23
+ * fixed extraction of the driver server url ([ddc6449](https://github.com/applitools/eyes.sdk.javascript1/commit/ddc6449fc72166ab26c99e9ba7bb83c05fd591d6))
24
+ * fixed infinite loop that may appear during attribute extraction ([#2102](https://github.com/applitools/eyes.sdk.javascript1/issues/2102)) ([6bef680](https://github.com/applitools/eyes.sdk.javascript1/commit/6bef680fbd2d5c26a46cf2a4f00bd083d1d02109))
25
+ * @applitools/screenshoter bumped to 3.8.20
26
+ #### Bug Fixes
27
+
28
+ * fixed bug with screenshot not being properly scaled on ios devices with appium 2 ([#2092](https://github.com/applitools/eyes.sdk.javascript1/issues/2092)) ([26678bf](https://github.com/applitools/eyes.sdk.javascript1/commit/26678bfe254def506ea82e6a645519d6567fb3fd))
29
+
30
+
31
+
32
+ * @applitools/nml-client bumped to 1.6.2
33
+
34
+ * @applitools/ec-client bumped to 1.7.20
35
+
36
+ * @applitools/core-base bumped to 1.7.5
37
+ #### Bug Fixes
38
+
39
+ * avoid caching concurrency ([#2103](https://github.com/applitools/eyes.sdk.javascript1/issues/2103)) ([34db2e9](https://github.com/applitools/eyes.sdk.javascript1/commit/34db2e9c554b0851b18b514b1a8a82b83ff310cd))
40
+ * @applitools/core bumped to 4.5.1
41
+ #### Bug Fixes
42
+
43
+ * avoid caching concurrency ([#2103](https://github.com/applitools/eyes.sdk.javascript1/issues/2103)) ([34db2e9](https://github.com/applitools/eyes.sdk.javascript1/commit/34db2e9c554b0851b18b514b1a8a82b83ff310cd))
44
+
45
+
46
+
47
+ * @applitools/eyes bumped to 1.13.3
48
+
49
+
50
+ ## [1.0.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.1...js/eyes-browser@1.0.2) (2023-12-18)
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * @applitools/core bumped to 4.5.0
56
+ #### Features
57
+
58
+ * add set of env variables to skip/ignore some optional automations ([#2097](https://github.com/applitools/eyes.sdk.javascript1/issues/2097)) ([bd3b08c](https://github.com/applitools/eyes.sdk.javascript1/commit/bd3b08c3d2997eb98d545b308a1f15501192178e))
59
+
60
+
61
+ #### Bug Fixes
62
+
63
+ * fixed issue when page wasn't reloaded for one of the breakpoints if the initial viewport size matches it ([9038723](https://github.com/applitools/eyes.sdk.javascript1/commit/9038723ee68515f7d4fe20ed31ec501df9a381dc))
64
+
65
+
66
+
67
+ * @applitools/spec-driver-webdriver bumped to 1.0.53
68
+
69
+ * @applitools/spec-driver-selenium bumped to 1.5.67
70
+
71
+ * @applitools/spec-driver-puppeteer bumped to 1.3.3
72
+
73
+ * @applitools/driver bumped to 1.16.0
74
+ #### Features
75
+
76
+ * add set of env variables to skip/ignore some optional automations ([#2097](https://github.com/applitools/eyes.sdk.javascript1/issues/2097)) ([bd3b08c](https://github.com/applitools/eyes.sdk.javascript1/commit/bd3b08c3d2997eb98d545b308a1f15501192178e))
77
+ * @applitools/screenshoter bumped to 3.8.19
78
+
79
+ * @applitools/nml-client bumped to 1.6.1
80
+
81
+ * @applitools/ec-client bumped to 1.7.19
82
+
83
+ * @applitools/eyes bumped to 1.13.2
84
+
85
+
3
86
  ## [1.0.1](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-browser@1.0.0...js/eyes-browser@1.0.1) (2023-12-12)
4
87
 
5
88
 
package/dist/index.js CHANGED
@@ -20284,18 +20284,19 @@ var require_requests = __commonJS({
20284
20284
  return result;
20285
20285
  };
20286
20286
  Object.defineProperty(exports, "__esModule", { value: true });
20287
- exports.makeFunctionalSessionRequests = exports.makeEyesRequests = exports.makeCoreRequests = void 0;
20287
+ exports.makeCoreRequestsWithCache = void 0;
20288
20288
  var logger_1 = require_browser6();
20289
20289
  var req_eyes_1 = require_req_eyes();
20290
20290
  var upload_1 = require_upload();
20291
20291
  var utils34 = __importStar(require_browser3());
20292
- function makeCoreRequests({ agentId: defaultAgentId, fetch: fetch2, logger: defaultLogger }) {
20292
+ exports.makeCoreRequestsWithCache = utils34.general.cachify(makeCoreRequests, () => "default");
20293
+ function makeCoreRequests({ fetch: fetch2, logger: defaultLogger } = {}) {
20293
20294
  const mainLogger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: "core-requests" } });
20294
20295
  const getAccountInfoWithCache = utils34.general.cachify(getAccountInfo, ([{ settings }]) => {
20295
- return [settings.eyesServerUrl, settings.apiKey];
20296
+ return [settings.eyesServerUrl, settings.apiKey, settings.proxy];
20296
20297
  });
20297
20298
  const getBatchBranchesWithCache = utils34.general.cachify(getBatchBranches, ([{ settings }]) => {
20298
- return [settings.batchId, settings.eyesServerUrl, settings.apiKey];
20299
+ return [settings.batchId, settings.eyesServerUrl, settings.apiKey, settings.proxy];
20299
20300
  });
20300
20301
  const core = {
20301
20302
  getAccountInfo: getAccountInfoWithCache,
@@ -20313,8 +20314,7 @@ var require_requests = __commonJS({
20313
20314
  async function openEyes({ settings, logger = mainLogger }) {
20314
20315
  var _a, _b, _c, _d, _e, _f;
20315
20316
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20316
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20317
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20317
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20318
20318
  logger.log('Request "openEyes" called with settings', settings);
20319
20319
  const accountPromise = getAccountInfoWithCache({ settings });
20320
20320
  const initializedAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -20323,7 +20323,7 @@ var require_requests = __commonJS({
20323
20323
  method: "POST",
20324
20324
  body: {
20325
20325
  startInfo: {
20326
- agentId,
20326
+ agentId: settings.agentId,
20327
20327
  agentSessionId: settings.userTestId,
20328
20328
  agentRunId: settings.userTestId,
20329
20329
  sessionType: settings.sessionType,
@@ -20398,8 +20398,7 @@ var require_requests = __commonJS({
20398
20398
  async function openFunctionalSession({ settings, logger = mainLogger }) {
20399
20399
  var _a, _b, _c, _d, _e, _f;
20400
20400
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20401
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20402
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20401
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20403
20402
  logger.log('Request "openFunctionalSession" called with settings', settings);
20404
20403
  const accountPromise = getAccountInfoWithCache({ settings });
20405
20404
  const initializedAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -20408,7 +20407,7 @@ var require_requests = __commonJS({
20408
20407
  method: "POST",
20409
20408
  body: {
20410
20409
  startInfo: {
20411
- agentId,
20410
+ agentId: settings.agentId,
20412
20411
  agentSessionId: settings.userTestId,
20413
20412
  agentRunId: settings.userTestId,
20414
20413
  sessionType: settings.sessionType,
@@ -20464,8 +20463,7 @@ var require_requests = __commonJS({
20464
20463
  }
20465
20464
  async function locate({ target, settings, logger = mainLogger }) {
20466
20465
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20467
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20468
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20466
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20469
20467
  logger.log('Request "locate" called for target', target, "with settings", settings);
20470
20468
  const account = await getAccountInfoWithCache({ settings });
20471
20469
  const upload = (0, upload_1.makeUpload)({ settings: { uploadUrl: account.uploadUrl, proxy: settings.proxy }, logger });
@@ -20494,8 +20492,7 @@ var require_requests = __commonJS({
20494
20492
  }
20495
20493
  async function locateText({ target, settings, logger = mainLogger }) {
20496
20494
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20497
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20498
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20495
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20499
20496
  logger.log('Request "locateText" called for target', target, "with settings", settings);
20500
20497
  const account = await getAccountInfoWithCache({ settings });
20501
20498
  const upload = (0, upload_1.makeUpload)({ settings: { uploadUrl: account.uploadUrl, proxy: settings.proxy }, logger });
@@ -20526,8 +20523,7 @@ var require_requests = __commonJS({
20526
20523
  }
20527
20524
  async function extractText({ target, settings, logger = mainLogger }) {
20528
20525
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20529
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20530
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20526
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20531
20527
  logger.log('Request "extractText" called for target', target, "with settings", settings);
20532
20528
  const account = await getAccountInfoWithCache({ settings });
20533
20529
  const upload = (0, upload_1.makeUpload)({ settings: { uploadUrl: account.uploadUrl, proxy: settings.proxy }, logger });
@@ -20557,8 +20553,7 @@ var require_requests = __commonJS({
20557
20553
  }
20558
20554
  async function getAccountInfo({ settings, logger = mainLogger }) {
20559
20555
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20560
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20561
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20556
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20562
20557
  logger.log('Request "getAccountInfo" called with settings', settings);
20563
20558
  const response = await req2("/api/sessions/renderinfo", {
20564
20559
  name: "getAccountInfo",
@@ -20572,14 +20567,14 @@ var require_requests = __commonJS({
20572
20567
  eyesServer: {
20573
20568
  eyesServerUrl: settings.eyesServerUrl,
20574
20569
  apiKey: settings.apiKey,
20575
- agentId,
20570
+ agentId: settings.agentId,
20576
20571
  proxy: settings.proxy,
20577
20572
  useDnsCache: settings.useDnsCache
20578
20573
  },
20579
20574
  ufgServer: {
20580
20575
  ufgServerUrl,
20581
20576
  accessToken,
20582
- agentId,
20577
+ agentId: settings.agentId,
20583
20578
  proxy: settings.proxy,
20584
20579
  useDnsCache: settings.useDnsCache
20585
20580
  },
@@ -20593,8 +20588,7 @@ var require_requests = __commonJS({
20593
20588
  }
20594
20589
  async function getBatchBranches({ settings, logger = mainLogger }) {
20595
20590
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20596
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20597
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20591
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20598
20592
  logger.log('Request "getBatchBranches" called with settings', settings);
20599
20593
  const response = await req2(`/api/sessions/batches/${settings.batchId}/config/bypointerId`, {
20600
20594
  name: "getBatchBranches",
@@ -20609,8 +20603,7 @@ var require_requests = __commonJS({
20609
20603
  }
20610
20604
  async function closeBatch2({ settings, logger = mainLogger }) {
20611
20605
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20612
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20613
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20606
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20614
20607
  logger.log('Request "closeBatch" called with settings', settings);
20615
20608
  await req2(`/api/sessions/batches/${settings.batchId}/close/bypointerId`, {
20616
20609
  name: "closeBatch",
@@ -20622,8 +20615,7 @@ var require_requests = __commonJS({
20622
20615
  }
20623
20616
  async function deleteTest({ settings, logger = mainLogger }) {
20624
20617
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20625
- const agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
20626
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings, agentId }, fetch: fetch2, logger });
20618
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20627
20619
  logger.log('Request "deleteTest" called with settings', settings);
20628
20620
  await req2(`/api/sessions/batches/${settings.batchId}/${settings.testId}`, {
20629
20621
  name: "deleteTest",
@@ -20639,8 +20631,7 @@ var require_requests = __commonJS({
20639
20631
  async function logEvent({ settings, logger = mainLogger }) {
20640
20632
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20641
20633
  settings = utils34.types.isArray(settings) ? settings : [settings];
20642
- const agentId = `${defaultAgentId} ${settings[0].agentId ? `[${settings[0].agentId}]` : ""}`.trim();
20643
- const req2 = (0, req_eyes_1.makeReqEyes)({ settings: { ...settings[0], agentId }, fetch: fetch2, logger });
20634
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings: settings[0], fetch: fetch2, logger });
20644
20635
  logger.log('Request "logEvent" called with settings', settings);
20645
20636
  await req2(`/api/sessions/log`, {
20646
20637
  name: "logEvent",
@@ -20661,7 +20652,6 @@ var require_requests = __commonJS({
20661
20652
  logger.log('Request "logEvent" finished successfully');
20662
20653
  }
20663
20654
  }
20664
- exports.makeCoreRequests = makeCoreRequests;
20665
20655
  function makeEyesRequests({ core, test, req: req2, upload, logger: mainLogger }) {
20666
20656
  let resultResponsePromise;
20667
20657
  let supportsCheckAndClose = true;
@@ -20834,7 +20824,6 @@ var require_requests = __commonJS({
20834
20824
  }
20835
20825
  }
20836
20826
  }
20837
- exports.makeEyesRequests = makeEyesRequests;
20838
20827
  function makeFunctionalSessionRequests({ core, test, req: req2, logger: mainLogger }) {
20839
20828
  let resultResponsePromise;
20840
20829
  const functionalSession = {
@@ -20931,7 +20920,6 @@ var require_requests = __commonJS({
20931
20920
  }
20932
20921
  }
20933
20922
  }
20934
- exports.makeFunctionalSessionRequests = makeFunctionalSessionRequests;
20935
20923
  function transformCheckOptions({ target, settings }) {
20936
20924
  var _a, _b;
20937
20925
  return {
@@ -27798,12 +27786,11 @@ var require_open_eyes = __commonJS({
27798
27786
  var get_results_1 = require_get_results();
27799
27787
  var throat_1 = __importDefault(require_throat());
27800
27788
  var utils34 = __importStar(require_browser3());
27801
- function makeOpenEyes({ requests, concurrency, cwd = process.cwd(), logger: mainLogger }) {
27789
+ function makeOpenEyes({ requests, agentId: defaultAgentId, concurrency, cwd = process.cwd(), logger: mainLogger }) {
27802
27790
  const throttle = concurrency ? (0, throat_1.default)(concurrency) : (fn) => fn();
27803
27791
  return async function openEyes({ settings, logger = mainLogger }) {
27804
27792
  var _a;
27805
27793
  logger = logger.extend(mainLogger, { tags: [`eyes-base-${utils34.general.shortid()}`] });
27806
- logger.log('Command "openEyes" is called with settings', settings);
27807
27794
  if (!settings.ignoreGitBranching && !settings.gitBranchingTimestamp) {
27808
27795
  let branchName = settings.branchName;
27809
27796
  let parentBranchName = settings.parentBranchName;
@@ -27823,6 +27810,8 @@ var require_open_eyes = __commonJS({
27823
27810
  } else {
27824
27811
  settings.gitBranchingTimestamp = void 0;
27825
27812
  }
27813
+ settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
27814
+ logger.log('Command "openEyes" is called with settings', settings);
27826
27815
  return new Promise((resolve, reject) => {
27827
27816
  throttle(() => {
27828
27817
  return new Promise(async (done) => {
@@ -27899,10 +27888,11 @@ var require_open_functional_session = __commonJS({
27899
27888
  var get_results_1 = require_get_results();
27900
27889
  var throat_1 = __importDefault(require_throat());
27901
27890
  var utils34 = __importStar(require_browser3());
27902
- function makeOpenFunctionalSession({ requests, concurrency, logger: mainLogger }) {
27891
+ function makeOpenFunctionalSession({ requests, agentId: defaultAgentId, concurrency, logger: mainLogger }) {
27903
27892
  const throttle = concurrency ? (0, throat_1.default)(concurrency) : (fn) => fn();
27904
27893
  return async function openFunctionalSession({ settings, logger = mainLogger }) {
27905
27894
  logger = logger.extend(mainLogger, { tags: [`functional-session-base-${utils34.general.shortid()}`] });
27895
+ settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
27906
27896
  logger.log('Command "openFunctionalSession" is called with settings', settings);
27907
27897
  return new Promise((resolve, reject) => {
27908
27898
  throttle(() => {
@@ -27971,7 +27961,7 @@ var require_locate = __commonJS({
27971
27961
  exports.makeLocate = void 0;
27972
27962
  var transform_target_1 = require_transform_target();
27973
27963
  var utils34 = __importStar(require_browser3());
27974
- function makeLocate({ requests, logger: mainLogger }) {
27964
+ function makeLocate({ requests, agentId: defaultAgentId, logger: mainLogger }) {
27975
27965
  return async function locate({ target, settings, logger = mainLogger }) {
27976
27966
  var _a, _b, _c, _d, _e;
27977
27967
  logger = logger.extend(mainLogger, { tags: [`locate-base-${utils34.general.shortid()}`] });
@@ -27981,6 +27971,7 @@ var require_locate = __commonJS({
27981
27971
  maxImageHeight: Math.min((_c = (_b = settings.normalization.limit) === null || _b === void 0 ? void 0 : _b.maxImageHeight) !== null && _c !== void 0 ? _c : Infinity, account.maxImageHeight),
27982
27972
  maxImageArea: Math.min((_e = (_d = settings.normalization.limit) === null || _d === void 0 ? void 0 : _d.maxImageArea) !== null && _e !== void 0 ? _e : Infinity, account.maxImageArea)
27983
27973
  };
27974
+ settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
27984
27975
  logger.log('Command "locate" is called with settings', settings);
27985
27976
  target = await (0, transform_target_1.transformTarget)({ target, settings });
27986
27977
  const results = await requests.locate({ target, settings, logger });
@@ -28034,7 +28025,7 @@ var require_locate_text = __commonJS({
28034
28025
  exports.makeLocateText = void 0;
28035
28026
  var transform_target_1 = require_transform_target();
28036
28027
  var utils34 = __importStar(require_browser3());
28037
- function makeLocateText({ requests, logger: mainLogger }) {
28028
+ function makeLocateText({ requests, agentId: defaultAgentId, logger: mainLogger }) {
28038
28029
  return async function locateText({ target, settings, logger = mainLogger }) {
28039
28030
  var _a, _b, _c, _d, _e;
28040
28031
  logger = logger.extend(mainLogger, { tags: [`locate-text-base-${utils34.general.shortid()}`] });
@@ -28044,6 +28035,7 @@ var require_locate_text = __commonJS({
28044
28035
  maxImageHeight: Math.min((_c = (_b = settings.normalization.limit) === null || _b === void 0 ? void 0 : _b.maxImageHeight) !== null && _c !== void 0 ? _c : Infinity, account.maxImageHeight),
28045
28036
  maxImageArea: Math.min((_e = (_d = settings.normalization.limit) === null || _d === void 0 ? void 0 : _d.maxImageArea) !== null && _e !== void 0 ? _e : Infinity, account.maxImageArea)
28046
28037
  };
28038
+ settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
28047
28039
  logger.log('Command "locateText" is called with settings', settings);
28048
28040
  target = await (0, transform_target_1.transformTarget)({ target, settings });
28049
28041
  const results = await requests.locateText({ target, settings, logger });
@@ -28097,12 +28089,10 @@ var require_extract_text = __commonJS({
28097
28089
  exports.makeExtractText = void 0;
28098
28090
  var transform_target_1 = require_transform_target();
28099
28091
  var utils34 = __importStar(require_browser3());
28100
- function makeExtractText({ requests, logger: mainLogger }) {
28092
+ function makeExtractText({ requests, agentId: defaultAgentId, logger: mainLogger }) {
28101
28093
  return async function extractText({ target, settings, logger = mainLogger }) {
28102
28094
  logger = logger.extend(mainLogger, { tags: [`extract-text-base-${utils34.general.shortid()}`] });
28103
- logger.log('Command "extractText" is called with settings', settings);
28104
- settings = utils34.types.isArray(settings) ? settings : [settings];
28105
- const results = await Promise.all(settings.map(async (settings2) => {
28095
+ settings = await Promise.all((utils34.types.isArray(settings) ? settings : [settings]).map(async (settings2) => {
28106
28096
  var _a, _b, _c, _d, _e;
28107
28097
  const account = await requests.getAccountInfo({ settings: settings2, logger });
28108
28098
  (_a = settings2.normalization) !== null && _a !== void 0 ? _a : settings2.normalization = {};
@@ -28110,6 +28100,11 @@ var require_extract_text = __commonJS({
28110
28100
  maxImageHeight: Math.min((_c = (_b = settings2.normalization.limit) === null || _b === void 0 ? void 0 : _b.maxImageHeight) !== null && _c !== void 0 ? _c : Infinity, account.maxImageHeight),
28111
28101
  maxImageArea: Math.min((_e = (_d = settings2.normalization.limit) === null || _d === void 0 ? void 0 : _d.maxImageArea) !== null && _e !== void 0 ? _e : Infinity, account.maxImageArea)
28112
28102
  };
28103
+ settings2.agentId = `${defaultAgentId} ${settings2.agentId ? `[${settings2.agentId}]` : ""}`.trim();
28104
+ return settings2;
28105
+ }));
28106
+ logger.log('Command "extractText" is called with settings', settings);
28107
+ const results = await Promise.all(settings.map(async (settings2) => {
28113
28108
  target = await (0, transform_target_1.transformTarget)({ target, settings: settings2 });
28114
28109
  return requests.extractText({ target, settings: settings2, logger });
28115
28110
  }));
@@ -28162,11 +28157,14 @@ var require_close_batch = __commonJS({
28162
28157
  Object.defineProperty(exports, "__esModule", { value: true });
28163
28158
  exports.makeCloseBatch = void 0;
28164
28159
  var utils34 = __importStar(require_browser3());
28165
- function makeCloseBatch({ requests, logger: mainLogger }) {
28160
+ function makeCloseBatch({ requests, agentId: defaultAgentId, logger: mainLogger }) {
28166
28161
  return async function closeBatch2({ settings, logger = mainLogger }) {
28167
28162
  logger = logger.extend(mainLogger, { tags: [`close-batch-base-${utils34.general.shortid()}`] });
28163
+ settings = (utils34.types.isArray(settings) ? settings : [settings]).map((settings2) => {
28164
+ settings2.agentId = `${defaultAgentId} ${settings2.agentId ? `[${settings2.agentId}]` : ""}`.trim();
28165
+ return settings2;
28166
+ });
28168
28167
  logger.log('Command "closeBatch" is called with settings', settings);
28169
- settings = utils34.types.isArray(settings) ? settings : [settings];
28170
28168
  const results = await Promise.allSettled(settings.map((settings2) => settings2.batchId ? requests.closeBatch({ settings: settings2, logger }) : null));
28171
28169
  const error = results.find(({ status }) => status === "rejected");
28172
28170
  if (error)
@@ -28219,11 +28217,14 @@ var require_delete_test = __commonJS({
28219
28217
  Object.defineProperty(exports, "__esModule", { value: true });
28220
28218
  exports.makeDeleteTest = void 0;
28221
28219
  var utils34 = __importStar(require_browser3());
28222
- function makeDeleteTest({ requests, logger: mainLogger }) {
28220
+ function makeDeleteTest({ requests, agentId: defaultAgentId, logger: mainLogger }) {
28223
28221
  return async function deleteTest({ settings, logger = mainLogger }) {
28224
28222
  logger = logger.extend(mainLogger, { tags: [`delete-test-base-${utils34.general.shortid()}`] });
28223
+ settings = (utils34.types.isArray(settings) ? settings : [settings]).map((settings2) => {
28224
+ settings2.agentId = `${defaultAgentId} ${settings2.agentId ? `[${settings2.agentId}]` : ""}`.trim();
28225
+ return settings2;
28226
+ });
28225
28227
  logger.log('Command "deleteTest" is called with settings', settings);
28226
- settings = utils34.types.isArray(settings) ? settings : [settings];
28227
28228
  const results = await Promise.allSettled(settings.map((settings2) => requests.deleteTest({ settings: settings2, logger })));
28228
28229
  const error = results.find(({ status }) => status === "rejected");
28229
28230
  if (error)
@@ -28234,6 +28235,66 @@ var require_delete_test = __commonJS({
28234
28235
  }
28235
28236
  });
28236
28237
 
28238
+ // ../core-base/dist/get-account-info.js
28239
+ var require_get_account_info = __commonJS({
28240
+ "../core-base/dist/get-account-info.js"(exports) {
28241
+ "use strict";
28242
+ init_process();
28243
+ init_setImmediate();
28244
+ init_buffer();
28245
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
28246
+ if (k2 === void 0)
28247
+ k2 = k;
28248
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28249
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28250
+ desc = { enumerable: true, get: function() {
28251
+ return m[k];
28252
+ } };
28253
+ }
28254
+ Object.defineProperty(o, k2, desc);
28255
+ } : function(o, m, k, k2) {
28256
+ if (k2 === void 0)
28257
+ k2 = k;
28258
+ o[k2] = m[k];
28259
+ });
28260
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
28261
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28262
+ } : function(o, v) {
28263
+ o["default"] = v;
28264
+ });
28265
+ var __importStar = exports && exports.__importStar || function(mod) {
28266
+ if (mod && mod.__esModule)
28267
+ return mod;
28268
+ var result = {};
28269
+ if (mod != null) {
28270
+ for (var k in mod)
28271
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
28272
+ __createBinding(result, mod, k);
28273
+ }
28274
+ __setModuleDefault(result, mod);
28275
+ return result;
28276
+ };
28277
+ Object.defineProperty(exports, "__esModule", { value: true });
28278
+ exports.makeGetAccountInfo = void 0;
28279
+ var utils34 = __importStar(require_browser3());
28280
+ function makeGetAccountInfo({ requests, agentId: defaultAgentId, logger: mainLogger }) {
28281
+ return async function getAccountInfo({ settings, logger = mainLogger }) {
28282
+ logger = logger.extend(mainLogger, { tags: [`get-account-base-${utils34.general.shortid()}`] });
28283
+ settings = { ...settings };
28284
+ settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
28285
+ logger.log('Command "getAccountInfo" is called with settings', settings);
28286
+ const account = await requests.getAccountInfo({ settings, logger });
28287
+ return {
28288
+ ...account,
28289
+ eyesServer: { ...account.eyesServer, agentId: settings.agentId },
28290
+ ufgServer: { ...account.ufgServer, agentId: settings.agentId }
28291
+ };
28292
+ };
28293
+ }
28294
+ exports.makeGetAccountInfo = makeGetAccountInfo;
28295
+ }
28296
+ });
28297
+
28237
28298
  // ../core-base/dist/core.js
28238
28299
  var require_core = __commonJS({
28239
28300
  "../core-base/dist/core.js"(exports) {
@@ -28252,20 +28313,21 @@ var require_core = __commonJS({
28252
28313
  var extract_text_1 = require_extract_text();
28253
28314
  var close_batch_1 = require_close_batch();
28254
28315
  var delete_test_1 = require_delete_test();
28316
+ var get_account_info_1 = require_get_account_info();
28255
28317
  function makeCore({ agentId = "core-base", concurrency, cwd = process.cwd(), logger: defaultLogger }) {
28256
28318
  const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: "core-base" } });
28257
28319
  logger.log(`Core is initialized in directory ${cwd} for agent ${agentId}`);
28258
- const coreRequests = (0, requests_1.makeCoreRequests)({ agentId, logger });
28320
+ const requests = (0, requests_1.makeCoreRequestsWithCache)({ logger });
28259
28321
  return {
28260
- openEyes: (0, open_eyes_1.makeOpenEyes)({ requests: coreRequests, concurrency, cwd, logger }),
28261
- openFunctionalSession: (0, open_functional_session_1.makeOpenFunctionalSession)({ requests: coreRequests, concurrency, cwd, logger }),
28262
- locate: (0, locate_1.makeLocate)({ requests: coreRequests, logger }),
28263
- locateText: (0, locate_text_1.makeLocateText)({ requests: coreRequests, logger }),
28264
- extractText: (0, extract_text_1.makeExtractText)({ requests: coreRequests, logger }),
28265
- closeBatch: (0, close_batch_1.makeCloseBatch)({ requests: coreRequests, logger }),
28266
- deleteTest: (0, delete_test_1.makeDeleteTest)({ requests: coreRequests, logger }),
28267
- getAccountInfo: coreRequests.getAccountInfo,
28268
- logEvent: coreRequests.logEvent
28322
+ openEyes: (0, open_eyes_1.makeOpenEyes)({ requests, agentId, concurrency, cwd, logger }),
28323
+ openFunctionalSession: (0, open_functional_session_1.makeOpenFunctionalSession)({ requests, agentId, concurrency, cwd, logger }),
28324
+ locate: (0, locate_1.makeLocate)({ requests, agentId, logger }),
28325
+ locateText: (0, locate_text_1.makeLocateText)({ requests, agentId, logger }),
28326
+ extractText: (0, extract_text_1.makeExtractText)({ requests, agentId, logger }),
28327
+ closeBatch: (0, close_batch_1.makeCloseBatch)({ requests, agentId, logger }),
28328
+ deleteTest: (0, delete_test_1.makeDeleteTest)({ requests, agentId, logger }),
28329
+ getAccountInfo: (0, get_account_info_1.makeGetAccountInfo)({ requests, agentId, logger }),
28330
+ logEvent: requests.logEvent
28269
28331
  };
28270
28332
  }
28271
28333
  exports.makeCore = makeCore;
@@ -29537,12 +29599,14 @@ var require_element = __commonJS({
29537
29599
  if (!contentRegion || !environment.isAndroid) {
29538
29600
  let attrContentRegion = null;
29539
29601
  try {
29540
- const size = JSON.parse(await this.getAttribute("contentSize"));
29602
+ const { left, top, width, height, scrollableOffset } = JSON.parse(await this.getAttribute("contentSize"));
29603
+ if ([left, top, width, height, scrollableOffset].some((value) => !utils34.types.isNumber(value)))
29604
+ throw new Error("Invalid contentSize");
29541
29605
  attrContentRegion = {
29542
- x: size.left,
29543
- y: size.top,
29544
- width: size.width,
29545
- height: environment.isIOS ? Math.max(size.height, size.scrollableOffset) : size.height + size.scrollableOffset
29606
+ x: left,
29607
+ y: top,
29608
+ width,
29609
+ height: environment.isIOS ? Math.max(height, scrollableOffset) : height + scrollableOffset
29546
29610
  };
29547
29611
  } catch (err) {
29548
29612
  this.logger.warn(`Unable to get the attribute 'contentSize' due to the following error: '${err.message}'`);
@@ -29702,14 +29766,13 @@ var require_element = __commonJS({
29702
29766
  return text;
29703
29767
  }
29704
29768
  async getAttribute(name) {
29705
- var _a;
29706
- if ((_a = this._state.attributes) === null || _a === void 0 ? void 0 : _a[name]) {
29769
+ if (utils34.types.has(this._state.attributes, name)) {
29707
29770
  if (this._state.attributes[name] instanceof Error)
29708
29771
  throw this._state.attributes[name];
29709
29772
  return this._state.attributes[name];
29710
29773
  }
29711
29774
  const value = await this.withRefresh(async () => {
29712
- var _a2;
29775
+ var _a;
29713
29776
  var _b;
29714
29777
  const environment = await this.driver.getEnvironment();
29715
29778
  if (environment.isWeb) {
@@ -29717,7 +29780,7 @@ var require_element = __commonJS({
29717
29780
  return properties[name];
29718
29781
  } else {
29719
29782
  this.logger.log(`Extracting "${name}" attribute of native element with selector`, this.selector);
29720
- (_a2 = (_b = this._state).attributes) !== null && _a2 !== void 0 ? _a2 : _b.attributes = {};
29783
+ (_a = (_b = this._state).attributes) !== null && _a !== void 0 ? _a : _b.attributes = {};
29721
29784
  try {
29722
29785
  this._state.attributes[name] = await this._spec.getElementAttribute(this.driver.target, this.target, name);
29723
29786
  return this._state.attributes[name];
@@ -30624,7 +30687,12 @@ var require_helper_ios = __commonJS({
30624
30687
  }
30625
30688
  async getContentRegion(element) {
30626
30689
  var _a, _b;
30627
- await this._element.click();
30690
+ const { x, y } = await this._spec.getElementRegion(this._driver.target, this._element.target);
30691
+ await this._spec.performAction(this._driver.target, [
30692
+ { action: "press", x, y },
30693
+ { action: "wait", ms: 300 },
30694
+ { action: "release" }
30695
+ ]);
30628
30696
  const sizeLabel = await this._driver.element({ type: "name", selector: "applitools_content_size_label" });
30629
30697
  const sizeString = await (sizeLabel === null || sizeLabel === void 0 ? void 0 : sizeLabel.getText());
30630
30698
  if (!sizeString)
@@ -30636,8 +30704,8 @@ var require_helper_ios = __commonJS({
30636
30704
  const paddingLabel = await this._driver.element({ type: "name", selector: "applitools_content_offset_label" });
30637
30705
  const paddingString = await (paddingLabel === null || paddingLabel === void 0 ? void 0 : paddingLabel.getText());
30638
30706
  if (paddingString) {
30639
- const [, x, y] = paddingString.match(/\{(-?\d+(?:\.\d+)?),\s?(-?\d+(?:\.\d+)?)\}/);
30640
- const contentOffset = { x: Number(x), y: Number(y) };
30707
+ const [, x2, y2] = paddingString.match(/\{(-?\d+(?:\.\d+)?),\s?(-?\d+(?:\.\d+)?)\}/);
30708
+ const contentOffset = { x: Number(x2), y: Number(y2) };
30641
30709
  if (!Number.isNaN(contentOffset.x))
30642
30710
  contentSize.width -= contentOffset.x;
30643
30711
  if (!Number.isNaN(contentOffset.y))
@@ -31700,12 +31768,16 @@ var require_driver = __commonJS({
31700
31768
  }
31701
31769
  async refresh({ reset } = {}) {
31702
31770
  if (reset) {
31703
- this._driverInfo = void 0;
31704
- this._environment = void 0;
31705
- this._viewport = void 0;
31706
- this._features = void 0;
31707
- this._helper = void 0;
31708
- this._state = {};
31771
+ if (utils34.general.getEnvValue("AVOID_DRIVER_STATE_REST", "boolean")) {
31772
+ this._logger.log(`Skipping reset of the driver state`);
31773
+ } else {
31774
+ this._driverInfo = void 0;
31775
+ this._environment = void 0;
31776
+ this._viewport = void 0;
31777
+ this._features = void 0;
31778
+ this._helper = void 0;
31779
+ this._state = {};
31780
+ }
31709
31781
  }
31710
31782
  const spec = this._spec;
31711
31783
  let currentContext = this.currentContext.target;
@@ -31883,8 +31955,8 @@ var require_driver = __commonJS({
31883
31955
  return this._environment;
31884
31956
  }
31885
31957
  async getViewport() {
31886
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
31887
- var _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
31958
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
31959
+ var _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
31888
31960
  if (!this._viewport) {
31889
31961
  const environment = await this.getEnvironment();
31890
31962
  const driverInfo = await this.getDriverInfo();
@@ -31901,13 +31973,13 @@ var require_driver = __commonJS({
31901
31973
  const capabilitiesViewport = capabilities ? (0, capabilities_1.extractCapabilitiesViewport)(capabilities) : null;
31902
31974
  this._logger.log("Extracted capabilities viewport", capabilitiesViewport);
31903
31975
  this._viewport = { ...capabilitiesViewport, ...this._viewport };
31904
- (_a = (_y = this._viewport).pixelRatio) !== null && _a !== void 0 ? _a : _y.pixelRatio = 1;
31905
31976
  let windowSize = await this._spec.getWindowSize(this.target);
31906
- (_b = (_z = this._viewport).displaySize) !== null && _b !== void 0 ? _b : _z.displaySize = windowSize;
31907
- if (((_c = this._viewport.orientation) === null || _c === void 0 ? void 0 : _c.startsWith("landscape")) && this._viewport.displaySize.height > this._viewport.displaySize.width) {
31977
+ (_a = (_1 = this._viewport).displaySize) !== null && _a !== void 0 ? _a : _1.displaySize = windowSize;
31978
+ if (((_b = this._viewport.orientation) === null || _b === void 0 ? void 0 : _b.startsWith("landscape")) && this._viewport.displaySize.height > this._viewport.displaySize.width) {
31908
31979
  this._viewport.displaySize = utils34.geometry.rotate(this._viewport.displaySize, 90);
31909
31980
  }
31910
31981
  if (environment.isAndroid) {
31982
+ (_c = (_2 = this._viewport).pixelRatio) !== null && _c !== void 0 ? _c : _2.pixelRatio = 1;
31911
31983
  const { statusBar, navigationBar } = (_f = await ((_e = (_d = this._spec).getSystemBars) === null || _e === void 0 ? void 0 : _e.call(_d, this.target).catch(() => void 0))) !== null && _f !== void 0 ? _f : {};
31912
31984
  if (statusBar === null || statusBar === void 0 ? void 0 : statusBar.visible) {
31913
31985
  this._logger.log("Driver status bar", statusBar);
@@ -31927,25 +31999,31 @@ var require_driver = __commonJS({
31927
31999
  this._viewport.navigationBarSize = 0;
31928
32000
  }
31929
32001
  }
31930
- (_0 = this._viewport).statusBarSize && (_0.statusBarSize = this._viewport.statusBarSize / this._viewport.pixelRatio);
31931
- (_1 = this._viewport).navigationBarSize && (_1.navigationBarSize = this._viewport.navigationBarSize / this._viewport.pixelRatio);
32002
+ (_3 = this._viewport).statusBarSize && (_3.statusBarSize = this._viewport.statusBarSize / this._viewport.pixelRatio);
32003
+ (_4 = this._viewport).navigationBarSize && (_4.navigationBarSize = this._viewport.navigationBarSize / this._viewport.pixelRatio);
31932
32004
  windowSize = utils34.geometry.scale(windowSize, 1 / this._viewport.pixelRatio);
31933
- (_2 = this._viewport).displaySize && (_2.displaySize = utils34.geometry.scale(this._viewport.displaySize, 1 / this._viewport.pixelRatio));
31934
- (_l = (_3 = this._viewport).navigationBarSize) !== null && _l !== void 0 ? _l : _3.navigationBarSize = 0;
32005
+ (_5 = this._viewport).displaySize && (_5.displaySize = utils34.geometry.scale(this._viewport.displaySize, 1 / this._viewport.pixelRatio));
32006
+ (_l = (_6 = this._viewport).navigationBarSize) !== null && _l !== void 0 ? _l : _6.navigationBarSize = 0;
31935
32007
  } else if (environment.isIOS) {
31936
- if ((_m = this._viewport.orientation) === null || _m === void 0 ? void 0 : _m.startsWith("landscape"))
32008
+ if (!this._viewport.pixelRatio || !this._viewport.statusBarSize) {
32009
+ const screen = await this.execute("mobile:deviceScreenInfo");
32010
+ this._viewport.pixelRatio = (_m = screen.scale) !== null && _m !== void 0 ? _m : 0;
32011
+ this._viewport.statusBarSize = (_o = screen.statusBarSize) === null || _o === void 0 ? void 0 : _o.height;
32012
+ }
32013
+ if ((_p = this._viewport.orientation) === null || _p === void 0 ? void 0 : _p.startsWith("landscape"))
31937
32014
  this._viewport.statusBarSize = 0;
31938
32015
  }
31939
- (_o = (_4 = this._viewport).statusBarSize) !== null && _o !== void 0 ? _o : _4.statusBarSize = 0;
31940
- (_p = (_5 = this._viewport).viewportLocation) !== null && _p !== void 0 ? _p : _5.viewportLocation = {
31941
- x: this._viewport.orientation === "landscape" ? (_q = this._viewport.navigationBarSize) !== null && _q !== void 0 ? _q : 0 : 0,
32016
+ (_q = (_7 = this._viewport).pixelRatio) !== null && _q !== void 0 ? _q : _7.pixelRatio = 1;
32017
+ (_r = (_8 = this._viewport).statusBarSize) !== null && _r !== void 0 ? _r : _8.statusBarSize = 0;
32018
+ (_s = (_9 = this._viewport).viewportLocation) !== null && _s !== void 0 ? _s : _9.viewportLocation = {
32019
+ x: this._viewport.orientation === "landscape" ? (_t = this._viewport.navigationBarSize) !== null && _t !== void 0 ? _t : 0 : 0,
31942
32020
  y: this._viewport.statusBarSize
31943
32021
  };
31944
32022
  if (!this._viewport.viewportSize) {
31945
32023
  this._viewport.viewportSize = { ...this._viewport.displaySize };
31946
32024
  this._viewport.viewportSize.height -= this._viewport.statusBarSize;
31947
32025
  if (environment.isAndroid) {
31948
- this._viewport.viewportSize[((_r = this._viewport.orientation) === null || _r === void 0 ? void 0 : _r.startsWith("landscape")) ? "width" : "height"] -= this._viewport.navigationBarSize;
32026
+ this._viewport.viewportSize[((_u = this._viewport.orientation) === null || _u === void 0 ? void 0 : _u.startsWith("landscape")) ? "width" : "height"] -= this._viewport.navigationBarSize;
31949
32027
  }
31950
32028
  }
31951
32029
  if (!environment.isWeb && environment.isIOS && !this._viewport.safeArea) {
@@ -31973,13 +32051,13 @@ var require_driver = __commonJS({
31973
32051
  }
31974
32052
  if (environment.isWeb) {
31975
32053
  const browserViewport = await this.execute(snippets.getViewport);
31976
- (_s = (_6 = this._viewport).viewportSize) !== null && _s !== void 0 ? _s : _6.viewportSize = browserViewport.viewportSize;
31977
- (_t = (_7 = this._viewport).pixelRatio) !== null && _t !== void 0 ? _t : _7.pixelRatio = browserViewport.pixelRatio;
31978
- (_u = (_8 = this._viewport).viewportScale) !== null && _u !== void 0 ? _u : _8.viewportScale = browserViewport.viewportScale;
31979
- (_v = (_9 = this._viewport).orientation) !== null && _v !== void 0 ? _v : _9.orientation = browserViewport.orientation;
32054
+ (_v = (_10 = this._viewport).viewportSize) !== null && _v !== void 0 ? _v : _10.viewportSize = browserViewport.viewportSize;
32055
+ (_w = (_11 = this._viewport).pixelRatio) !== null && _w !== void 0 ? _w : _11.pixelRatio = browserViewport.pixelRatio;
32056
+ (_x = (_12 = this._viewport).viewportScale) !== null && _x !== void 0 ? _x : _12.viewportScale = browserViewport.viewportScale;
32057
+ (_y = (_13 = this._viewport).orientation) !== null && _y !== void 0 ? _y : _13.orientation = browserViewport.orientation;
31980
32058
  }
31981
- (_w = (_10 = this._viewport).pixelRatio) !== null && _w !== void 0 ? _w : _10.pixelRatio = 1;
31982
- (_x = (_11 = this._viewport).viewportScale) !== null && _x !== void 0 ? _x : _11.viewportScale = 1;
32059
+ (_z = (_14 = this._viewport).pixelRatio) !== null && _z !== void 0 ? _z : _14.pixelRatio = 1;
32060
+ (_0 = (_15 = this._viewport).viewportScale) !== null && _0 !== void 0 ? _0 : _15.viewportScale = 1;
31983
32061
  this._logger.log("Extracted viewport", this._viewport);
31984
32062
  }
31985
32063
  return this._viewport;
@@ -32004,15 +32082,20 @@ var require_driver = __commonJS({
32004
32082
  async getDriverUrl() {
32005
32083
  var _a;
32006
32084
  const driverInfo = await this.getDriverInfo();
32007
- return (_a = driverInfo.remoteHostname) !== null && _a !== void 0 ? _a : null;
32085
+ return (_a = driverInfo.driverServerUrl) !== null && _a !== void 0 ? _a : null;
32008
32086
  }
32009
32087
  async getHelper() {
32010
32088
  var _a, _b, _c;
32011
32089
  if (this._helper === void 0) {
32012
- const environment = await this.getEnvironment();
32013
- this._logger.log(`Extracting helper for ${environment.isIOS ? "ios" : "android"}`);
32014
- this._helper = environment.isIOS ? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this }) : await helper_android_1.HelperAndroid.make({ spec: this._spec, driver: this });
32015
- this._logger.log(`Extracted helper of type ${(_a = this._helper) === null || _a === void 0 ? void 0 : _a.name}`);
32090
+ if (utils34.general.getEnvValue("IGNORE_HELPER_LIB", "boolean")) {
32091
+ this._logger.log(`Skipping helper lib extraction`);
32092
+ this._helper = null;
32093
+ } else {
32094
+ const environment = await this.getEnvironment();
32095
+ this._logger.log(`Extracting helper for ${environment.isIOS ? "ios" : "android"}`);
32096
+ this._helper = environment.isIOS ? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this }) : await helper_android_1.HelperAndroid.make({ spec: this._spec, driver: this });
32097
+ this._logger.log(`Extracted helper of type ${(_a = this._helper) === null || _a === void 0 ? void 0 : _a.name}`);
32098
+ }
32016
32099
  }
32017
32100
  this._logger.log(`Returning helper for of type ${(_c = (_b = this._helper) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : null}`);
32018
32101
  return this._helper;
@@ -32309,25 +32392,29 @@ var require_driver = __commonJS({
32309
32392
  if (environment.isWeb)
32310
32393
  return (_a = this._viewport) === null || _a === void 0 ? void 0 : _a.orientation;
32311
32394
  if (environment.isAndroid) {
32312
- this._logger.log("Extracting device orientation using adb command on android");
32313
- const rotation = await this.execute("mobile:shell", {
32314
- command: "dumpsys window | grep 'mCurrentRotation' | cut -d = -f2"
32315
- }).then((rotation2) => {
32316
- var _a2;
32317
- return (_a2 = rotation2 === null || rotation2 === void 0 ? void 0 : rotation2.trim) === null || _a2 === void 0 ? void 0 : _a2.call(rotation2);
32318
- }).catch(() => null);
32319
- if (rotation) {
32320
- let orientation2 = void 0;
32321
- if (rotation === "ROTATION_0" || rotation === "0")
32322
- orientation2 = "portrait";
32323
- else if (rotation === "ROTATION_90" || rotation === "3")
32324
- orientation2 = "landscape-secondary";
32325
- else if (rotation === "ROTATION_180" || rotation === "2")
32326
- orientation2 = "portrait-secondary";
32327
- else if (rotation === "ROTATION_270" || rotation === "1")
32328
- orientation2 = "landscape";
32329
- this._logger.log("Extracted device orientation:", orientation2);
32330
- return orientation2;
32395
+ if (utils34.general.getEnvValue("AVOID_ADB_USAGE", "boolean")) {
32396
+ this._logger.log(`Skipping device orientation extraction using adb command on android`);
32397
+ } else {
32398
+ this._logger.log("Extracting device orientation using adb command on android");
32399
+ const rotation = await this.execute("mobile:shell", {
32400
+ command: "dumpsys window | grep 'mCurrentRotation' | cut -d = -f2"
32401
+ }).then((rotation2) => {
32402
+ var _a2;
32403
+ return (_a2 = rotation2 === null || rotation2 === void 0 ? void 0 : rotation2.trim) === null || _a2 === void 0 ? void 0 : _a2.call(rotation2);
32404
+ }).catch(() => null);
32405
+ if (rotation) {
32406
+ let orientation2 = void 0;
32407
+ if (rotation === "ROTATION_0" || rotation === "0")
32408
+ orientation2 = "portrait";
32409
+ else if (rotation === "ROTATION_90" || rotation === "3")
32410
+ orientation2 = "landscape-secondary";
32411
+ else if (rotation === "ROTATION_180" || rotation === "2")
32412
+ orientation2 = "portrait-secondary";
32413
+ else if (rotation === "ROTATION_270" || rotation === "1")
32414
+ orientation2 = "landscape";
32415
+ this._logger.log("Extracted device orientation:", orientation2);
32416
+ return orientation2;
32417
+ }
32331
32418
  }
32332
32419
  }
32333
32420
  this._logger.log("Extracting device orientation");
@@ -32516,7 +32603,7 @@ var require_set_viewport_size = __commonJS({
32516
32603
  });
32517
32604
 
32518
32605
  // ../core/dist/get-account-info.js
32519
- var require_get_account_info = __commonJS({
32606
+ var require_get_account_info2 = __commonJS({
32520
32607
  "../core/dist/get-account-info.js"(exports) {
32521
32608
  "use strict";
32522
32609
  init_process();
@@ -82505,9 +82592,9 @@ var require_take_dom_snapshots = __commonJS({
82505
82592
  logger.log(message);
82506
82593
  }
82507
82594
  }
82508
- if (settings.layoutBreakpoints.reload)
82509
- await driver.reloadPage();
82510
82595
  }
82596
+ if (settings.layoutBreakpoints.reload)
82597
+ await driver.reloadPage();
82511
82598
  if (settings.lazyLoad && (index === 0 || settings.layoutBreakpoints.reload)) {
82512
82599
  await (0, wait_for_lazy_load_1.waitForLazyLoad)({ context: currentContext, settings: settings.lazyLoad, logger });
82513
82600
  }
@@ -84070,7 +84157,7 @@ var require_make_manager = __commonJS({
84070
84157
  var open_eyes_1 = require_open_eyes4();
84071
84158
  var get_manager_results_1 = require_get_manager_results();
84072
84159
  var utils34 = __importStar(require_browser3());
84073
- function makeMakeManager({ spec, clients, concurrency: defaultConcurrency = utils34.general.getEnvValue("CONCURRENCY", "number"), core, base, agentId: defaultAgentId, environment, cwd = process.cwd(), logger: mainLogger, asyncCache }) {
84160
+ function makeMakeManager({ spec, clients, concurrency: defaultConcurrency = utils34.general.getEnvValue("CONCURRENCY", "number"), core, base: defaultBase, agentId: defaultAgentId, environment, cwd = process.cwd(), logger: mainLogger, asyncCache }) {
84074
84161
  return async function makeManager({ type = "classic", settings, logger = mainLogger } = {}) {
84075
84162
  var _a, _b, _c, _d, _e;
84076
84163
  var _f;
@@ -84081,7 +84168,7 @@ var require_make_manager = __commonJS({
84081
84168
  (_c = (_f = settings.batch).id) !== null && _c !== void 0 ? _c : _f.id = (_d = utils34.general.getEnvValue("BATCH_ID")) !== null && _d !== void 0 ? _d : `generated-${utils34.general.guid()}`;
84082
84169
  (_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;
84083
84170
  logger.log('Command "makeManager" is called with settings', settings);
84084
- base !== null && base !== void 0 ? base : base = (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, cwd, logger });
84171
+ const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, cwd, logger });
84085
84172
  const cores = {
84086
84173
  ufg: (0, core_2.makeCore)({ spec, base, fetchConcurrency: settings.fetchConcurrency, asyncCache, logger }),
84087
84174
  classic: (0, core_1.makeCore)({ spec, base, logger })
@@ -84278,7 +84365,7 @@ var require_package2 = __commonJS({
84278
84365
  "../core/package.json"(exports, module) {
84279
84366
  module.exports = {
84280
84367
  name: "@applitools/core",
84281
- version: "4.4.0",
84368
+ version: "4.5.1",
84282
84369
  homepage: "https://applitools.com",
84283
84370
  bugs: {
84284
84371
  url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -84715,7 +84802,7 @@ var require_core4 = __commonJS({
84715
84802
  var core_base_1 = require_dist2();
84716
84803
  var get_viewport_size_1 = require_get_viewport_size();
84717
84804
  var set_viewport_size_1 = require_set_viewport_size();
84718
- var get_account_info_1 = require_get_account_info();
84805
+ var get_account_info_1 = require_get_account_info2();
84719
84806
  var get_nml_client_1 = require_get_nml_client();
84720
84807
  var get_ec_client_1 = require_get_ec_client();
84721
84808
  var locate_1 = require_locate3();
@@ -84736,7 +84823,7 @@ var require_core4 = __commonJS({
84736
84823
  logger.log(`Core is initialized ${defaultBase ? "with" : "without"} custom base core and environment`, environment);
84737
84824
  if (environment.sdk)
84738
84825
  (0, validate_sdk_version_1.validateSdkVersion)(environment.sdk, { logger });
84739
- const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, cwd, logger });
84826
+ const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId, concurrency, cwd, logger });
84740
84827
  return utils34.general.extend(base, (core) => {
84741
84828
  return {
84742
84829
  base,
@@ -84752,6 +84839,7 @@ var require_core4 = __commonJS({
84752
84839
  core,
84753
84840
  base: defaultBase,
84754
84841
  agentId,
84842
+ cwd,
84755
84843
  environment,
84756
84844
  asyncCache,
84757
84845
  logger
@@ -86568,7 +86656,9 @@ var require_spec_driver2 = __commonJS({
86568
86656
  }
86569
86657
  exports.childContext = childContext;
86570
86658
  async function getDriverInfo(driver) {
86571
- return { sessionId: driver.sessionId };
86659
+ var _a;
86660
+ const driverServerUrl = `${driver.options.protocol}://${driver.options.hostname}${driver.options.port ? `:${driver.options.port}` : ""}${(_a = driver.options.path) !== null && _a !== void 0 ? _a : ""}`;
86661
+ return { sessionId: driver.sessionId, driverServerUrl };
86572
86662
  }
86573
86663
  exports.getDriverInfo = getDriverInfo;
86574
86664
  async function getCapabilities(driver) {
@@ -87887,7 +87977,7 @@ var require_logs = __commonJS({
87887
87977
  init_setImmediate();
87888
87978
  init_buffer();
87889
87979
  Object.defineProperty(exports, "__esModule", { value: true });
87890
- exports.structureLogs = exports.parseLogs = void 0;
87980
+ exports.analyzeLogs = exports.structureLogs = exports.stringifyLog = exports.parseLogs = void 0;
87891
87981
  function parseLogs(logs) {
87892
87982
  const regexp = /^(?<label>[^\s]+) (?:\((?<tags>[^\)]+)\) )?\| (?<timestamp>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)? (?:\[(?<level>[A-Z]+)\s*\])? (?<message>.+)$/;
87893
87983
  const lines = logs.split("\n");
@@ -87906,8 +87996,14 @@ var require_logs = __commonJS({
87906
87996
  }, []);
87907
87997
  }
87908
87998
  exports.parseLogs = parseLogs;
87999
+ function stringifyLog(log) {
88000
+ var _a;
88001
+ return `${log.label} (${(_a = log.tags) === null || _a === void 0 ? void 0 : _a.map((tags) => tags.join("/")).join(" & ")}) ${log.timestamp} [${log.level}] ${log.message}`;
88002
+ }
88003
+ exports.stringifyLog = stringifyLog;
87909
88004
  function structureLogs(logs) {
87910
88005
  const groups = {};
88006
+ groups.logs;
87911
88007
  logs.forEach((log) => {
87912
88008
  var _a;
87913
88009
  const tags = (_a = log.tags) !== null && _a !== void 0 ? _a : [[]];
@@ -87925,6 +88021,34 @@ var require_logs = __commonJS({
87925
88021
  return groups;
87926
88022
  }
87927
88023
  exports.structureLogs = structureLogs;
88024
+ function analyzeLogs({ logs, ...groups }) {
88025
+ var _a, _b;
88026
+ const analysis = {};
88027
+ analysis.logs = logs === null || logs === void 0 ? void 0 : logs.map(stringifyLog);
88028
+ const groupAnalyses = Object.fromEntries(Object.entries(groups).map(([name, group]) => [name, analyzeLogs(group)]));
88029
+ analysis.startedAt = Math.min(Date.parse((_a = logs === null || logs === void 0 ? void 0 : logs[0]) === null || _a === void 0 ? void 0 : _a.timestamp) || Infinity, ...Object.values(groupAnalyses).map((group) => group.startedAt));
88030
+ analysis.finishedAt = Math.max(Date.parse((_b = logs === null || logs === void 0 ? void 0 : logs[logs.length - 1]) === null || _b === void 0 ? void 0 : _b.timestamp) || 0, ...Object.values(groupAnalyses).map((group) => group.finishedAt));
88031
+ analysis.time = analysis.finishedAt - analysis.startedAt;
88032
+ analysis.conclusion = "";
88033
+ analysis.conclusion += `Time taken: ${formatTime(analysis.time)};`;
88034
+ if (Object.keys(groupAnalyses).length > 0) {
88035
+ analysis.conclusion += `Longest group: ${Object.keys(groupAnalyses).reduce((prev, cur) => groupAnalyses[cur].time > groupAnalyses[prev].time ? cur : prev)}`;
88036
+ }
88037
+ return { ...analysis, ...groupAnalyses };
88038
+ }
88039
+ exports.analyzeLogs = analyzeLogs;
88040
+ function formatTime(ms) {
88041
+ const h = Math.floor(ms / 36e5);
88042
+ if (h)
88043
+ ms -= h * 36e5;
88044
+ const m = Math.floor(ms / 6e4);
88045
+ if (m)
88046
+ ms -= m * 6e4;
88047
+ const s = Math.floor(ms / 1e3);
88048
+ if (s)
88049
+ ms -= s * 1e3;
88050
+ return [h && `${h}h`, m && `${m}m`, s && `${s}s`, ms && `${ms}ms`].filter(Boolean).join(" ");
88051
+ }
87928
88052
  }
87929
88053
  });
87930
88054
 
@@ -87993,7 +88117,7 @@ var require_package3 = __commonJS({
87993
88117
  "../eyes/package.json"(exports, module) {
87994
88118
  module.exports = {
87995
88119
  name: "@applitools/eyes",
87996
- version: "1.13.1",
88120
+ version: "1.13.3",
87997
88121
  keywords: [
87998
88122
  "applitools",
87999
88123
  "eyes",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-browser",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
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.1"
51
+ "@applitools/eyes": "1.13.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^12.20.55",