@applitools/eyes 1.1.3 → 1.1.5

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/dist/Eyes.js CHANGED
@@ -33,6 +33,7 @@ const TestFailedError_1 = require("./errors/TestFailedError");
33
33
  const CheckSettings_1 = require("./input/CheckSettings");
34
34
  const Configuration_1 = require("./input/Configuration");
35
35
  const RectangleSize_1 = require("./input/RectangleSize");
36
+ const Region_1 = require("./input/Region");
36
37
  const LogHandler_1 = require("./input/LogHandler");
37
38
  const MatchResult_1 = require("./output/MatchResult");
38
39
  const TestResults_1 = require("./output/TestResults");
@@ -278,7 +279,11 @@ class Eyes {
278
279
  if (!this.isOpen)
279
280
  throw new EyesError_1.EyesError('Eyes not open');
280
281
  const config = this._config.toJSON();
281
- return this._core.locate({ target: this._driver, settings: { ...this._state, ...settings }, config });
282
+ const results = await this._core.locate({ target: this._driver, settings: { ...this._state, ...settings }, config });
283
+ return Object.entries(results).reduce((results, [key, regions]) => {
284
+ results[key] = regions.map(region => new Region_1.RegionData(region));
285
+ return results;
286
+ }, {});
282
287
  }
283
288
  async extractTextRegions(targetOrSettings, settings) {
284
289
  if (this._config.isDisabled)
package/dist/Runners.js CHANGED
@@ -32,8 +32,16 @@ const TestResults_1 = require("./output/TestResults");
32
32
  const TestResultsSummary_1 = require("./output/TestResultsSummary");
33
33
  const utils = __importStar(require("@applitools/utils"));
34
34
  class EyesRunner {
35
- constructor() {
35
+ constructor(options) {
36
36
  this._eyes = [];
37
+ /** @internal */
38
+ this._managerSettings = {};
39
+ /** @internal */
40
+ this._getResultsSettings = {};
41
+ if (options) {
42
+ this._managerSettings = { concurrency: options.testConcurrency, legacyConcurrency: options.legacyConcurrency };
43
+ this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
44
+ }
37
45
  }
38
46
  /** @internal */
39
47
  attach(eyes, core) {
@@ -85,19 +93,18 @@ class EyesRunner {
85
93
  exports.EyesRunner = EyesRunner;
86
94
  class VisualGridRunner extends EyesRunner {
87
95
  constructor(optionsOrLegacyConcurrency) {
88
- super();
89
- /** @internal */
90
- this.type = 'ufg';
91
- if (utils.types.isNumber(optionsOrLegacyConcurrency)) {
92
- this._managerSettings = { legacyConcurrency: optionsOrLegacyConcurrency };
96
+ let options;
97
+ if (utils.types.instanceOf(optionsOrLegacyConcurrency, RunnerOptions_1.RunnerOptionsFluent)) {
98
+ options = optionsOrLegacyConcurrency.toJSON();
93
99
  }
94
- else if (optionsOrLegacyConcurrency) {
95
- const options = optionsOrLegacyConcurrency instanceof RunnerOptions_1.RunnerOptionsFluent
96
- ? optionsOrLegacyConcurrency.toJSON()
97
- : optionsOrLegacyConcurrency;
98
- this._managerSettings = { concurrency: options.testConcurrency };
99
- this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
100
+ else if (utils.types.isNumber(optionsOrLegacyConcurrency)) {
101
+ options = { legacyConcurrency: optionsOrLegacyConcurrency };
102
+ }
103
+ else {
104
+ options = optionsOrLegacyConcurrency;
100
105
  }
106
+ super(options);
107
+ this.type = 'ufg';
101
108
  }
102
109
  get testConcurrency() {
103
110
  var _a;
@@ -116,13 +123,9 @@ class VisualGridRunner extends EyesRunner {
116
123
  }
117
124
  exports.VisualGridRunner = VisualGridRunner;
118
125
  class ClassicRunner extends EyesRunner {
119
- constructor(options) {
120
- super();
121
- /** @internal */
126
+ constructor() {
127
+ super(...arguments);
122
128
  this.type = 'classic';
123
- if (options) {
124
- this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
125
- }
126
129
  }
127
130
  }
128
131
  exports.ClassicRunner = ClassicRunner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -53,13 +53,13 @@
53
53
  "postversion": "bongo postversion"
54
54
  },
55
55
  "dependencies": {
56
- "@applitools/core": "2.4.8",
56
+ "@applitools/core": "2.4.11",
57
57
  "@applitools/logger": "1.1.48",
58
58
  "@applitools/utils": "1.3.32"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@applitools/bongo": "^3.0.3",
62
- "@applitools/req": "^1.1.33",
62
+ "@applitools/req": "^1.1.34",
63
63
  "@types/node": "^12.20.55"
64
64
  },
65
65
  "engines": {
@@ -9,9 +9,10 @@ export declare abstract class EyesRunner {
9
9
  private _eyes;
10
10
  abstract readonly type: 'classic' | 'ufg';
11
11
  /** @internal */
12
- protected readonly _managerSettings?: Core.ManagerSettings;
12
+ protected readonly _managerSettings: Core.ManagerSettings;
13
13
  /** @internal */
14
- protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'classic' | 'ufg'>;
14
+ protected readonly _getResultsSettings: Core.GetManagerResultsSettings<'classic' | 'ufg'>;
15
+ constructor(options?: RunnerOptions);
15
16
  /** @internal */
16
17
  attach<TSpec extends Core.SpecType = Core.SpecType>(eyes: Eyes<TSpec>, core: Core.Core<TSpec, 'classic' | 'ufg'>): void;
17
18
  /** @internal */
@@ -24,13 +25,7 @@ export declare abstract class EyesRunner {
24
25
  getAllTestResults(throwErr?: boolean): Promise<TestResultsSummaryData>;
25
26
  }
26
27
  export declare class VisualGridRunner extends EyesRunner {
27
- /** @internal */
28
28
  readonly type: "ufg";
29
- /** @internal */
30
- /** @internal */
31
- protected readonly _managerSettings?: Core.ManagerSettings;
32
- /** @internal */
33
- protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'ufg'>;
34
29
  constructor(options?: RunnerOptions);
35
30
  /** @deprecated */
36
31
  constructor(options?: RunnerOptionsFluent);
@@ -43,9 +38,5 @@ export declare class VisualGridRunner extends EyesRunner {
43
38
  getConcurrentSessions(): number | undefined;
44
39
  }
45
40
  export declare class ClassicRunner extends EyesRunner {
46
- /** @internal */
47
41
  readonly type: "classic";
48
- /** @internal */
49
- protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'classic'>;
50
- constructor(options?: RunnerOptions);
51
42
  }
@@ -1,5 +1,7 @@
1
1
  export type RunnerOptions = {
2
2
  testConcurrency?: number;
3
+ /** @internal */
4
+ legacyConcurrency?: number;
3
5
  removeDuplicateTests?: boolean;
4
6
  };
5
7
  /** @deprecated */
@@ -36,12 +36,12 @@ export type TestResults = {
36
36
  readonly layoutMatches?: number;
37
37
  readonly noneMatches?: number;
38
38
  readonly url?: string;
39
- readonly server: {
39
+ readonly server?: {
40
40
  serverUrl: string;
41
41
  apiKey: string;
42
42
  proxy?: ProxySettings;
43
43
  };
44
- readonly keepIfDuplicate: boolean;
44
+ readonly keepIfDuplicate?: boolean;
45
45
  };
46
46
  export declare class TestResultsData implements Required<TestResults> {
47
47
  private _result;