@applitools/eyes-browser 1.2.3 → 1.3.1

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,85 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.1](https://github.com/Applitools-Dev/sdk/compare/js/eyes-browser@1.3.0...js/eyes-browser@1.3.1) (2024-04-01)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/spec-driver-selenium bumped to 1.5.74
9
+ #### Bug Fixes
10
+
11
+ * trigger JS release ([6022ac8](https://github.com/Applitools-Dev/sdk/commit/6022ac85626287a37101b65732e9d46c63bbd8b8))
12
+ * @applitools/ec-client bumped to 1.7.32
13
+
14
+ * @applitools/core-base bumped to 1.10.1
15
+ #### Bug Fixes
16
+
17
+ * trigger JS release ([6022ac8](https://github.com/Applitools-Dev/sdk/commit/6022ac85626287a37101b65732e9d46c63bbd8b8))
18
+ * @applitools/core bumped to 4.11.1
19
+
20
+ * @applitools/eyes bumped to 1.17.1
21
+ #### Bug Fixes
22
+
23
+ * trigger JS release ([6022ac8](https://github.com/Applitools-Dev/sdk/commit/6022ac85626287a37101b65732e9d46c63bbd8b8))
24
+
25
+
26
+
27
+
28
+ ## [1.3.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-browser-v1.2.4...js/eyes-browser@1.3.0) (2024-03-31)
29
+
30
+
31
+ ### Features
32
+
33
+ * add support for browser in eyes ([#2054](https://github.com/Applitools-Dev/sdk/issues/2054)) ([4af82dd](https://github.com/Applitools-Dev/sdk/commit/4af82dd2a667c13adfed0be98a026181755256c6))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * @applitools/spec-driver-selenium bumped to 1.5.73
39
+ #### Bug Fixes
40
+
41
+ * remove getSessionDetails call in JS Selenium ([#2280](https://github.com/Applitools-Dev/sdk/issues/2280)) ([d15748f](https://github.com/Applitools-Dev/sdk/commit/d15748f68c931f2f84c13efd8472399c1ff72e25))
42
+ * @applitools/ec-client bumped to 1.7.31
43
+
44
+ * @applitools/core-base bumped to 1.10.0
45
+ #### Features
46
+
47
+ * Add GitMergeBaseTimestamp support ([#2281](https://github.com/Applitools-Dev/sdk/issues/2281)) ([5489608](https://github.com/Applitools-Dev/sdk/commit/54896085445663a51b5e5595a2517e48fa8736f3))
48
+ * batch buildId ([#2263](https://github.com/Applitools-Dev/sdk/issues/2263)) ([f19ac38](https://github.com/Applitools-Dev/sdk/commit/f19ac38612bc55d870f59161a39b5b7eb01e25f3))
49
+ * send heartbeat to keep test alive ([#2246](https://github.com/Applitools-Dev/sdk/issues/2246)) ([58636e7](https://github.com/Applitools-Dev/sdk/commit/58636e7dd353f06eb2b3bee1120ab81c3f9fcc94))
50
+
51
+
52
+ #### Bug Fixes
53
+
54
+ * retry Eyes request on ECONNREFUSED to improve stability during deployment ([d1e4dca](https://github.com/Applitools-Dev/sdk/commit/d1e4dcae79185578808b4f2c5f94fa79d7d914a3))
55
+ * @applitools/core bumped to 4.11.0
56
+ #### Features
57
+
58
+ * Add GitMergeBaseTimestamp support ([#2281](https://github.com/Applitools-Dev/sdk/issues/2281)) ([5489608](https://github.com/Applitools-Dev/sdk/commit/54896085445663a51b5e5595a2517e48fa8736f3))
59
+ * batch buildId ([#2263](https://github.com/Applitools-Dev/sdk/issues/2263)) ([f19ac38](https://github.com/Applitools-Dev/sdk/commit/f19ac38612bc55d870f59161a39b5b7eb01e25f3))
60
+
61
+
62
+
63
+ * @applitools/eyes bumped to 1.17.0
64
+ #### Features
65
+
66
+ * add Eyes.getResults method ([#2046](https://github.com/Applitools-Dev/sdk/issues/2046)) ([#2069](https://github.com/Applitools-Dev/sdk/issues/2069)) ([4d263e1](https://github.com/Applitools-Dev/sdk/commit/4d263e19cb5e5708790a1a7ef90ff8f3eee50d91))
67
+ * Add GitMergeBaseTimestamp support ([#2281](https://github.com/Applitools-Dev/sdk/issues/2281)) ([5489608](https://github.com/Applitools-Dev/sdk/commit/54896085445663a51b5e5595a2517e48fa8736f3))
68
+ * added `enableEyesLogs` configuration to the eyes service ([639ca8a](https://github.com/Applitools-Dev/sdk/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
69
+ * added `useExecutionCloud` configuration to the eyes service ([#2033](https://github.com/Applitools-Dev/sdk/issues/2033)) ([639ca8a](https://github.com/Applitools-Dev/sdk/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
70
+ * generate more enums ([#2179](https://github.com/Applitools-Dev/sdk/issues/2179)) ([5f4f916](https://github.com/Applitools-Dev/sdk/commit/5f4f91621b791a02464191123f69b12f590b9efe))
71
+ * ios multi device target ([#2160](https://github.com/Applitools-Dev/sdk/issues/2160)) ([3874fb8](https://github.com/Applitools-Dev/sdk/commit/3874fb8ad77039abbb5ab78c00ffb45829b2db28))
72
+
73
+
74
+ #### Bug Fixes
75
+
76
+ * error to unknown type in exception ([#2035](https://github.com/Applitools-Dev/sdk/issues/2035)) ([16d78c3](https://github.com/Applitools-Dev/sdk/commit/16d78c3cce90a5cb50cc2aa4e9ab6a58b7b93f89))
77
+ * fixed default value in `useSystemScreenshot` method of check settings ([42a773c](https://github.com/Applitools-Dev/sdk/commit/42a773cc57e8e5de528a049b376159615892003b))
78
+ * fixed issue when w3c properties were added to legacy capabilities object in `Eyes.setMobileCapabilities` method ([94d785f](https://github.com/Applitools-Dev/sdk/commit/94d785f0428df101c207d6f09a55c46f2bdbf19e))
79
+
80
+
81
+
82
+
3
83
  ## [1.2.3](https://github.com/Applitools-Dev/sdk/compare/js/eyes-browser@1.2.2...js/eyes-browser@1.2.3) (2024-03-18)
4
84
 
5
85
 
package/dist/index.js CHANGED
@@ -13316,7 +13316,7 @@ var require_req_eyes = __commonJS({
13316
13316
  limit: 5,
13317
13317
  timeout: 200,
13318
13318
  statuses: [404, 500, 502, 503, 504],
13319
- codes: ["ECONNRESET", "ECONNABORTED", "ETIMEDOUT", "ENOTFOUND", "EAI_AGAIN", "STUCK_REQUEST"]
13319
+ codes: ["ECONNRESET", "ECONNABORTED", "ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND", "EAI_AGAIN", "STUCK_REQUEST"]
13320
13320
  }
13321
13321
  ],
13322
13322
  hooks: [handleLongRequests({ req: req_1.default }), handleLogs({ logger }), handleUnexpectedResponse()],
@@ -13364,7 +13364,9 @@ var require_req_eyes = __commonJS({
13364
13364
  async afterResponse({ request, response, options }) {
13365
13365
  if ((options === null || options === void 0 ? void 0 : options.expected) && (utils34.types.isArray(options === null || options === void 0 ? void 0 : options.expected) ? !options.expected.includes(response.status) : options.expected !== response.status)) {
13366
13366
  const requestId = request.headers.get("x-applitools-eyes-client-request-id");
13367
- throw new Error(`Request "${options === null || options === void 0 ? void 0 : options.name}" [${requestId}] that was sent to the address "[${request.method}]${request.url}" failed due to unexpected status ${response.statusText}(${response.status})`);
13367
+ const body = await response.clone().text();
13368
+ const bodyStr = body ? ` and body "${body}"` : "";
13369
+ throw new Error(`Request "${options === null || options === void 0 ? void 0 : options.name}" [${requestId}] that was sent to the address "[${request.method}]${request.url}" failed due to unexpected status ${response.statusText}(${response.status})${bodyStr}`);
13368
13370
  }
13369
13371
  }
13370
13372
  };
@@ -13384,7 +13386,7 @@ var require_req_eyes = __commonJS({
13384
13386
  const pollResponse = await req2(response.headers.get("Location"), options !== null && options !== void 0 ? options : {}, {
13385
13387
  method: "GET",
13386
13388
  body: void 0,
13387
- expected: void 0,
13389
+ expected: [200, 201],
13388
13390
  retry: {
13389
13391
  statuses: [200],
13390
13392
  timeout: [
@@ -13395,13 +13397,16 @@ var require_req_eyes = __commonJS({
13395
13397
  ]
13396
13398
  },
13397
13399
  connectionTimeout: 0,
13398
- hooks: {
13399
- beforeRetry({ request, response: response2 }) {
13400
- if (response2 && response2.status === 200 && response2.headers.has("Location")) {
13401
- return { request, url: response2.headers.get("Location") };
13400
+ hooks: [
13401
+ {
13402
+ beforeRetry({ request, response: response2 }) {
13403
+ if (response2 && response2.status === 200 && response2.headers.has("Location")) {
13404
+ return { request, url: response2.headers.get("Location") };
13405
+ }
13402
13406
  }
13403
- }
13404
- }
13407
+ },
13408
+ handleUnexpectedResponse()
13409
+ ]
13405
13410
  });
13406
13411
  return await req2(pollResponse.headers.get("Location"), options !== null && options !== void 0 ? options : {}, {
13407
13412
  method: "DELETE",
@@ -20548,15 +20553,27 @@ var require_requests = __commonJS({
20548
20553
  extractText,
20549
20554
  closeBatch: closeBatch2,
20550
20555
  deleteTest,
20551
- logEvent
20556
+ logEvent,
20557
+ sendHeartbeat
20552
20558
  };
20553
20559
  return core;
20554
- async function openEyes({ settings, logger = mainLogger }) {
20555
- var _a, _b, _c, _d, _e, _f;
20560
+ async function openEyes({ settings, heartbeat, logger = mainLogger }) {
20561
+ var _a, _b, _c, _d, _e, _f, _g;
20556
20562
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20557
20563
  const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20558
20564
  logger.log('Request "openEyes" called with settings', settings);
20559
- const accountPromise = getAccountInfoWithCache({ settings });
20565
+ const account = await getAccountInfoWithCache({ settings });
20566
+ if (account.processKeepaliveIntervalSec) {
20567
+ heartbeat.startPeriodicHeartbeatMessaging({
20568
+ eyesServerUrl: settings.eyesServerUrl,
20569
+ apiKey: settings.apiKey,
20570
+ proxy: settings.proxy,
20571
+ useDnsCache: settings.useDnsCache,
20572
+ agentId: settings.agentId,
20573
+ processId: settings.processId,
20574
+ interval: (_a = utils34.general.getEnvValue("HEARTBEAT_INTERVAL", "number")) !== null && _a !== void 0 ? _a : account.processKeepaliveIntervalSec * 1e3
20575
+ });
20576
+ }
20560
20577
  const initializedAt = (/* @__PURE__ */ new Date()).toISOString();
20561
20578
  const response = await req2("./api/sessions/running", {
20562
20579
  name: "openEyes",
@@ -20570,17 +20587,18 @@ var require_requests = __commonJS({
20570
20587
  appIdOrName: settings.appName,
20571
20588
  scenarioIdOrName: settings.testName,
20572
20589
  displayName: settings.displayName,
20573
- properties: [...(_a = settings.properties) !== null && _a !== void 0 ? _a : [], ...(_c = (_b = settings.environment) === null || _b === void 0 ? void 0 : _b.properties) !== null && _c !== void 0 ? _c : []],
20590
+ properties: [...(_b = settings.properties) !== null && _b !== void 0 ? _b : [], ...(_d = (_c = settings.environment) === null || _c === void 0 ? void 0 : _c.properties) !== null && _d !== void 0 ? _d : []],
20574
20591
  batchInfo: settings.batch && {
20575
20592
  id: settings.batch.id,
20576
20593
  name: settings.batch.name,
20577
20594
  batchSequenceName: settings.batch.sequenceName,
20578
20595
  startedAt: settings.batch.startedAt,
20579
20596
  notifyOnCompletion: settings.batch.notifyOnCompletion,
20580
- properties: settings.batch.properties
20597
+ properties: settings.batch.properties,
20598
+ buildId: settings.batch.buildId
20581
20599
  },
20582
- egSessionId: (_e = (_d = settings.environment) === null || _d === void 0 ? void 0 : _d.ecSessionId) !== null && _e !== void 0 ? _e : null,
20583
- environment: settings.environment && ((_f = settings.environment.rawEnvironment) !== null && _f !== void 0 ? _f : {
20600
+ egSessionId: (_f = (_e = settings.environment) === null || _e === void 0 ? void 0 : _e.ecSessionId) !== null && _f !== void 0 ? _f : null,
20601
+ environment: settings.environment && ((_g = settings.environment.rawEnvironment) !== null && _g !== void 0 ? _g : {
20584
20602
  deviceInfo: settings.environment.deviceName,
20585
20603
  os: settings.environment.os,
20586
20604
  osInfo: settings.environment.displayOs,
@@ -20600,8 +20618,8 @@ var require_requests = __commonJS({
20600
20618
  saveDiffs: settings.saveDiffs,
20601
20619
  timeout: settings.abortIdleTestTimeout,
20602
20620
  isComponentAgent: settings.isComponentTest,
20603
- fallbackExpectedOutput: settings.fallbackBaselineId
20604
- // mapping to the right field is the api
20621
+ fallbackExpectedOutput: settings.fallbackBaselineId,
20622
+ processId: settings.processId
20605
20623
  }
20606
20624
  },
20607
20625
  expected: [200, 201],
@@ -20609,7 +20627,6 @@ var require_requests = __commonJS({
20609
20627
  });
20610
20628
  const test = await response.json().then(async (result) => {
20611
20629
  var _a2, _b2, _c2;
20612
- const account = await accountPromise;
20613
20630
  return {
20614
20631
  testId: result.id,
20615
20632
  // TODO revisit the need for it
@@ -20663,7 +20680,8 @@ var require_requests = __commonJS({
20663
20680
  batchSequenceName: settings.batch.sequenceName,
20664
20681
  startedAt: settings.batch.startedAt,
20665
20682
  notifyOnCompletion: settings.batch.notifyOnCompletion,
20666
- properties: settings.batch.properties
20683
+ properties: settings.batch.properties,
20684
+ buildId: settings.batch.buildId
20667
20685
  },
20668
20686
  egSessionId: (_e = (_d = settings.environment) === null || _d === void 0 ? void 0 : _d.ecSessionId) !== null && _e !== void 0 ? _e : null,
20669
20687
  environment: settings.environment && ((_f = settings.environment.rawEnvironment) !== null && _f !== void 0 ? _f : {
@@ -20852,7 +20870,7 @@ var require_requests = __commonJS({
20852
20870
  logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20853
20871
  const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20854
20872
  logger.log('Request "closeBatch" called with settings', settings);
20855
- await req2(`./api/sessions/batches/${settings.batchId}/close/bypointerId`, {
20873
+ await req2(settings.batchBuildId ? `./api/sessions/batches/${settings.batchId}/${settings.batchBuildId}/close/bypointerId` : `./api/sessions/batches/${settings.batchId}/close/bypointerId`, {
20856
20874
  name: "closeBatch",
20857
20875
  method: "DELETE",
20858
20876
  expected: 200,
@@ -20898,6 +20916,31 @@ var require_requests = __commonJS({
20898
20916
  });
20899
20917
  logger.log('Request "logEvent" finished successfully');
20900
20918
  }
20919
+ async function sendHeartbeat({ settings, logger = mainLogger }) {
20920
+ logger = logger.extend(mainLogger, { tags: [`core-request-${utils34.general.shortid()}`] });
20921
+ const req2 = (0, req_eyes_1.makeReqEyes)({ settings, fetch: fetch2, logger });
20922
+ logger.log('Request "heartbeat" called with settings', settings);
20923
+ await req2(`./api/sessions/sdkprocess/keepalive`, {
20924
+ name: "heartbeat",
20925
+ method: "POST",
20926
+ body: {
20927
+ processId: settings.processId
20928
+ },
20929
+ hooks: {
20930
+ afterError({ error }) {
20931
+ if (error.message.includes("Bad Request(400)")) {
20932
+ error.message = "This process is expired. All its sessions were abandoned";
20933
+ }
20934
+ }
20935
+ },
20936
+ retry: {
20937
+ limit: 0
20938
+ },
20939
+ expected: 200,
20940
+ logger
20941
+ });
20942
+ logger.log('Request "heartbeat" finished successfully');
20943
+ }
20901
20944
  }
20902
20945
  function makeEyesRequests({ core, test, req: req2, upload, logger: mainLogger }) {
20903
20946
  let resultResponsePromise;
@@ -28076,16 +28119,19 @@ var require_open_eyes = __commonJS({
28076
28119
  var get_results_1 = require_get_results();
28077
28120
  var throat_1 = __importDefault(require_throat());
28078
28121
  var utils34 = __importStar(require_browser3());
28079
- function makeOpenEyes({ requests, agentId: defaultAgentId, concurrency, cwd = process.cwd(), logger: mainLogger }) {
28122
+ function makeOpenEyes({ requests, agentId: defaultAgentId, concurrency, cwd = process.cwd(), heartbeat, logger: mainLogger }) {
28080
28123
  const throttle = concurrency ? (0, throat_1.default)(concurrency) : (fn) => fn();
28081
28124
  return async function openEyes({ settings, logger = mainLogger }) {
28082
- var _a;
28125
+ var _a, _b;
28083
28126
  logger = logger.extend(mainLogger, { tags: [`eyes-base-${utils34.general.shortid()}`] });
28084
- if (!settings.ignoreGitBranching && !settings.gitBranchingTimestamp) {
28127
+ (_a = settings.processId) !== null && _a !== void 0 ? _a : settings.processId = heartbeat.processId;
28128
+ if (settings.ignoreGitBranching) {
28129
+ settings.gitBranchingTimestamp = void 0;
28130
+ } else if (!settings.gitBranchingTimestamp) {
28085
28131
  let branchName = settings.branchName;
28086
28132
  let parentBranchName = settings.parentBranchName;
28087
28133
  try {
28088
- if (!branchName && !parentBranchName && ((_a = settings.batch) === null || _a === void 0 ? void 0 : _a.id) && !settings.batch.id.startsWith("generated")) {
28134
+ if (!branchName && !parentBranchName && ((_b = settings.batch) === null || _b === void 0 ? void 0 : _b.id) && !settings.batch.id.startsWith("generated")) {
28089
28135
  const branches = await requests.getBatchBranches({ settings: { ...settings, batchId: settings.batch.id } });
28090
28136
  branchName = branches.branchName;
28091
28137
  parentBranchName = branches.parentBranchName;
@@ -28102,8 +28148,6 @@ var require_open_eyes = __commonJS({
28102
28148
  } catch (err) {
28103
28149
  logger.error("Error during extracting merge timestamp", err);
28104
28150
  }
28105
- } else {
28106
- settings.gitBranchingTimestamp = void 0;
28107
28151
  }
28108
28152
  settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
28109
28153
  logger.log('Command "openEyes" is called with settings', settings);
@@ -28113,7 +28157,7 @@ var require_open_eyes = __commonJS({
28113
28157
  var _a2;
28114
28158
  try {
28115
28159
  const controller = new abort_controller_1.AbortController();
28116
- const eyesRequests = await requests.openEyes({ settings, logger });
28160
+ const eyesRequests = await requests.openEyes({ settings, heartbeat, logger });
28117
28161
  eyesRequests.test.ufgServer = {
28118
28162
  ...eyesRequests.test.ufgServer,
28119
28163
  ufgServerUrl: (_a2 = settings.ufgServerUrl) !== null && _a2 !== void 0 ? _a2 : eyesRequests.test.ufgServer.ufgServerUrl
@@ -28602,6 +28646,79 @@ var require_get_account_info = __commonJS({
28602
28646
  }
28603
28647
  });
28604
28648
 
28649
+ // ../core-base/dist/heartbeat.js
28650
+ var require_heartbeat = __commonJS({
28651
+ "../core-base/dist/heartbeat.js"(exports) {
28652
+ "use strict";
28653
+ init_process();
28654
+ init_setImmediate();
28655
+ init_buffer();
28656
+ init_setInterval();
28657
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
28658
+ if (k2 === void 0)
28659
+ k2 = k;
28660
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28661
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28662
+ desc = { enumerable: true, get: function() {
28663
+ return m[k];
28664
+ } };
28665
+ }
28666
+ Object.defineProperty(o, k2, desc);
28667
+ } : function(o, m, k, k2) {
28668
+ if (k2 === void 0)
28669
+ k2 = k;
28670
+ o[k2] = m[k];
28671
+ });
28672
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
28673
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28674
+ } : function(o, v) {
28675
+ o["default"] = v;
28676
+ });
28677
+ var __importStar = exports && exports.__importStar || function(mod) {
28678
+ if (mod && mod.__esModule)
28679
+ return mod;
28680
+ var result = {};
28681
+ if (mod != null) {
28682
+ for (var k in mod)
28683
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
28684
+ __createBinding(result, mod, k);
28685
+ }
28686
+ __setModuleDefault(result, mod);
28687
+ return result;
28688
+ };
28689
+ Object.defineProperty(exports, "__esModule", { value: true });
28690
+ exports.makeHeartbeat = void 0;
28691
+ var utils34 = __importStar(require_browser3());
28692
+ function makeHeartbeat({ requests, logger: mainLogger }) {
28693
+ const logger = mainLogger.extend(mainLogger, { tags: [`heartbeat-base-${utils34.general.shortid()}`] });
28694
+ const processId = utils34.general.guid();
28695
+ let isStarted = false;
28696
+ return {
28697
+ processId,
28698
+ async startPeriodicHeartbeatMessaging(settings) {
28699
+ var _a;
28700
+ if (!isStarted) {
28701
+ isStarted = true;
28702
+ const interval = (_a = settings.interval) !== null && _a !== void 0 ? _a : 1e4;
28703
+ await requests.sendHeartbeat({ settings, logger });
28704
+ const intervalId = setIntervalBrowser(async () => {
28705
+ try {
28706
+ await requests.sendHeartbeat({ settings, logger });
28707
+ } catch (error) {
28708
+ if (error.message === "This process is expired. All its sessions were abandoned") {
28709
+ clearInterval(intervalId);
28710
+ }
28711
+ }
28712
+ }, interval);
28713
+ intervalId.unref();
28714
+ }
28715
+ }
28716
+ };
28717
+ }
28718
+ exports.makeHeartbeat = makeHeartbeat;
28719
+ }
28720
+ });
28721
+
28605
28722
  // ../core-base/dist/core.js
28606
28723
  var require_core = __commonJS({
28607
28724
  "../core-base/dist/core.js"(exports) {
@@ -28622,15 +28739,17 @@ var require_core = __commonJS({
28622
28739
  var close_batch_1 = require_close_batch();
28623
28740
  var delete_test_1 = require_delete_test();
28624
28741
  var get_account_info_1 = require_get_account_info();
28742
+ var heartbeat_1 = require_heartbeat();
28625
28743
  function makeCore({ agentId = "core-base", concurrency, cwd = process.cwd(), logger: defaultLogger }) {
28626
28744
  const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: "core-base" } });
28627
28745
  logger.log(`Core is initialized in directory ${cwd} for agent ${agentId}`);
28628
28746
  const requests = (0, requests_1.makeCoreRequestsWithCache)({ logger });
28747
+ const heartbeat = (0, heartbeat_1.makeHeartbeat)({ requests, logger });
28629
28748
  return {
28630
28749
  get concurrency() {
28631
28750
  return concurrency;
28632
28751
  },
28633
- openEyes: (0, open_eyes_1.makeOpenEyes)({ requests, agentId, concurrency, cwd, logger }),
28752
+ openEyes: (0, open_eyes_1.makeOpenEyes)({ requests, agentId, concurrency, cwd, heartbeat, logger }),
28634
28753
  openFunctionalSession: (0, open_functional_session_1.makeOpenFunctionalSession)({ requests, agentId, concurrency, cwd, logger }),
28635
28754
  locate: (0, locate_1.makeLocate)({ requests, agentId, logger }),
28636
28755
  locateText: (0, locate_text_1.makeLocateText)({ requests, agentId, logger }),
@@ -37192,16 +37311,17 @@ var require_open_eyes2 = __commonJS({
37192
37311
  const controller = new abort_controller_1.AbortController();
37193
37312
  const account = await core.getAccountInfo({ settings, logger });
37194
37313
  return utils34.general.extend({}, (eyes) => {
37195
- var _a2, _b2, _c2;
37314
+ var _a2, _b2, _c2, _d;
37196
37315
  return {
37197
37316
  type: "classic",
37198
37317
  core,
37199
37318
  test: {
37200
37319
  userTestId: settings.userTestId,
37201
37320
  batchId: (_a2 = settings.batch) === null || _a2 === void 0 ? void 0 : _a2.id,
37321
+ batchBuildId: (_b2 = settings.batch) === null || _b2 === void 0 ? void 0 : _b2.buildId,
37202
37322
  keepBatchOpen: settings.keepBatchOpen,
37203
37323
  eyesServer: account.eyesServer,
37204
- ufgServer: { ...account.ufgServer, ufgServerUrl: (_b2 = settings.ufgServerUrl) !== null && _b2 !== void 0 ? _b2 : (_c2 = account.ufgServer) === null || _c2 === void 0 ? void 0 : _c2.ufgServerUrl },
37324
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_c2 = settings.ufgServerUrl) !== null && _c2 !== void 0 ? _c2 : (_d = account.ufgServer) === null || _d === void 0 ? void 0 : _d.ufgServerUrl },
37205
37325
  uploadUrl: account.uploadUrl,
37206
37326
  stitchingServiceUrl: account.stitchingServiceUrl,
37207
37327
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -85326,16 +85446,17 @@ var require_open_eyes3 = __commonJS({
85326
85446
  const controller = new abort_controller_1.AbortController();
85327
85447
  const account = await core.getAccountInfo({ settings, logger });
85328
85448
  return utils34.general.extend({}, (eyes) => {
85329
- var _a2, _b2, _c2;
85449
+ var _a2, _b2, _c2, _d;
85330
85450
  return {
85331
85451
  type: "ufg",
85332
85452
  core,
85333
85453
  test: {
85334
85454
  userTestId: settings.userTestId,
85335
85455
  batchId: (_a2 = settings.batch) === null || _a2 === void 0 ? void 0 : _a2.id,
85456
+ batchBuildId: (_b2 = settings.batch) === null || _b2 === void 0 ? void 0 : _b2.buildId,
85336
85457
  keepBatchOpen: settings.keepBatchOpen,
85337
85458
  eyesServer: account.eyesServer,
85338
- ufgServer: { ...account.ufgServer, ufgServerUrl: (_b2 = settings.ufgServerUrl) !== null && _b2 !== void 0 ? _b2 : (_c2 = account.ufgServer) === null || _c2 === void 0 ? void 0 : _c2.ufgServerUrl },
85459
+ ufgServer: { ...account.ufgServer, ufgServerUrl: (_c2 = settings.ufgServerUrl) !== null && _c2 !== void 0 ? _c2 : (_d = account.ufgServer) === null || _d === void 0 ? void 0 : _d.ufgServerUrl },
85339
85460
  uploadUrl: account.uploadUrl,
85340
85461
  stitchingServiceUrl: account.stitchingServiceUrl,
85341
85462
  supportedEnvironmentsUrl: account.supportedEnvironmentsUrl,
@@ -85885,24 +86006,26 @@ var require_open_eyes4 = __commonJS({
85885
86006
  var utils34 = __importStar(require_browser3());
85886
86007
  function makeOpenEyes({ type: defaultType = "classic", clients, batch, core, cores, spec, environment, logger: mainLogger, asyncCache }) {
85887
86008
  return async function openEyes({ type = defaultType, settings, config, target, logger = mainLogger }) {
85888
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
85889
- var _r, _s, _t, _u;
86009
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
86010
+ var _t, _u, _v, _w, _x;
85890
86011
  logger = logger.extend(mainLogger, { tags: [`eyes-${type}-${utils34.general.shortid()}`] });
85891
86012
  settings = { ...config === null || config === void 0 ? void 0 : config.open, ...settings };
85892
86013
  (0, populate_eyes_server_settings_1.populateEyesServerSettings)(settings);
85893
86014
  (_a = settings.userTestId) !== null && _a !== void 0 ? _a : settings.userTestId = `${settings.testName}--${utils34.general.guid()}`;
85894
86015
  settings.batch = { ...batch, ...settings.batch };
85895
- (_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()}`;
85896
- (_d = (_s = settings.batch).name) !== null && _d !== void 0 ? _d : _s.name = utils34.general.getEnvValue("BATCH_NAME");
85897
- (_e = (_t = settings.batch).sequenceName) !== null && _e !== void 0 ? _e : _t.sequenceName = utils34.general.getEnvValue("BATCH_SEQUENCE");
85898
- (_f = (_u = settings.batch).notifyOnCompletion) !== null && _f !== void 0 ? _f : _u.notifyOnCompletion = utils34.general.getEnvValue("BATCH_NOTIFY", "boolean");
85899
- (_g = settings.keepBatchOpen) !== null && _g !== void 0 ? _g : settings.keepBatchOpen = utils34.general.getEnvValue("DONT_CLOSE_BATCHES", "boolean");
85900
- (_h = settings.branchName) !== null && _h !== void 0 ? _h : settings.branchName = utils34.general.getEnvValue("BRANCH");
85901
- (_j = settings.parentBranchName) !== null && _j !== void 0 ? _j : settings.parentBranchName = utils34.general.getEnvValue("PARENT_BRANCH");
85902
- (_k = settings.baselineBranchName) !== null && _k !== void 0 ? _k : settings.baselineBranchName = utils34.general.getEnvValue("BASELINE_BRANCH");
85903
- (_l = settings.ufgServerUrl) !== null && _l !== void 0 ? _l : settings.ufgServerUrl = utils34.general.getEnvValue("UFG_SERVER_URL");
85904
- (_m = settings.ignoreBaseline) !== null && _m !== void 0 ? _m : settings.ignoreBaseline = false;
85905
- (_o = settings.compareWithParentBranch) !== null && _o !== void 0 ? _o : settings.compareWithParentBranch = false;
86016
+ (_b = (_t = settings.batch).id) !== null && _b !== void 0 ? _b : _t.id = (_c = utils34.general.getEnvValue("BATCH_ID")) !== null && _c !== void 0 ? _c : `generated-${utils34.general.guid()}`;
86017
+ (_d = (_u = settings.batch).buildId) !== null && _d !== void 0 ? _d : _u.buildId = utils34.general.getEnvValue("BATCH_BUILD_ID");
86018
+ (_e = (_v = settings.batch).name) !== null && _e !== void 0 ? _e : _v.name = utils34.general.getEnvValue("BATCH_NAME");
86019
+ (_f = (_w = settings.batch).sequenceName) !== null && _f !== void 0 ? _f : _w.sequenceName = utils34.general.getEnvValue("BATCH_SEQUENCE");
86020
+ (_g = (_x = settings.batch).notifyOnCompletion) !== null && _g !== void 0 ? _g : _x.notifyOnCompletion = utils34.general.getEnvValue("BATCH_NOTIFY", "boolean");
86021
+ (_h = settings.keepBatchOpen) !== null && _h !== void 0 ? _h : settings.keepBatchOpen = utils34.general.getEnvValue("DONT_CLOSE_BATCHES", "boolean");
86022
+ (_j = settings.branchName) !== null && _j !== void 0 ? _j : settings.branchName = utils34.general.getEnvValue("BRANCH");
86023
+ (_k = settings.parentBranchName) !== null && _k !== void 0 ? _k : settings.parentBranchName = utils34.general.getEnvValue("PARENT_BRANCH");
86024
+ (_l = settings.baselineBranchName) !== null && _l !== void 0 ? _l : settings.baselineBranchName = utils34.general.getEnvValue("BASELINE_BRANCH");
86025
+ (_m = settings.gitBranchingTimestamp) !== null && _m !== void 0 ? _m : settings.gitBranchingTimestamp = utils34.general.getEnvValue("GIT_MERGE_BASE_TIMESTAMP");
86026
+ (_o = settings.ufgServerUrl) !== null && _o !== void 0 ? _o : settings.ufgServerUrl = utils34.general.getEnvValue("UFG_SERVER_URL");
86027
+ (_p = settings.ignoreBaseline) !== null && _p !== void 0 ? _p : settings.ignoreBaseline = false;
86028
+ (_q = settings.compareWithParentBranch) !== null && _q !== void 0 ? _q : settings.compareWithParentBranch = false;
85906
86029
  const driver = target && await (0, driver_1.makeDriver)({ spec, driver: target, logger, customConfig: settings });
85907
86030
  const driverEnvironment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
85908
86031
  const driverUrl = await (driver === null || driver === void 0 ? void 0 : driver.getDriverUrl());
@@ -85913,7 +86036,7 @@ var require_open_eyes4 = __commonJS({
85913
86036
  event: {
85914
86037
  type: "openEyes",
85915
86038
  userTestId: settings.userTestId,
85916
- concurrency: (_p = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _p !== void 0 ? _p : core.concurrency,
86039
+ concurrency: (_r = cores === null || cores === void 0 ? void 0 : cores[type].concurrency) !== null && _r !== void 0 ? _r : core.concurrency,
85917
86040
  environment,
85918
86041
  driver: {
85919
86042
  deviceName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.deviceName,
@@ -85921,7 +86044,7 @@ var require_open_eyes4 = __commonJS({
85921
86044
  browserVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.browserVersion,
85922
86045
  platformName: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformName,
85923
86046
  platformVersion: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.platformVersion,
85924
- isApplitoolsLib: (_q = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _q === void 0 ? void 0 : _q.instrumented,
86047
+ isApplitoolsLib: (_s = driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.applitoolsLib) === null || _s === void 0 ? void 0 : _s.instrumented,
85925
86048
  isEC: driverEnvironment === null || driverEnvironment === void 0 ? void 0 : driverEnvironment.isEC
85926
86049
  },
85927
86050
  driverUrl
@@ -86115,7 +86238,7 @@ var require_get_manager_results = __commonJS({
86115
86238
  }
86116
86239
  const batches = storage.reduce((batches2, eyes) => {
86117
86240
  if (!eyes.test.keepBatchOpen) {
86118
- const settings2 = { ...eyes.test.eyesServer, batchId: eyes.test.batchId };
86241
+ const settings2 = { ...eyes.test.eyesServer, batchId: eyes.test.batchId, batchBuildId: eyes.test.batchBuildId };
86119
86242
  batches2[`${settings2.eyesServerUrl}:${settings2.apiKey}:${settings2.batchId}`] = settings2;
86120
86243
  }
86121
86244
  return batches2;
@@ -86206,14 +86329,15 @@ var require_make_manager = __commonJS({
86206
86329
  var utils34 = __importStar(require_browser3());
86207
86330
  function makeMakeManager({ spec, clients, core, base: defaultBase, agentId: defaultAgentId, environment, cwd = process.cwd(), logger: mainLogger, asyncCache }) {
86208
86331
  return async function makeManager({ type = "classic", settings, logger = mainLogger } = {}) {
86209
- var _a, _b, _c, _d, _e, _f;
86210
- var _g;
86332
+ var _a, _b, _c, _d, _e, _f, _g;
86333
+ var _h, _j;
86211
86334
  logger = logger.extend(mainLogger, { tags: [`manager-${type}-${utils34.general.shortid()}`] });
86212
86335
  settings !== null && settings !== void 0 ? settings : settings = {};
86213
86336
  (_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;
86214
86337
  (_c = settings.batch) !== null && _c !== void 0 ? _c : settings.batch = {};
86215
- (_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()}`;
86216
- (_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;
86338
+ (_d = (_h = settings.batch).id) !== null && _d !== void 0 ? _d : _h.id = (_e = utils34.general.getEnvValue("BATCH_ID")) !== null && _e !== void 0 ? _e : `generated-${utils34.general.guid()}`;
86339
+ (_f = (_j = settings.batch).buildId) !== null && _f !== void 0 ? _f : _j.buildId = utils34.general.getEnvValue("BATCH_BUILD_ID");
86340
+ (_g = settings.agentId) !== null && _g !== void 0 ? _g : settings.agentId = type === "ufg" ? defaultAgentId === null || defaultAgentId === void 0 ? void 0 : defaultAgentId.replace(/(\/\d)/, ".visualgrid$1") : defaultAgentId;
86217
86341
  logger.log('Command "makeManager" is called with settings', settings);
86218
86342
  const base = defaultBase !== null && defaultBase !== void 0 ? defaultBase : (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, cwd, logger });
86219
86343
  const cores = {
@@ -86417,7 +86541,7 @@ var require_package2 = __commonJS({
86417
86541
  "../core/package.json"(exports, module) {
86418
86542
  module.exports = {
86419
86543
  name: "@applitools/core",
86420
- version: "4.10.2",
86544
+ version: "4.11.1",
86421
86545
  homepage: "https://applitools.com",
86422
86546
  bugs: {
86423
86547
  url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -86483,7 +86607,7 @@ var require_package2 = __commonJS({
86483
86607
  }
86484
86608
  },
86485
86609
  targets: {
86486
- "node20-linux-x64-glibc-217": "./bin/core-linux",
86610
+ "node20.11-linux-x64-glibc-217": "./bin/core-linux",
86487
86611
  "node20-linux-x64-musl": "./bin/core-alpine",
86488
86612
  "node20-linux-arm64": "./bin/core-linux-arm64",
86489
86613
  "node20-darwin-x64": "./bin/core-macos",
@@ -90193,7 +90317,7 @@ var require_package3 = __commonJS({
90193
90317
  "../eyes/package.json"(exports, module) {
90194
90318
  module.exports = {
90195
90319
  name: "@applitools/eyes",
90196
- version: "1.16.2",
90320
+ version: "1.17.1",
90197
90321
  keywords: [
90198
90322
  "applitools",
90199
90323
  "eyes",
@@ -93177,6 +93301,20 @@ var ConfigurationData = class {
93177
93301
  this.baselineBranchName = baselineBranchName;
93178
93302
  return this;
93179
93303
  }
93304
+ get gitMergeBaseTimestamp() {
93305
+ return this._config.gitMergeBaseTimestamp;
93306
+ }
93307
+ set gitMergeBaseTimestamp(gitMergeBaseTimestamp) {
93308
+ utils20.guard.isString(gitMergeBaseTimestamp, { name: "gitMergeBaseTimestamp" });
93309
+ this._config.gitMergeBaseTimestamp = gitMergeBaseTimestamp;
93310
+ }
93311
+ getGitMergeBaseTimestamp() {
93312
+ return this.gitMergeBaseTimestamp;
93313
+ }
93314
+ setGitMergeBaseTimestamp(gitMergeBaseTimestamp) {
93315
+ this.gitMergeBaseTimestamp = gitMergeBaseTimestamp;
93316
+ return this;
93317
+ }
93180
93318
  get compareWithParentBranch() {
93181
93319
  return this._config.compareWithParentBranch;
93182
93320
  }
@@ -93752,6 +93890,7 @@ var ConfigurationData = class {
93752
93890
  baselineBranchName: this.baselineBranchName,
93753
93891
  compareWithParentBranch: this.compareWithParentBranch,
93754
93892
  ignoreBaseline: this.ignoreBaseline,
93893
+ gitBranchingTimestamp: this.gitMergeBaseTimestamp,
93755
93894
  ignoreGitBranching: this.ignoreGitMergeBase,
93756
93895
  saveDiffs: this.saveDiffs,
93757
93896
  keepBatchOpen: this.dontCloseBatches
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-browser",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
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.16.2"
51
+ "@applitools/eyes": "1.17.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^12.20.55",
@@ -52,6 +52,7 @@ export type Configuration<TSpec extends Core.SpecType = Core.SpecType> = {
52
52
  environmentName?: string;
53
53
  branchName?: string;
54
54
  parentBranchName?: string;
55
+ gitMergeBaseTimestamp?: string;
55
56
  baselineBranchName?: string;
56
57
  compareWithParentBranch?: boolean;
57
58
  ignoreBaseline?: boolean;
@@ -206,6 +207,10 @@ export declare class ConfigurationData<TSpec extends Core.SpecType = Core.SpecTy
206
207
  set baselineBranchName(baselineBranchName: string);
207
208
  getBaselineBranchName(): string;
208
209
  setBaselineBranchName(baselineBranchName: string): this;
210
+ get gitMergeBaseTimestamp(): string;
211
+ set gitMergeBaseTimestamp(gitMergeBaseTimestamp: string);
212
+ getGitMergeBaseTimestamp(): string;
213
+ setGitMergeBaseTimestamp(gitMergeBaseTimestamp: string): this;
209
214
  get compareWithParentBranch(): boolean;
210
215
  set compareWithParentBranch(compareWithParentBranch: boolean);
211
216
  getCompareWithParentBranch(): boolean;