@applitools/eyes 1.11.4 → 1.12.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,87 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.12.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.11.4...js/eyes@1.12.0) (2023-11-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * added `enableEyesLogs` configuration to the eyes service ([639ca8a](https://github.com/applitools/eyes.sdk.javascript1/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
9
+ * 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))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * 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))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * @applitools/utils bumped to 1.6.3
20
+ #### Bug Fixes
21
+
22
+ * 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))
23
+ * @applitools/logger bumped to 2.0.13
24
+
25
+ * @applitools/req bumped to 1.6.3
26
+
27
+ * @applitools/image bumped to 1.1.8
28
+
29
+ * @applitools/dom-snapshot bumped to 4.7.14
30
+ #### Bug Fixes
31
+
32
+ * 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))
33
+ * @applitools/spec-driver-webdriver bumped to 1.0.50
34
+ #### Bug Fixes
35
+
36
+ * 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))
37
+
38
+
39
+
40
+ * @applitools/spec-driver-puppeteer bumped to 1.3.0
41
+ #### Features
42
+
43
+ * 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))
44
+
45
+
46
+
47
+ * @applitools/core-base bumped to 1.7.3
48
+ #### Bug Fixes
49
+
50
+ * 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))
51
+ * 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))
52
+
53
+
54
+
55
+ * @applitools/socket bumped to 1.1.13
56
+
57
+ * @applitools/spec-driver-selenium bumped to 1.5.64
58
+
59
+ * @applitools/driver bumped to 1.15.1
60
+
61
+ * @applitools/screenshoter bumped to 3.8.16
62
+
63
+ * @applitools/nml-client bumped to 1.5.16
64
+
65
+ * @applitools/tunnel-client bumped to 1.3.1
66
+
67
+ * @applitools/ufg-client bumped to 1.9.8
68
+
69
+ * @applitools/ec-client bumped to 1.7.16
70
+
71
+ * @applitools/core bumped to 4.2.0
72
+ #### Features
73
+
74
+ * 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))
75
+ * 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))
76
+
77
+
78
+ #### Bug Fixes
79
+
80
+ * 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))
81
+
82
+
83
+
84
+
3
85
  ## [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
86
 
5
87
 
package/dist/Eyes.js CHANGED
@@ -375,35 +375,13 @@ class Eyes {
375
375
  }, Promise.resolve([]));
376
376
  }
377
377
  async close(throwErr = true) {
378
- var _a;
379
378
  if (this._config.isDisabled)
380
379
  return null;
381
380
  if (!this.isOpen)
382
381
  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
- }
382
+ await this.closeAsync();
383
+ const [result] = await this.getResults(throwErr);
384
+ return result;
407
385
  }
408
386
  async closeAsync() {
409
387
  var _a;
@@ -434,6 +412,33 @@ class Eyes {
434
412
  async abortIfNotClosed() {
435
413
  return this.abort();
436
414
  }
415
+ async getResults(throwErr = false) {
416
+ var _a;
417
+ if (this._config.isDisabled)
418
+ return null;
419
+ try {
420
+ const results = await this._eyes.getResults({ settings: { throwErr } });
421
+ return results.map(result => new TestResults_1.TestResultsData({ result, core: this._core }));
422
+ }
423
+ catch (error) {
424
+ if ((_a = error.info) === null || _a === void 0 ? void 0 : _a.result) {
425
+ const result = new TestResults_1.TestResultsData({ result: error.info.result, core: this._core });
426
+ if (error.reason === 'test failed') {
427
+ throw new TestFailedError_1.TestFailedError(error.message, result);
428
+ }
429
+ else if (error.reason === 'test different') {
430
+ throw new DiffsFoundError_1.DiffsFoundError(error.message, result);
431
+ }
432
+ else if (error.reason === 'test new') {
433
+ throw new NewTestError_1.NewTestError(error.message, result);
434
+ }
435
+ }
436
+ throw error;
437
+ }
438
+ finally {
439
+ this._eyes = undefined;
440
+ }
441
+ }
437
442
  // #region CONFIG
438
443
  async getViewportSize() {
439
444
  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.12.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.2.0",
49
+ "@applitools/logger": "2.0.13",
50
+ "@applitools/utils": "1.6.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@applitools/req": "^1.6.2",
53
+ "@applitools/req": "^1.6.3",
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';