@applitools/eyes 1.11.4 → 1.13.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,142 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.13.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.12.0...js/eyes@1.13.0) (2023-12-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * add Eyes.getResults method ([#2046](https://github.com/applitools/eyes.sdk.javascript1/issues/2046)) ([#2069](https://github.com/applitools/eyes.sdk.javascript1/issues/2069)) ([4d263e1](https://github.com/applitools/eyes.sdk.javascript1/commit/4d263e19cb5e5708790a1a7ef90ff8f3eee50d91))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.7.0
14
+ #### Features
15
+
16
+ * add Eyes.getResults method ([#2046](https://github.com/applitools/eyes.sdk.javascript1/issues/2046)) ([#2069](https://github.com/applitools/eyes.sdk.javascript1/issues/2069)) ([4d263e1](https://github.com/applitools/eyes.sdk.javascript1/commit/4d263e19cb5e5708790a1a7ef90ff8f3eee50d91))
17
+ * @applitools/core-base bumped to 1.7.4
18
+ #### Bug Fixes
19
+
20
+ * do not block concurrency when server response is 503 ([#2049](https://github.com/applitools/eyes.sdk.javascript1/issues/2049)) ([f285009](https://github.com/applitools/eyes.sdk.javascript1/commit/f2850098f7522776c0d0a98bb1d958303628b149))
21
+
22
+
23
+
24
+ * @applitools/logger bumped to 2.0.14
25
+
26
+ * @applitools/socket bumped to 1.1.14
27
+
28
+ * @applitools/req bumped to 1.6.4
29
+
30
+ * @applitools/image bumped to 1.1.9
31
+
32
+ * @applitools/spec-driver-webdriver bumped to 1.0.51
33
+
34
+ * @applitools/spec-driver-selenium bumped to 1.5.65
35
+
36
+ * @applitools/spec-driver-puppeteer bumped to 1.3.1
37
+
38
+ * @applitools/driver bumped to 1.15.2
39
+
40
+ * @applitools/screenshoter bumped to 3.8.17
41
+
42
+ * @applitools/nml-client bumped to 1.5.17
43
+
44
+ * @applitools/tunnel-client bumped to 1.3.2
45
+
46
+ * @applitools/ufg-client bumped to 1.9.9
47
+
48
+ * @applitools/ec-client bumped to 1.7.17
49
+
50
+ * @applitools/core bumped to 4.3.0
51
+ #### Features
52
+
53
+ * add Eyes.getResults method ([#2046](https://github.com/applitools/eyes.sdk.javascript1/issues/2046)) ([#2069](https://github.com/applitools/eyes.sdk.javascript1/issues/2069)) ([4d263e1](https://github.com/applitools/eyes.sdk.javascript1/commit/4d263e19cb5e5708790a1a7ef90ff8f3eee50d91))
54
+
55
+
56
+
57
+
58
+ ## [1.12.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.11.4...js/eyes@1.12.0) (2023-11-21)
59
+
60
+
61
+ ### Features
62
+
63
+ * added `enableEyesLogs` configuration to the eyes service ([639ca8a](https://github.com/applitools/eyes.sdk.javascript1/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
64
+ * added `useExecutionCloud` configuration to the eyes service ([#2033](https://github.com/applitools/eyes.sdk.javascript1/issues/2033)) ([639ca8a](https://github.com/applitools/eyes.sdk.javascript1/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * error to unknown type in exception ([#2035](https://github.com/applitools/eyes.sdk.javascript1/issues/2035)) ([16d78c3](https://github.com/applitools/eyes.sdk.javascript1/commit/16d78c3cce90a5cb50cc2aa4e9ab6a58b7b93f89))
70
+
71
+
72
+ ### Dependencies
73
+
74
+ * @applitools/utils bumped to 1.6.3
75
+ #### Bug Fixes
76
+
77
+ * don't throw error for missing configuration file ([#2034](https://github.com/applitools/eyes.sdk.javascript1/issues/2034)) ([d084e7b](https://github.com/applitools/eyes.sdk.javascript1/commit/d084e7bf6e1727e3969622b4e597881f18241eb3))
78
+ * @applitools/logger bumped to 2.0.13
79
+
80
+ * @applitools/req bumped to 1.6.3
81
+
82
+ * @applitools/image bumped to 1.1.8
83
+
84
+ * @applitools/dom-snapshot bumped to 4.7.14
85
+ #### Bug Fixes
86
+
87
+ * preserve css declarations order in dom-snapshot ([#2037](https://github.com/applitools/eyes.sdk.javascript1/issues/2037)) ([1381851](https://github.com/applitools/eyes.sdk.javascript1/commit/1381851d46f28ea7e7724025c4eab33c81c4e144))
88
+ * @applitools/spec-driver-webdriver bumped to 1.0.50
89
+ #### Bug Fixes
90
+
91
+ * send devtool commands in chromium ([#2039](https://github.com/applitools/eyes.sdk.javascript1/issues/2039)) ([ff42043](https://github.com/applitools/eyes.sdk.javascript1/commit/ff42043c3d9f110eb7b22ab1a8448d77859923b4))
92
+
93
+
94
+
95
+ * @applitools/spec-driver-puppeteer bumped to 1.3.0
96
+ #### Features
97
+
98
+ * added notification about outdated sdk version ([#2012](https://github.com/applitools/eyes.sdk.javascript1/issues/2012)) ([0f0a646](https://github.com/applitools/eyes.sdk.javascript1/commit/0f0a6462a56e7c97f9a22173c3b63af91e220adb))
99
+
100
+
101
+
102
+ * @applitools/core-base bumped to 1.7.3
103
+ #### Bug Fixes
104
+
105
+ * remove connection timeout in case of a long running tasks ([#2006](https://github.com/applitools/eyes.sdk.javascript1/issues/2006)) ([49a596a](https://github.com/applitools/eyes.sdk.javascript1/commit/49a596ac1b022a66b5c07ecfee458cc061891ce0))
106
+ * return result when error in the ufg ([#2020](https://github.com/applitools/eyes.sdk.javascript1/issues/2020)) ([28cdcc5](https://github.com/applitools/eyes.sdk.javascript1/commit/28cdcc5a859641d0edde032165c5068fcc580c8d))
107
+
108
+
109
+
110
+ * @applitools/socket bumped to 1.1.13
111
+
112
+ * @applitools/spec-driver-selenium bumped to 1.5.64
113
+
114
+ * @applitools/driver bumped to 1.15.1
115
+
116
+ * @applitools/screenshoter bumped to 3.8.16
117
+
118
+ * @applitools/nml-client bumped to 1.5.16
119
+
120
+ * @applitools/tunnel-client bumped to 1.3.1
121
+
122
+ * @applitools/ufg-client bumped to 1.9.8
123
+
124
+ * @applitools/ec-client bumped to 1.7.16
125
+
126
+ * @applitools/core bumped to 4.2.0
127
+ #### Features
128
+
129
+ * added notification about outdated sdk version ([#2012](https://github.com/applitools/eyes.sdk.javascript1/issues/2012)) ([0f0a646](https://github.com/applitools/eyes.sdk.javascript1/commit/0f0a6462a56e7c97f9a22173c3b63af91e220adb))
130
+ * log driver environment info to splank ([#2023](https://github.com/applitools/eyes.sdk.javascript1/issues/2023)) ([11d0546](https://github.com/applitools/eyes.sdk.javascript1/commit/11d0546e76962b4c231e140b0229b8402da27f69))
131
+
132
+
133
+ #### Bug Fixes
134
+
135
+ * return result when error in the ufg ([#2020](https://github.com/applitools/eyes.sdk.javascript1/issues/2020)) ([28cdcc5](https://github.com/applitools/eyes.sdk.javascript1/commit/28cdcc5a859641d0edde032165c5068fcc580c8d))
136
+
137
+
138
+
139
+
3
140
  ## [1.11.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.11.3...js/eyes@1.11.4) (2023-11-07)
4
141
 
5
142
 
package/dist/Eyes.js CHANGED
@@ -138,7 +138,8 @@ class Eyes {
138
138
  this._config = new Configuration_1.ConfigurationData(config, this._spec);
139
139
  }
140
140
  get isOpen() {
141
- return Boolean(this._eyes);
141
+ var _a;
142
+ return Boolean((_a = this._eyes) === null || _a === void 0 ? void 0 : _a.running);
142
143
  }
143
144
  getIsOpen() {
144
145
  return this.isOpen;
@@ -375,35 +376,13 @@ class Eyes {
375
376
  }, Promise.resolve([]));
376
377
  }
377
378
  async close(throwErr = true) {
378
- var _a;
379
379
  if (this._config.isDisabled)
380
380
  return null;
381
381
  if (!this.isOpen)
382
382
  throw new EyesError_1.EyesError('Eyes not open');
383
- try {
384
- const config = this._config.toJSON();
385
- await this._eyes.close({ config });
386
- const [result] = await this._eyes.getResults({ settings: { throwErr } });
387
- return new TestResults_1.TestResultsData({ result, core: this._core });
388
- }
389
- catch (err) {
390
- if ((_a = err.info) === null || _a === void 0 ? void 0 : _a.result) {
391
- const result = new TestResults_1.TestResultsData({ result: err.info.result, core: this._core });
392
- if (err.reason === 'test failed') {
393
- throw new TestFailedError_1.TestFailedError(err.message, result);
394
- }
395
- else if (err.reason === 'test different') {
396
- throw new DiffsFoundError_1.DiffsFoundError(err.message, result);
397
- }
398
- else if (err.reason === 'test new') {
399
- throw new NewTestError_1.NewTestError(err.message, result);
400
- }
401
- }
402
- throw err;
403
- }
404
- finally {
405
- this._eyes = undefined;
406
- }
383
+ await this.closeAsync();
384
+ const [result] = await this.getResults(throwErr);
385
+ return result;
407
386
  }
408
387
  async closeAsync() {
409
388
  var _a;
@@ -415,14 +394,9 @@ class Eyes {
415
394
  async abort() {
416
395
  if (!this.isOpen || this._config.isDisabled)
417
396
  return null;
418
- try {
419
- await this._eyes.abort();
420
- const [result] = await this._eyes.getResults();
421
- return new TestResults_1.TestResultsData({ result, core: this._core });
422
- }
423
- finally {
424
- this._eyes = undefined;
425
- }
397
+ await this._eyes.abort();
398
+ const [result] = await this._eyes.getResults();
399
+ return new TestResults_1.TestResultsData({ result, core: this._core });
426
400
  }
427
401
  async abortAsync() {
428
402
  var _a;
@@ -434,6 +408,30 @@ class Eyes {
434
408
  async abortIfNotClosed() {
435
409
  return this.abort();
436
410
  }
411
+ async getResults(throwErr = true) {
412
+ var _a;
413
+ if (this._config.isDisabled)
414
+ return null;
415
+ try {
416
+ const results = await this._eyes.getResults({ settings: { throwErr } });
417
+ return results.map(result => new TestResults_1.TestResultsData({ result, core: this._core }));
418
+ }
419
+ catch (error) {
420
+ if ((_a = error.info) === null || _a === void 0 ? void 0 : _a.result) {
421
+ const result = new TestResults_1.TestResultsData({ result: error.info.result, core: this._core });
422
+ if (error.reason === 'test failed') {
423
+ throw new TestFailedError_1.TestFailedError(error.message, result);
424
+ }
425
+ else if (error.reason === 'test different') {
426
+ throw new DiffsFoundError_1.DiffsFoundError(error.message, result);
427
+ }
428
+ else if (error.reason === 'test new') {
429
+ throw new NewTestError_1.NewTestError(error.message, result);
430
+ }
431
+ }
432
+ throw error;
433
+ }
434
+ }
437
435
  // #region CONFIG
438
436
  async getViewportSize() {
439
437
  var _a;
@@ -15,7 +15,10 @@ class TestResultContainerData {
15
15
  return this.testResults && new TestResults_1.TestResultsData({ result: this.testResults, core: this._core });
16
16
  }
17
17
  get exception() {
18
- return this._container.error;
18
+ if (!this._container.error || this._container.error instanceof Error)
19
+ return this._container.error;
20
+ else
21
+ return new Error(String(this._container.error));
19
22
  }
20
23
  getException() {
21
24
  return this.exception;
@@ -29,9 +32,9 @@ class TestResultContainerData {
29
32
  /** @internal */
30
33
  toObject() {
31
34
  return {
32
- testResults: this._container.result,
33
- exception: this._container.error,
34
- browserInfo: this._container.environment.requested,
35
+ testResults: this.testResults,
36
+ exception: this.exception,
37
+ browserInfo: this.browserInfo,
35
38
  };
36
39
  }
37
40
  /** @internal */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.11.4",
3
+ "version": "1.13.0",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -45,12 +45,12 @@
45
45
  "test": "run --top-level mocha './test/**/*.spec.ts'"
46
46
  },
47
47
  "dependencies": {
48
- "@applitools/core": "4.1.0",
49
- "@applitools/logger": "2.0.12",
50
- "@applitools/utils": "1.6.2"
48
+ "@applitools/core": "4.3.0",
49
+ "@applitools/logger": "2.0.14",
50
+ "@applitools/utils": "1.7.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@applitools/req": "^1.6.2",
53
+ "@applitools/req": "^1.6.4",
54
54
  "@types/node": "^12.20.55"
55
55
  },
56
56
  "engines": {
package/types/Eyes.d.ts CHANGED
@@ -141,6 +141,7 @@ export declare class Eyes<TSpec extends Core.SpecType = Core.SpecType> {
141
141
  abortAsync(): Promise<void>;
142
142
  /** @deprecated */
143
143
  abortIfNotClosed(): Promise<TestResults>;
144
+ getResults(throwErr?: boolean): Promise<TestResultsData[]>;
144
145
  getViewportSize(): Promise<RectangleSizeData>;
145
146
  setViewportSize(size: RectangleSize): Promise<void>;
146
147
  getScrollRootElement(): TSpec['element'] | EyesSelector<TSpec['selector']>;
package/types/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export { NewTestError } from './errors/NewTestError';
22
22
  export { AccessibilityMatchSettings as AccessibilityMatchSettingsPlain, AccessibilityMatchSettingsData as AccessibilityMatchSettings, } from './input/AccessibilityMatchSettings';
23
23
  export { AccessibilitySettings } from './input/AccessibilitySettings';
24
24
  export { BatchInfo as BatchInfoPlain, BatchInfoData as BatchInfo } from './input/BatchInfo';
25
+ export { Image } from './input/Image';
25
26
  export { CheckSettingsImage as CheckSettingsImagePlain, CheckSettingsImageFluent as CheckSettingsImage, CheckSettingsAutomation as CheckSettingsAutomationPlain, CheckSettingsAutomationFluent as CheckSettingsAutomation, TargetImage, TargetAutomation, Target, } from './input/CheckSettings';
26
27
  export { Configuration as ConfigurationPlain, ConfigurationData as Configuration } from './input/Configuration';
27
28
  export { CutProvider as CutProviderPlain, CutProviderData as CutProvider, FixedCutProviderData as FixedCutProvider, UnscaledFixedCutProviderData as UnscaledFixedCutProvider, } from './input/CutProvider';