@applitools/eyes 1.0.2 → 1.1.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/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({ type: this.type, settings: this.settings }));
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) {
@@ -84,49 +84,45 @@ class EyesRunner {
84
84
  }
85
85
  exports.EyesRunner = EyesRunner;
86
86
  class VisualGridRunner extends EyesRunner {
87
- /** @internal */
88
- get settings() {
89
- return {
90
- concurrency: this._testConcurrency,
91
- legacyConcurrency: this._legacyConcurrency,
92
- };
93
- }
94
87
  constructor(optionsOrLegacyConcurrency) {
95
88
  super();
96
89
  /** @internal */
97
90
  this.type = 'ufg';
98
91
  if (utils.types.isNumber(optionsOrLegacyConcurrency)) {
99
- this._legacyConcurrency = optionsOrLegacyConcurrency;
92
+ this._managerSettings = { legacyConcurrency: optionsOrLegacyConcurrency };
100
93
  }
101
94
  else if (optionsOrLegacyConcurrency) {
102
95
  const options = optionsOrLegacyConcurrency instanceof RunnerOptions_1.RunnerOptionsFluent
103
96
  ? optionsOrLegacyConcurrency.toJSON()
104
97
  : optionsOrLegacyConcurrency;
105
- this._testConcurrency = options.testConcurrency;
98
+ this._managerSettings = { concurrency: options.testConcurrency };
99
+ this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
106
100
  }
107
101
  }
108
102
  get testConcurrency() {
109
- return this._testConcurrency;
103
+ var _a;
104
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.concurrency;
110
105
  }
111
106
  /** @deprecated */
112
107
  get legacyConcurrency() {
113
- return this._legacyConcurrency;
108
+ var _a;
109
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.legacyConcurrency;
114
110
  }
115
111
  /** @deprecated */
116
112
  getConcurrentSessions() {
117
- return this._legacyConcurrency;
113
+ var _a;
114
+ return (_a = this._managerSettings) === null || _a === void 0 ? void 0 : _a.legacyConcurrency;
118
115
  }
119
116
  }
120
117
  exports.VisualGridRunner = VisualGridRunner;
121
118
  class ClassicRunner extends EyesRunner {
122
- constructor() {
123
- super(...arguments);
119
+ constructor(options) {
120
+ super();
124
121
  /** @internal */
125
122
  this.type = 'classic';
126
- }
127
- /** @internal */
128
- get settings() {
129
- return {};
123
+ if (options) {
124
+ this._getResultsSettings = { removeDuplicateTests: options.removeDuplicateTests };
125
+ }
130
126
  }
131
127
  }
132
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.2",
3
+ "version": "1.1.1",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -53,12 +53,12 @@
53
53
  "postversion": "bongo postversion"
54
54
  },
55
55
  "dependencies": {
56
- "@applitools/core": "2.4.3",
56
+ "@applitools/core": "2.4.6",
57
57
  "@applitools/logger": "1.1.48",
58
58
  "@applitools/utils": "1.3.32"
59
59
  },
60
60
  "devDependencies": {
61
- "@applitools/bongo": "^3.0.2",
61
+ "@applitools/bongo": "^3.0.3",
62
62
  "@applitools/req": "^1.1.33",
63
63
  "@types/node": "^12.20.55"
64
64
  },
@@ -7,10 +7,11 @@ export declare abstract class EyesRunner {
7
7
  private _core?;
8
8
  private _manager?;
9
9
  private _eyes;
10
- /** @internal */
11
10
  abstract readonly type: 'classic' | 'ufg';
12
11
  /** @internal */
13
- abstract readonly settings: Core.EyesManagerSettings;
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,15 +24,13 @@ 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?;
28
27
  /** @internal */
29
28
  readonly type: "ufg";
30
29
  /** @internal */
31
- get settings(): {
32
- concurrency: number | undefined;
33
- legacyConcurrency: number | undefined;
34
- };
30
+ /** @internal */
31
+ protected readonly _managerSettings?: Core.ManagerSettings;
32
+ /** @internal */
33
+ protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'ufg'>;
35
34
  constructor(options?: RunnerOptions);
36
35
  /** @deprecated */
37
36
  constructor(options?: RunnerOptionsFluent);
@@ -47,5 +46,6 @@ export declare class ClassicRunner extends EyesRunner {
47
46
  /** @internal */
48
47
  readonly type: "classic";
49
48
  /** @internal */
50
- get settings(): {};
49
+ protected readonly _getResultsSettings?: Core.GetManagerResultsSettings<'classic'>;
50
+ constructor(options?: RunnerOptions);
51
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,9 +1,9 @@
1
1
  export type ApiUrls = {
2
- readonly baselineImage?: string;
3
- readonly currentImage?: string;
4
- readonly checkpointImage?: string;
5
- readonly checkpointImageThumbnail?: string;
6
- readonly diffImage?: string;
2
+ readonly baselineImage: string;
3
+ readonly currentImage: string;
4
+ readonly checkpointImage: string;
5
+ readonly checkpointImageThumbnail: string;
6
+ readonly diffImage: string;
7
7
  };
8
8
  export declare class ApiUrlsData implements Required<ApiUrls> {
9
9
  private _urls;
@@ -1,6 +1,6 @@
1
1
  export type AppUrls = {
2
- readonly step?: string;
3
- readonly stepEditor?: string;
2
+ readonly step: string;
3
+ readonly stepEditor: string;
4
4
  };
5
5
  export declare class AppUrlsData implements Required<AppUrls> {
6
6
  private _urls;
@@ -1,6 +1,6 @@
1
1
  export type SessionUrls = {
2
- readonly batch?: string;
3
- readonly session?: string;
2
+ readonly batch: string;
3
+ readonly session: string;
4
4
  };
5
5
  export declare class SessionUrlsData implements Required<SessionUrls> {
6
6
  private _urls;
@@ -1,13 +1,13 @@
1
1
  import { AppUrls, AppUrlsData } from './AppUrls';
2
2
  import { ApiUrls, ApiUrlsData } from './ApiUrls';
3
3
  export type StepInfo = {
4
- readonly name?: string;
5
- readonly isDifferent?: boolean;
6
- readonly hasBaselineImage?: boolean;
7
- readonly hasCurrentImage?: boolean;
8
- readonly appUrls?: AppUrls;
9
- readonly apiUrls?: ApiUrls;
10
- readonly renderId?: string[];
4
+ readonly name: string;
5
+ readonly isDifferent: boolean;
6
+ readonly hasBaselineImage: boolean;
7
+ readonly hasCurrentImage: boolean;
8
+ readonly appUrls: AppUrls;
9
+ readonly apiUrls: ApiUrls;
10
+ readonly renderId: string[];
11
11
  };
12
12
  export declare class StepInfoData implements Required<StepInfo> {
13
13
  private _info;
@@ -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';
@@ -17,7 +18,7 @@ export type TestResults = {
17
18
  readonly hostApp?: string;
18
19
  readonly hostDisplaySize?: RectangleSize;
19
20
  readonly accessibilityStatus?: TestAccessibilityStatus;
20
- readonly startedAt?: Date | string;
21
+ readonly startedAt?: string;
21
22
  readonly duration?: number;
22
23
  readonly isNew?: boolean;
23
24
  readonly isDifferent?: boolean;
@@ -35,13 +36,19 @@ 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;
41
48
  private _deleteTest?;
42
49
  /** @internal */
43
50
  constructor(options: {
44
- result?: Core.TestResult<'classic' | 'ufg'>;
51
+ result?: Partial<Core.TestResult<'classic' | 'ufg'>>;
45
52
  deleteTest?: Core.Core<Core.SpecType, 'classic' | 'ufg'>['deleteTest'];
46
53
  });
47
54
  get id(): string;
@@ -92,7 +99,7 @@ export declare class TestResultsData implements Required<TestResults> {
92
99
  getAccessibilityStatus(): TestAccessibilityStatus;
93
100
  /** @deprecated */
94
101
  setAccessibilityStatus(_accessibilityStatus: TestAccessibilityStatus): void;
95
- get startedAt(): Date | string;
102
+ get startedAt(): string;
96
103
  getStartedAt(): Date;
97
104
  /** @deprecated */
98
105
  setStartedAt(_startedAt: Date | string): void;
@@ -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 */