@applitools/eyes-storybook 3.29.1 → 3.29.4
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 +20 -0
- package/package.json +13 -12
- package/src/getStoryData.js +15 -5
- package/src/renderStories.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## 3.29.4 - 2022/9/12
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
### Bug fixes
|
|
10
|
+
- Prevent Eyes-Storybook from hanging when there is a failure to take DOM
|
|
11
|
+
|
|
12
|
+
## 3.29.3 - 2022/8/18
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
### Bug fixes
|
|
16
|
+
- Better support in DOM slot element
|
|
17
|
+
- fix error handling
|
|
18
|
+
|
|
19
|
+
## 3.29.2 - 2022/7/14
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
- Allow configuration file to be loaded from ancestor directories
|
|
23
|
+
### Bug fixes
|
|
24
|
+
- Fixed bug where a failure in a single UFG environment fails all other environments in the same configuration
|
|
25
|
+
|
|
6
26
|
## 3.29.1 - 2022/6/16
|
|
7
27
|
|
|
8
28
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-storybook",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git://github.com/applitools/eyes.sdk.javascript1.git",
|
|
17
|
-
"directory": "packages/eyes-storybook"
|
|
17
|
+
"directory": "js/packages/eyes-storybook"
|
|
18
18
|
},
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE",
|
|
20
20
|
"author": "Applitools Team <team@applitools.com>",
|
|
@@ -34,10 +34,11 @@
|
|
|
34
34
|
"build": "rollup -c rollup.config.js",
|
|
35
35
|
"build:heavy": "node scripts/bitmap.js",
|
|
36
36
|
"test": "yarn build && yarn test:mocha && yarn lint",
|
|
37
|
-
"test:
|
|
37
|
+
"test:sanity": "yarn test:unit && yarn test:it",
|
|
38
38
|
"test:mocha": "yarn test:unit && yarn test:it && yarn test:e2e",
|
|
39
39
|
"test:unit": "mocha --no-timeouts --trace-warnings 'test/unit/*.test.js'",
|
|
40
40
|
"test:it": "mocha --no-timeouts --trace-warnings 'test/it/*.test.js'",
|
|
41
|
+
"test:versions": "yarn build && yarn test:e2e:versions && yarn lint",
|
|
41
42
|
"test:e2e": "mocha --no-timeouts --trace-warnings 'test/e2e/*.e2e.test.js'",
|
|
42
43
|
"test:e2e:versions": "npx mocha --no-timeouts --trace-warnings --require test/fixtures/storybook-versions/mochaHooks.js test/e2e/*.e2e.versions.test.js",
|
|
43
44
|
"test:e2e:versions_local": "STORYBOOK_VERSION=latest npx mocha --no-timeouts --trace-warnings --require test/fixtures/storybook-versions/mochaHooks.js test/e2e/*.e2e.versions.test.js",
|
|
@@ -69,15 +70,15 @@
|
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
"dependencies": {
|
|
72
|
-
"@applitools/driver": "1.9.
|
|
73
|
-
"@applitools/eyes-sdk-core": "13.8.
|
|
73
|
+
"@applitools/driver": "1.9.26",
|
|
74
|
+
"@applitools/eyes-sdk-core": "13.8.26",
|
|
74
75
|
"@applitools/functional-commons": "1.6.0",
|
|
75
|
-
"@applitools/logger": "1.1.
|
|
76
|
+
"@applitools/logger": "1.1.16",
|
|
76
77
|
"@applitools/monitoring-commons": "1.0.19",
|
|
77
|
-
"@applitools/spec-driver-puppeteer": "1.1.
|
|
78
|
-
"@applitools/test-server": "1.
|
|
79
|
-
"@applitools/utils": "1.3.
|
|
80
|
-
"@applitools/visual-grid-client": "15.
|
|
78
|
+
"@applitools/spec-driver-puppeteer": "1.1.8",
|
|
79
|
+
"@applitools/test-server": "1.1.4",
|
|
80
|
+
"@applitools/utils": "1.3.10",
|
|
81
|
+
"@applitools/visual-grid-client": "15.13.21",
|
|
81
82
|
"boxen": "4.2.0",
|
|
82
83
|
"chalk": "3.0.0",
|
|
83
84
|
"detect-port": "1.3.0",
|
|
@@ -89,9 +90,9 @@
|
|
|
89
90
|
"yargs": "15.4.1"
|
|
90
91
|
},
|
|
91
92
|
"devDependencies": {
|
|
92
|
-
"@applitools/bongo": "^2.
|
|
93
|
+
"@applitools/bongo": "^2.2.0",
|
|
93
94
|
"@applitools/scripts": "^1.1.0",
|
|
94
|
-
"@applitools/sdk-shared": "0.9.
|
|
95
|
+
"@applitools/sdk-shared": "0.9.13",
|
|
95
96
|
"@applitools/snaptdout": "^1.0.1",
|
|
96
97
|
"@storybook/addon-interactions": "^6.4.18",
|
|
97
98
|
"@storybook/react": "^6.4.18",
|
package/src/getStoryData.js
CHANGED
|
@@ -8,6 +8,7 @@ const {URL} = require('url');
|
|
|
8
8
|
const runRunAfterScript = require('../dist/runRunAfterScript');
|
|
9
9
|
const waitFor = require('./waitFor');
|
|
10
10
|
const PAGE_EVALUATE_TIMEOUT = 120000;
|
|
11
|
+
const DOM_SNAPSHOTS_TIMEOUT = 5 * 60 * 1000;
|
|
11
12
|
|
|
12
13
|
function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPagePerStory}) {
|
|
13
14
|
return async function getStoryData({story, storyUrl, page, browser, waitBeforeStory}) {
|
|
@@ -23,15 +24,16 @@ function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPa
|
|
|
23
24
|
const err = await ptimeoutWithError(
|
|
24
25
|
page.evaluate(renderStoryWithClientAPI, story.index),
|
|
25
26
|
PAGE_EVALUATE_TIMEOUT,
|
|
26
|
-
'page evaluate timed out!',
|
|
27
|
+
new Error('page evaluate timed out!'),
|
|
27
28
|
);
|
|
28
|
-
logger.log(`[story data] done with page evaluate for story
|
|
29
|
+
logger.log(`[story data] done with page evaluate for story ${title}`);
|
|
29
30
|
err && handleRenderStoryError(err);
|
|
30
31
|
} catch (ex) {
|
|
31
|
-
if (!ex.message.includes('Eyes could not render stories properly'))
|
|
32
|
+
if (ex.message && !ex.message.includes('Eyes could not render stories properly'))
|
|
32
33
|
handleRenderStoryError(ex);
|
|
33
34
|
else {
|
|
34
|
-
|
|
35
|
+
const errMsg = ex.message || ex;
|
|
36
|
+
throw new Error(errMsg);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
} else {
|
|
@@ -58,7 +60,7 @@ function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPa
|
|
|
58
60
|
|
|
59
61
|
logger.log(`running takeDomSnapshot(s) for story ${title}`);
|
|
60
62
|
|
|
61
|
-
const
|
|
63
|
+
const domSnapshotsPromise = takeDomSnapshots({
|
|
62
64
|
page,
|
|
63
65
|
browser,
|
|
64
66
|
layoutBreakpoints: eyesParameters ? eyesParameters.layoutBreakpoints : undefined,
|
|
@@ -70,6 +72,14 @@ function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPa
|
|
|
70
72
|
: undefined,
|
|
71
73
|
});
|
|
72
74
|
|
|
75
|
+
const result = await ptimeoutWithError(
|
|
76
|
+
domSnapshotsPromise,
|
|
77
|
+
DOM_SNAPSHOTS_TIMEOUT,
|
|
78
|
+
new Error(`timeout reached when trying to take DOM for story ${title}`),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
logger.log(`done getting DOM for story ${title}`);
|
|
82
|
+
|
|
73
83
|
if (eyesParameters && eyesParameters.runAfter) {
|
|
74
84
|
await page.evaluate(runRunAfterScript, story.index).catch(err => {
|
|
75
85
|
logger.log(`error during runAfter: ${err}`);
|
package/src/renderStories.js
CHANGED
|
@@ -75,7 +75,12 @@ function makeRenderStories({
|
|
|
75
75
|
}),
|
|
76
76
|
);
|
|
77
77
|
|
|
78
|
-
if (
|
|
78
|
+
if (
|
|
79
|
+
error &&
|
|
80
|
+
/(Protocol error|Execution context was destroyed|timeout reached when trying to take DOM for story)/.test(
|
|
81
|
+
error.message,
|
|
82
|
+
)
|
|
83
|
+
) {
|
|
79
84
|
logger.log(
|
|
80
85
|
`Puppeteer error from [page ${pageId}] while getting story data. Replacing page. ${error.message}`,
|
|
81
86
|
);
|