@applitools/eyes-storybook 3.39.0 → 3.41.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,91 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.41.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.40.0...js/eyes-storybook@3.41.0) (2023-09-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * show aborted tests in Eyes dashboard ([#1877](https://github.com/applitools/eyes.sdk.javascript1/issues/1877)) ([f9840d4](https://github.com/applitools/eyes.sdk.javascript1/commit/f9840d494222ccc6c6f262896771e28da2565bc6))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/core-base bumped to 1.6.0
14
+ #### Features
15
+
16
+ * show aborted tests in Eyes dashboard ([#1877](https://github.com/applitools/eyes.sdk.javascript1/issues/1877)) ([f9840d4](https://github.com/applitools/eyes.sdk.javascript1/commit/f9840d494222ccc6c6f262896771e28da2565bc6))
17
+ * @applitools/ec-client bumped to 1.7.8
18
+
19
+ * @applitools/core bumped to 3.10.2
20
+
21
+
22
+ ## [3.40.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook-v3.39.1...js/eyes-storybook@3.40.0) (2023-09-04)
23
+
24
+
25
+ ### Features
26
+
27
+ * rework log event on opent eyes ([#1842](https://github.com/applitools/eyes.sdk.javascript1/issues/1842)) ([532756b](https://github.com/applitools/eyes.sdk.javascript1/commit/532756b75c1023967c3781316148c890dbcfaac8))
28
+ * update puppeteer version and minimum node version ([#1889](https://github.com/applitools/eyes.sdk.javascript1/issues/1889)) ([d449030](https://github.com/applitools/eyes.sdk.javascript1/commit/d449030bed6bf4f4c3e7a0dcb6f3ec78f7623e4c))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * @applitools/utils bumped to 1.6.0
34
+ #### Features
35
+
36
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
37
+ * @applitools/req bumped to 1.6.0
38
+ #### Features
39
+
40
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
41
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
42
+
43
+
44
+
45
+ * @applitools/spec-driver-puppeteer bumped to 1.2.0
46
+ #### Features
47
+
48
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
49
+
50
+
51
+
52
+ * @applitools/driver bumped to 1.14.0
53
+ #### Features
54
+
55
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
56
+
57
+
58
+
59
+ * @applitools/ufg-client bumped to 1.8.0
60
+ #### Features
61
+
62
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
63
+
64
+
65
+
66
+ * @applitools/logger bumped to 2.0.10
67
+
68
+ * @applitools/socket bumped to 1.1.10
69
+
70
+ * @applitools/image bumped to 1.1.5
71
+
72
+ * @applitools/spec-driver-webdriver bumped to 1.0.44
73
+
74
+ * @applitools/spec-driver-selenium bumped to 1.5.58
75
+
76
+ * @applitools/screenshoter bumped to 3.8.10
77
+
78
+ * @applitools/nml-client bumped to 1.5.10
79
+
80
+ * @applitools/tunnel-client bumped to 1.2.2
81
+
82
+ * @applitools/ec-client bumped to 1.7.7
83
+
84
+ * @applitools/core-base bumped to 1.5.3
85
+
86
+ * @applitools/core bumped to 3.10.1
87
+
88
+
3
89
  ## [3.39.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-storybook@3.38.3...js/eyes-storybook@3.39.0) (2023-08-25)
4
90
 
5
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.39.0",
3
+ "version": "3.41.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -57,14 +57,14 @@
57
57
  "postinstall": "node src/postinstall"
58
58
  },
59
59
  "dependencies": {
60
- "@applitools/core": "3.9.1",
61
- "@applitools/driver": "1.13.5",
60
+ "@applitools/core": "3.10.2",
61
+ "@applitools/driver": "1.14.0",
62
62
  "@applitools/functional-commons": "1.6.0",
63
- "@applitools/logger": "2.0.8",
63
+ "@applitools/logger": "2.0.10",
64
64
  "@applitools/monitoring-commons": "1.0.19",
65
- "@applitools/spec-driver-puppeteer": "1.1.73",
66
- "@applitools/ufg-client": "1.7.1",
67
- "@applitools/utils": "1.5.1",
65
+ "@applitools/spec-driver-puppeteer": "1.2.0",
66
+ "@applitools/ufg-client": "1.8.0",
67
+ "@applitools/utils": "1.6.0",
68
68
  "boxen": "4.2.0",
69
69
  "chalk": "3.0.0",
70
70
  "detect-port": "1.3.0",
@@ -6,7 +6,7 @@ const getStoryBaselineName = require('./getStoryBaselineName');
6
6
  const {URL} = require('url');
7
7
  const runRunAfterScript = require('../dist/runRunAfterScript');
8
8
  const waitFor = require('./waitFor');
9
- const PAGE_EVALUATE_TIMEOUT = 120000;
9
+ const PAGE_EVALUATE_TIMEOUT = process.env.APPLITOOLS_PAGE_EVALUATE_TIMEOUT || 120000;
10
10
  const DOM_SNAPSHOTS_TIMEOUT = 5 * 60 * 1000;
11
11
  const utils = require('@applitools/utils');
12
12
 
@@ -14,26 +14,43 @@ function processResults({
14
14
  }) {
15
15
  let outputStr = '\n';
16
16
  const pluralize = utils.general.pluralize;
17
- let testResults = flatten(results.summary.results);
18
- const unresolved = testResults.filter(r => r.result.isDifferent);
19
- const passedOrNew = testResults.filter(r => r.result.status === 'Passed' || r.result.isNew);
20
- const newTests = testResults.filter(r => r.result.isNew);
17
+ const flattenedTestResults = flatten(results.summary.results);
18
+ const testResults = flattenedTestResults.filter(r => r && r.result);
19
+ const testResultsWithErrors = flattenedTestResults.filter(r => r && r.error);
20
+ const unresolved = testResults.filter(r => r.result.isDifferent && !r.result.isAborted);
21
+ const passedOrNew = testResults.filter(
22
+ r => r.result.status === 'Passed' || (r.result.isNew && !r.result.isAborted),
23
+ );
24
+ const aborted = testResults.filter(r => r.result.isAborted);
25
+ const newTests = testResults.filter(r => r.result.isNew && !r.result.isAborted);
21
26
  const newTestsSize = newTests.length;
22
27
  const warnForUnsavedNewTests = !!(!saveNewTests && newTestsSize);
28
+ const errMessagesToExclude = [
29
+ 'detected differences',
30
+ 'Please approve the new baseline',
31
+ 'is failed! See details at',
32
+ ];
23
33
 
24
- let errors = results.summary.results.map(result => [
25
- {err: result.error, title: result.result.name},
26
- ]);
27
- errors = flatten(errors).filter(
28
- ({err}) =>
29
- err &&
30
- !err.message.includes('detected differences') &&
31
- !err.message.includes('Please approve the new baseline'),
32
- );
34
+ const resultsErr = results.results
35
+ .map(result => {
36
+ if (!Array.isArray(result.resultsOrErr)) {
37
+ return {error: result.resultsOrErr, title: result.title};
38
+ }
39
+ })
40
+ .filter(Boolean);
33
41
 
34
- const hasResults = unresolved.length || passedOrNew.length;
42
+ const errors = testResultsWithErrors
43
+ .filter(({error}) => error && !errMessagesToExclude.some(msg => error.message.includes(msg)))
44
+ .map(({result, error, eyes}) => ({
45
+ error,
46
+ title: result?.name || eyes?.test.testName,
47
+ }))
48
+ .concat(resultsErr);
49
+
50
+ const hasResults = unresolved.length || passedOrNew.length || aborted.length;
35
51
  const seeDetailsStr =
36
- hasResults && `See details at ${(passedOrNew[0] || unresolved[0]).result.appUrls.batch}`;
52
+ hasResults &&
53
+ `See details at ${(passedOrNew[0] || unresolved[0] || aborted[0]).result.appUrls.batch}`;
37
54
 
38
55
  if (hasResults) {
39
56
  outputStr += `${seeDetailsStr}\n\n`;
@@ -46,11 +63,15 @@ function processResults({
46
63
  if (unresolved.length > 0) {
47
64
  outputStr += testResultsOutput(unresolved, warnForUnsavedNewTests);
48
65
  }
66
+ if (aborted.length > 0) {
67
+ outputStr += testResultsOutput(aborted, warnForUnsavedNewTests);
68
+ }
49
69
  if (errors.length) {
50
70
  const sortedErrors = errors.sort((a, b) => a.title.localeCompare(b.title));
51
71
  outputStr += uniq(
52
72
  sortedErrors.map(
53
- ({title, err}) => `${title} - ${chalk.red('Failed')} ${err.message || err.toString()}`,
73
+ ({title, error}) =>
74
+ `${title} - ${chalk.red('Failed')}. ${error.message || error.toString()}`,
54
75
  ),
55
76
  ).join('\n');
56
77
  outputStr += '\n';
@@ -130,7 +151,9 @@ function testResultsOutput(results, warnForUnsavedNewTests) {
130
151
  sortedTestResults.forEach(result => {
131
152
  const storyTitle = `${result.result.name} [${result.result.hostApp}] [${result.result.hostDisplaySize.width}x${result.result.hostDisplaySize.height}] - `;
132
153
 
133
- if (result.result.isNew) {
154
+ if (result.result.isAborted) {
155
+ outputStr += `${storyTitle}${chalk.keyword('red')(`Aborted`)}\n`;
156
+ } else if (result.result.isNew) {
134
157
  const newResColor = warnForUnsavedNewTests ? 'orange' : 'blue';
135
158
  outputStr += `${storyTitle}${chalk.keyword(newResColor)('New')}\n`;
136
159
  } else if (!result.result.isDifferent) {
@@ -101,7 +101,6 @@ function makeRenderStories({
101
101
  if (error) {
102
102
  const errMsg = `[page ${pageId}] Failed to get story data for "${title}". ${error}`;
103
103
  logger.log(errMsg);
104
- throw new Error(errMsg);
105
104
  }
106
105
  const testResults = await renderStory({
107
106
  snapshots: storyData,
@@ -129,12 +129,19 @@ function makeRenderStory({
129
129
  return new Promise((resolve, reject) => {
130
130
  throttle(async () => {
131
131
  try {
132
- await eyes.checkAndClose({
133
- target: snapshots,
134
- settings: {...checkParams, ...closeSettings},
135
- });
136
- const results = await eyes.getResults();
137
- resolve(results);
132
+ if (snapshots) {
133
+ await eyes.checkAndClose({
134
+ target: snapshots,
135
+ settings: {...checkParams, ...closeSettings},
136
+ });
137
+ const results = await eyes.getResults();
138
+ resolve(results);
139
+ } else {
140
+ await eyes.abort({settings: {renderers}});
141
+ reject(
142
+ new Error(`Failed to get story data for ${openParams.testName}, test was aborted`),
143
+ );
144
+ }
138
145
  } catch (err) {
139
146
  reject(err);
140
147
  }