@applitools/eyes 1.30.0 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.31.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes@1.30.0...js/eyes@1.31.0) (2025-01-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/dom-snapshot bumped to 4.11.14
14
+ #### Bug Fixes
15
+
16
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
17
+
18
+
19
+
20
+ * @applitools/snippets bumped to 2.6.4
21
+ #### Bug Fixes
22
+
23
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
24
+ * @applitools/dom-capture bumped to 11.5.4
25
+ #### Bug Fixes
26
+
27
+ * remove side-eyes and fix code scanning issues ([#2712](https://github.com/Applitools-Dev/sdk/issues/2712)) ([cda98e4](https://github.com/Applitools-Dev/sdk/commit/cda98e4748c73cd97c11f646a2b5e26ff9416892))
28
+ * @applitools/driver bumped to 1.20.3
29
+
30
+ * @applitools/spec-driver-webdriver bumped to 1.1.23
31
+
32
+ * @applitools/spec-driver-selenium bumped to 1.5.94
33
+
34
+ * @applitools/spec-driver-puppeteer bumped to 1.4.23
35
+
36
+ * @applitools/screenshoter bumped to 3.10.3
37
+
38
+ * @applitools/nml-client bumped to 1.8.22
39
+
40
+ * @applitools/ec-client bumped to 1.10.1
41
+
42
+ * @applitools/core bumped to 4.29.0
43
+ #### Features
44
+
45
+ * jsonFilePath in offline mode ([#2734](https://github.com/Applitools-Dev/sdk/issues/2734)) ([2f9fbe8](https://github.com/Applitools-Dev/sdk/commit/2f9fbe8fc3c5212db6b7cc58a98b041c3ffd5572))
46
+
47
+
48
+ #### Bug Fixes
49
+
50
+ * support batching tests in distributed env - close batch only when required ([#2733](https://github.com/Applitools-Dev/sdk/issues/2733)) ([2e59e4a](https://github.com/Applitools-Dev/sdk/commit/2e59e4a76edcc02b8888dfc78a42749bae76f79c))
51
+
52
+
53
+
54
+
3
55
  ## [1.30.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-v1.29.4...js/eyes@1.30.0) (2024-12-31)
4
56
 
5
57
 
package/dist/Eyes.js CHANGED
@@ -58,7 +58,7 @@ class Eyes {
58
58
  }
59
59
  static async setViewportSize(driver, size) {
60
60
  var _a;
61
- const { core } = (0, SDK_1.initSDK)(this._sdk);
61
+ const { core } = (0, SDK_1.initSDK)(this._sdk, true);
62
62
  await ((_a = core.setViewportSize) === null || _a === void 0 ? void 0 : _a.call(core, { target: driver, size: { width: size.width, height: size.height } }));
63
63
  }
64
64
  static setMobileCapabilities(capabilities, config) {
@@ -92,7 +92,7 @@ class Eyes {
92
92
  this._state = {};
93
93
  this._events = new Map();
94
94
  this._handlers = new SessionEventHandlers_1.SessionEventHandlers();
95
- const maskLog = utils.types.instanceOf(runnerOrConfig, Runners_1.EyesRunner) ? runnerOrConfig._maskLog : false;
95
+ const maskLog = utils.types.instanceOf(runnerOrConfig, Runners_1.EyesRunner) ? runnerOrConfig._maskLog : undefined;
96
96
  const sdk = (0, SDK_1.initSDK)(this._sdk, maskLog);
97
97
  this._spec = sdk.spec;
98
98
  this._core = sdk.core;
package/dist/SDK.js CHANGED
@@ -23,19 +23,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.initSDK = void 0;
26
+ exports.getCoreWithCache = exports.initSDK = void 0;
27
27
  const core_1 = require("@applitools/core");
28
28
  const utils = __importStar(require("@applitools/utils"));
29
29
  function initSDK(options, maskLog) {
30
30
  if (options)
31
31
  options.maskLog = maskLog;
32
32
  return {
33
- core: getCoreWithCache(options),
33
+ core: (0, exports.getCoreWithCache)(options),
34
34
  spec: options === null || options === void 0 ? void 0 : options.spec,
35
35
  };
36
36
  }
37
37
  exports.initSDK = initSDK;
38
- const getCoreWithCache = utils.general.cachify(getCore);
38
+ exports.getCoreWithCache = utils.general.cachify(getCore);
39
39
  function getCore({ makeCore = core_1.makeCore, ...options } = {}) {
40
40
  var _a;
41
41
  (_a = options.agentId) !== null && _a !== void 0 ? _a : (options.agentId = `js/eyes/${require('../package.json').version}`);
package/dist/cli/cli.js CHANGED
@@ -29,6 +29,10 @@ void yargs_1.default
29
29
  description: 'path to configuration file (applitools.config.js / applitools.config.ts)',
30
30
  type: 'string',
31
31
  },
32
+ jsonFilePath: {
33
+ description: 'path to json file with the test results',
34
+ type: 'string',
35
+ },
32
36
  })
33
37
  .fail((_msg, err, _yargs) => {
34
38
  if (err) {
@@ -483,6 +483,26 @@ class ConfigurationData {
483
483
  this.gitMergeBaseTimestamp = gitMergeBaseTimestamp;
484
484
  return this;
485
485
  }
486
+ get latestCommitInfo() {
487
+ return this._config.latestCommitInfo;
488
+ }
489
+ set latestCommitInfo(latestCommitInfo) {
490
+ if (latestCommitInfo) {
491
+ utils.guard.isString(latestCommitInfo.sha, { name: 'latestCommitInfo.sha' });
492
+ // TODO implement utils.guard.isISODate (didn't do it to avoid releasing utils and then all packages for this small thing)
493
+ utils.guard.custom(latestCommitInfo.timestamp, (timestamp) => isISODate(timestamp), {
494
+ name: 'latestCommitInfo.timestamp',
495
+ });
496
+ }
497
+ this._config.latestCommitInfo = latestCommitInfo;
498
+ }
499
+ getLatestCommitInfo() {
500
+ return this.latestCommitInfo;
501
+ }
502
+ setLatestCommitInfo(latestCommitInfo) {
503
+ this.latestCommitInfo = latestCommitInfo;
504
+ return this;
505
+ }
486
506
  get hideCaret() {
487
507
  return this._config.hideCaret;
488
508
  }
@@ -1062,6 +1082,7 @@ class ConfigurationData {
1062
1082
  ignoreBaseline: this.ignoreBaseline,
1063
1083
  gitBranchingTimestamp: this.gitMergeBaseTimestamp,
1064
1084
  ignoreGitBranching: this.ignoreGitMergeBase,
1085
+ latestCommitInfo: this.latestCommitInfo,
1065
1086
  saveDiffs: this.saveDiffs,
1066
1087
  keepBatchOpen: this.dontCloseBatches,
1067
1088
  disableBrokerUrlCache: this.disableNMLUrlCache,
@@ -1133,3 +1154,7 @@ class ConfigurationData {
1133
1154
  }
1134
1155
  }
1135
1156
  exports.ConfigurationData = ConfigurationData;
1157
+ // TODO: should be in utils
1158
+ function isISODate(str) {
1159
+ return /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\+\d{2}:\d{2})?/.test(str);
1160
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -46,7 +46,7 @@
46
46
  "test": "run --top-level mocha './test/**/*.spec.ts'"
47
47
  },
48
48
  "dependencies": {
49
- "@applitools/core": "4.28.0",
49
+ "@applitools/core": "4.29.0",
50
50
  "@applitools/logger": "2.1.0",
51
51
  "@applitools/utils": "1.7.7",
52
52
  "chalk": "4.1.2"
package/types/SDK.d.ts CHANGED
@@ -10,3 +10,10 @@ export declare function initSDK<TSpec extends SpecType = SpecType>(options?: SDK
10
10
  core: Core<TSpec, 'classic' | 'ufg'>;
11
11
  spec?: SpecDriver<TSpec>;
12
12
  };
13
+ export declare const getCoreWithCache: typeof getCore & {
14
+ getCachedValues(): Core<SpecType, "classic" | "ufg">[];
15
+ setCachedValue(key: any, value: Core<SpecType, "classic" | "ufg">): void;
16
+ clearCache(): void;
17
+ };
18
+ declare function getCore<TSpec extends SpecType = SpecType>({ makeCore, ...options }?: SDK<TSpec>): Core<TSpec, 'classic' | 'ufg'>;
19
+ export {};
@@ -18,6 +18,7 @@ import { AUTProxySettings } from './AUTProxySettings';
18
18
  import { BatchInfo, BatchInfoData } from './BatchInfo';
19
19
  import { PropertyData, PropertyDataData } from './PropertyData';
20
20
  import { ImageMatchSettings } from './ImageMatchSettings';
21
+ import { LatestCommitInfo } from './LatestCommitInfo';
21
22
  export type Configuration<TSpec extends Core.SpecType = Core.SpecType> = {
22
23
  accessibilityValidation?: AccessibilitySettings;
23
24
  agentId?: string;
@@ -49,6 +50,7 @@ export type Configuration<TSpec extends Core.SpecType = Core.SpecType> = {
49
50
  environmentName?: string;
50
51
  forceFullPageScreenshot?: boolean;
51
52
  gitMergeBaseTimestamp?: string;
53
+ latestCommitInfo?: LatestCommitInfo;
52
54
  hideCaret?: boolean;
53
55
  hideScrollbars?: boolean;
54
56
  hostApp?: string;
@@ -234,6 +236,10 @@ export declare class ConfigurationData<TSpec extends Core.SpecType = Core.SpecTy
234
236
  set gitMergeBaseTimestamp(gitMergeBaseTimestamp: string);
235
237
  getGitMergeBaseTimestamp(): string;
236
238
  setGitMergeBaseTimestamp(gitMergeBaseTimestamp: string): this;
239
+ get latestCommitInfo(): LatestCommitInfo;
240
+ set latestCommitInfo(latestCommitInfo: LatestCommitInfo);
241
+ getLatestCommitInfo(): LatestCommitInfo;
242
+ setLatestCommitInfo(latestCommitInfo: LatestCommitInfo): this;
237
243
  get hideCaret(): boolean;
238
244
  set hideCaret(hideCaret: boolean);
239
245
  getHideCaret(): boolean;
@@ -0,0 +1,4 @@
1
+ export type LatestCommitInfo = {
2
+ timestamp: string;
3
+ sha: string;
4
+ };