@applitools/eyes 1.0.1 → 1.1.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/dist/Eyes.js CHANGED
@@ -230,7 +230,7 @@ class Eyes {
230
230
  (_a = (_c = config.screenshot).fully) !== null && _a !== void 0 ? _a : (_c.fully = false);
231
231
  let type;
232
232
  if (((_b = settings === null || settings === void 0 ? void 0 : settings.nmgOptions) === null || _b === void 0 ? void 0 : _b.nonNMGCheck) === 'addToAllDevices') {
233
- type = this._runner.config.type === 'ufg' ? 'classic' : 'ufg';
233
+ type = this._runner.type === 'ufg' ? 'classic' : 'ufg';
234
234
  }
235
235
  const [result] = await this._eyes.check({ type, target, settings, config });
236
236
  return new MatchResult_1.MatchResultData(result);
package/dist/Runners.js CHANGED
@@ -44,7 +44,7 @@ class EyesRunner {
44
44
  /** @internal */
45
45
  async openEyes(options) {
46
46
  var _a;
47
- (_a = this._manager) !== null && _a !== void 0 ? _a : (this._manager = await this._core.makeManager(this.config));
47
+ (_a = this._manager) !== null && _a !== void 0 ? _a : (this._manager = await this._core.makeManager({ type: this.type, settings: this._managerSettings }));
48
48
  return await this._manager.openEyes(options);
49
49
  }
50
50
  async getAllTestResults(throwErr = true) {
@@ -62,7 +62,7 @@ class EyesRunner {
62
62
  },
63
63
  });
64
64
  try {
65
- const summary = await this._manager.getResults({ settings: { throwErr } });
65
+ const summary = await this._manager.getResults({ settings: { throwErr, ...this._getResultsSettings } });
66
66
  return new TestResultsSummary_1.TestResultsSummaryData({ summary, deleteTest });
67
67
  }
68
68
  catch (err) {
@@ -86,41 +86,43 @@ exports.EyesRunner = EyesRunner;
86
86
  class VisualGridRunner extends EyesRunner {
87
87
  constructor(optionsOrLegacyConcurrency) {
88
88
  super();
89
+ /** @internal */
90
+ this.type = 'ufg';
89
91
  if (utils.types.isNumber(optionsOrLegacyConcurrency)) {
90
- this._legacyConcurrency = optionsOrLegacyConcurrency;
92
+ this._managerSettings = { legacyConcurrency: optionsOrLegacyConcurrency };
91
93
  }
92
94
  else if (optionsOrLegacyConcurrency) {
93
95
  const options = optionsOrLegacyConcurrency instanceof RunnerOptions_1.RunnerOptionsFluent
94
96
  ? optionsOrLegacyConcurrency.toJSON()
95
97
  : optionsOrLegacyConcurrency;
96
- this._testConcurrency = options.testConcurrency;
98
+ this._managerSettings = { concurrency: options.testConcurrency };
99
+ this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
97
100
  }
98
101
  }
99
- /** @internal */
100
- get config() {
101
- return {
102
- type: 'ufg',
103
- concurrency: this._testConcurrency,
104
- legacyConcurrency: this._legacyConcurrency,
105
- };
106
- }
107
102
  get testConcurrency() {
108
- return this._testConcurrency;
103
+ var _a;
104
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.concurrency;
109
105
  }
110
106
  /** @deprecated */
111
107
  get legacyConcurrency() {
112
- return this._legacyConcurrency;
108
+ var _a;
109
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.legacyConcurrency;
113
110
  }
114
111
  /** @deprecated */
115
112
  getConcurrentSessions() {
116
- return this._legacyConcurrency;
113
+ var _a;
114
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.legacyConcurrency;
117
115
  }
118
116
  }
119
117
  exports.VisualGridRunner = VisualGridRunner;
120
118
  class ClassicRunner extends EyesRunner {
121
- /** @internal */
122
- get config() {
123
- return { type: 'classic' };
119
+ constructor(options) {
120
+ super();
121
+ /** @internal */
122
+ this.type = 'classic';
123
+ if (options) {
124
+ this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
125
+ }
124
126
  }
125
127
  }
126
128
  exports.ClassicRunner = ClassicRunner;
@@ -336,6 +336,12 @@ class TestResultsData {
336
336
  setUrl(_url) {
337
337
  // DEPRECATED
338
338
  }
339
+ get server() {
340
+ return this._result.server;
341
+ }
342
+ get keepIfDuplicate() {
343
+ return this._result.keepIfDuplicate;
344
+ }
339
345
  isPassed() {
340
346
  return this._result.status === TestResultsStatus_1.TestResultsStatusEnum.Passed;
341
347
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
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.1",
56
+ "@applitools/core": "2.4.5",
57
57
  "@applitools/logger": "1.1.48",
58
58
  "@applitools/utils": "1.3.32"
59
59
  },
60
60
  "devDependencies": {
61
- "@applitools/bongo": "^3.0.1",
62
- "@applitools/req": "^1.1.32",
61
+ "@applitools/bongo": "^3.0.3",
62
+ "@applitools/req": "^1.1.33",
63
63
  "@types/node": "^12.20.55"
64
64
  },
65
65
  "engines": {
@@ -7,10 +7,11 @@ export declare abstract class EyesRunner {
7
7
  private _core?;
8
8
  private _manager?;
9
9
  private _eyes;
10
+ abstract readonly type: 'classic' | 'ufg';
10
11
  /** @internal */
11
- abstract get config(): {
12
- type: 'classic' | 'ufg';
13
- };
12
+ protected readonly _managerSettings?: Core.ManagerSettings;
13
+ /** @internal */
14
+ protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'classic' | 'ufg'>;
14
15
  /** @internal */
15
16
  attach<TSpec extends Core.SpecType = Core.SpecType>(eyes: Eyes<TSpec>, core: Core.Core<TSpec, 'classic' | 'ufg'>): void;
16
17
  /** @internal */
@@ -23,19 +24,18 @@ export declare abstract class EyesRunner {
23
24
  getAllTestResults(throwErr?: boolean): Promise<TestResultsSummaryData>;
24
25
  }
25
26
  export declare class VisualGridRunner extends EyesRunner {
26
- private _testConcurrency?;
27
- private _legacyConcurrency?;
27
+ /** @internal */
28
+ readonly type: "ufg";
29
+ /** @internal */
30
+ /** @internal */
31
+ protected readonly _managerSettings?: Core.ManagerSettings;
32
+ /** @internal */
33
+ protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'ufg'>;
28
34
  constructor(options?: RunnerOptions);
29
35
  /** @deprecated */
30
36
  constructor(options?: RunnerOptionsFluent);
31
37
  /** @deprecated */
32
38
  constructor(legacyConcurrency?: number);
33
- /** @internal */
34
- get config(): {
35
- type: "ufg";
36
- concurrency: number | undefined;
37
- legacyConcurrency: number | undefined;
38
- };
39
39
  get testConcurrency(): number | undefined;
40
40
  /** @deprecated */
41
41
  get legacyConcurrency(): number | undefined;
@@ -44,7 +44,8 @@ export declare class VisualGridRunner extends EyesRunner {
44
44
  }
45
45
  export declare class ClassicRunner extends EyesRunner {
46
46
  /** @internal */
47
- get config(): {
48
- type: "classic";
49
- };
47
+ readonly type: "classic";
48
+ /** @internal */
49
+ protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'classic'>;
50
+ constructor(options?: RunnerOptions);
50
51
  }
@@ -1,5 +1,6 @@
1
1
  export type RunnerOptions = {
2
2
  testConcurrency?: number;
3
+ removeDuplicateTests?: boolean;
3
4
  };
4
5
  /** @deprecated */
5
6
  export declare class RunnerOptionsFluent {
@@ -1,5 +1,6 @@
1
1
  import type * as Core from '@applitools/core';
2
2
  import { TestResultsStatus, TestResultsStatusEnum } from '../enums/TestResultsStatus';
3
+ import { ProxySettings } from '../input/ProxySettings';
3
4
  import { RectangleSize, RectangleSizeData } from '../input/RectangleSize';
4
5
  import { TestAccessibilityStatus } from './TestAccessibilityStatus';
5
6
  import { SessionUrls, SessionUrlsData } from './SessionUrls';
@@ -35,6 +36,12 @@ export type TestResults = {
35
36
  readonly layoutMatches?: number;
36
37
  readonly noneMatches?: number;
37
38
  readonly url?: string;
39
+ readonly server: {
40
+ serverUrl: string;
41
+ apiKey: string;
42
+ proxy?: ProxySettings;
43
+ };
44
+ readonly keepIfDuplicate: boolean;
38
45
  };
39
46
  export declare class TestResultsData implements Required<TestResults> {
40
47
  private _result;
@@ -164,6 +171,8 @@ export declare class TestResultsData implements Required<TestResults> {
164
171
  getUrl(): string;
165
172
  /** @deprecated */
166
173
  setUrl(_url: string): void;
174
+ get server(): Core.ServerSettings;
175
+ get keepIfDuplicate(): boolean;
167
176
  isPassed(): boolean;
168
177
  delete(): Promise<void>;
169
178
  /** @deprecated */