@applitools/eyes-storybook 3.27.0 → 3.27.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/CHANGELOG.md +9 -0
- package/dist/getClientAPI.js +19 -1
- package/dist/getStories.js +19 -1
- package/dist/renderStoryWithClientAPI.js +21 -3
- package/dist/runRunAfterScript.js +19 -1
- package/dist/runRunBeforeScript.js +19 -1
- package/package.json +8 -9
- package/src/browser/getClientAPI.js +19 -1
- package/src/browser/renderStoryWithClientAPI.js +2 -2
- package/src/storybookConnector.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## 3.27.1 - 2021/12/21
|
|
7
|
+
|
|
8
|
+
- add support for storybook api 6.4
|
|
9
|
+
- updated to @applitools/driver@1.4.5 (from 1.3.5)
|
|
10
|
+
- updated to @applitools/eyes-sdk-core@12.24.7 (from 12.24.5)
|
|
11
|
+
- updated to @applitools/logger@1.0.7 (from 1.0.6)
|
|
12
|
+
- updated to @applitools/test-server@1.0.8 (from 1.0.7)
|
|
13
|
+
- updated to @applitools/visual-grid-client@15.8.53 (from 15.8.49)
|
|
14
|
+
|
|
6
15
|
## 3.27.0 - 2021/12/6
|
|
7
16
|
|
|
8
17
|
- support custom properties and query params
|
package/dist/getClientAPI.js
CHANGED
|
@@ -7,6 +7,7 @@ function __getClientAPI(...args) {
|
|
|
7
7
|
v4: 'v4',
|
|
8
8
|
v5: 'v5',
|
|
9
9
|
v5_2: 'v5_2',
|
|
10
|
+
v6_4: 'v6_4',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function getClientAPI() {
|
|
@@ -19,7 +20,9 @@ function __getClientAPI(...args) {
|
|
|
19
20
|
function getStorybookVersion() {
|
|
20
21
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
21
22
|
|
|
22
|
-
if (frameWindow.
|
|
23
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
24
|
+
return API_VERSIONS.v6_4;
|
|
25
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
23
26
|
return API_VERSIONS.v5_2;
|
|
24
27
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
25
28
|
return API_VERSIONS.v5;
|
|
@@ -81,6 +84,21 @@ function __getClientAPI(...args) {
|
|
|
81
84
|
};
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
case API_VERSIONS.v6_4: {
|
|
89
|
+
api = {
|
|
90
|
+
getStories: () => {
|
|
91
|
+
return clientAPI.raw();
|
|
92
|
+
},
|
|
93
|
+
selectStory: async i => {
|
|
94
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
95
|
+
storyId: clientAPI.raw()[i].id,
|
|
96
|
+
});
|
|
97
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
return {version, ...api};
|
package/dist/getStories.js
CHANGED
|
@@ -7,6 +7,7 @@ function __getStories(...args) {
|
|
|
7
7
|
v4: 'v4',
|
|
8
8
|
v5: 'v5',
|
|
9
9
|
v5_2: 'v5_2',
|
|
10
|
+
v6_4: 'v6_4',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function getClientAPI() {
|
|
@@ -19,7 +20,9 @@ function __getStories(...args) {
|
|
|
19
20
|
function getStorybookVersion() {
|
|
20
21
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
21
22
|
|
|
22
|
-
if (frameWindow.
|
|
23
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
24
|
+
return API_VERSIONS.v6_4;
|
|
25
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
23
26
|
return API_VERSIONS.v5_2;
|
|
24
27
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
25
28
|
return API_VERSIONS.v5;
|
|
@@ -81,6 +84,21 @@ function __getStories(...args) {
|
|
|
81
84
|
};
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
case API_VERSIONS.v6_4: {
|
|
89
|
+
api = {
|
|
90
|
+
getStories: () => {
|
|
91
|
+
return clientAPI.raw();
|
|
92
|
+
},
|
|
93
|
+
selectStory: async i => {
|
|
94
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
95
|
+
storyId: clientAPI.raw()[i].id,
|
|
96
|
+
});
|
|
97
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
return {version, ...api};
|
|
@@ -7,6 +7,7 @@ function __renderStoryWithClientAPI(...args) {
|
|
|
7
7
|
v4: 'v4',
|
|
8
8
|
v5: 'v5',
|
|
9
9
|
v5_2: 'v5_2',
|
|
10
|
+
v6_4: 'v6_4',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function getClientAPI() {
|
|
@@ -19,7 +20,9 @@ function __renderStoryWithClientAPI(...args) {
|
|
|
19
20
|
function getStorybookVersion() {
|
|
20
21
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
21
22
|
|
|
22
|
-
if (frameWindow.
|
|
23
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
24
|
+
return API_VERSIONS.v6_4;
|
|
25
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
23
26
|
return API_VERSIONS.v5_2;
|
|
24
27
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
25
28
|
return API_VERSIONS.v5;
|
|
@@ -81,6 +84,21 @@ function __renderStoryWithClientAPI(...args) {
|
|
|
81
84
|
};
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
case API_VERSIONS.v6_4: {
|
|
89
|
+
api = {
|
|
90
|
+
getStories: () => {
|
|
91
|
+
return clientAPI.raw();
|
|
92
|
+
},
|
|
93
|
+
selectStory: async i => {
|
|
94
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
95
|
+
storyId: clientAPI.raw()[i].id,
|
|
96
|
+
});
|
|
97
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
return {version, ...api};
|
|
@@ -112,11 +130,11 @@ function __renderStoryWithClientAPI(...args) {
|
|
|
112
130
|
|
|
113
131
|
var getClientAPI_1 = getClientAPI;
|
|
114
132
|
|
|
115
|
-
function renderStoryWithClientAPI(index) {
|
|
133
|
+
async function renderStoryWithClientAPI(index) {
|
|
116
134
|
let api;
|
|
117
135
|
try {
|
|
118
136
|
api = getClientAPI_1();
|
|
119
|
-
api.selectStory(index);
|
|
137
|
+
await api.selectStory(index);
|
|
120
138
|
} catch (ex) {
|
|
121
139
|
return {message: ex.message, version: api ? api.version : undefined};
|
|
122
140
|
}
|
|
@@ -7,6 +7,7 @@ function __runRunAfterScript(...args) {
|
|
|
7
7
|
v4: 'v4',
|
|
8
8
|
v5: 'v5',
|
|
9
9
|
v5_2: 'v5_2',
|
|
10
|
+
v6_4: 'v6_4',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function getClientAPI() {
|
|
@@ -19,7 +20,9 @@ function __runRunAfterScript(...args) {
|
|
|
19
20
|
function getStorybookVersion() {
|
|
20
21
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
21
22
|
|
|
22
|
-
if (frameWindow.
|
|
23
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
24
|
+
return API_VERSIONS.v6_4;
|
|
25
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
23
26
|
return API_VERSIONS.v5_2;
|
|
24
27
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
25
28
|
return API_VERSIONS.v5;
|
|
@@ -81,6 +84,21 @@ function __runRunAfterScript(...args) {
|
|
|
81
84
|
};
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
case API_VERSIONS.v6_4: {
|
|
89
|
+
api = {
|
|
90
|
+
getStories: () => {
|
|
91
|
+
return clientAPI.raw();
|
|
92
|
+
},
|
|
93
|
+
selectStory: async i => {
|
|
94
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
95
|
+
storyId: clientAPI.raw()[i].id,
|
|
96
|
+
});
|
|
97
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
return {version, ...api};
|
|
@@ -7,6 +7,7 @@ function __runRunBeforeScript(...args) {
|
|
|
7
7
|
v4: 'v4',
|
|
8
8
|
v5: 'v5',
|
|
9
9
|
v5_2: 'v5_2',
|
|
10
|
+
v6_4: 'v6_4',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
function getClientAPI() {
|
|
@@ -19,7 +20,9 @@ function __runRunBeforeScript(...args) {
|
|
|
19
20
|
function getStorybookVersion() {
|
|
20
21
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
21
22
|
|
|
22
|
-
if (frameWindow.
|
|
23
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
24
|
+
return API_VERSIONS.v6_4;
|
|
25
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
23
26
|
return API_VERSIONS.v5_2;
|
|
24
27
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
25
28
|
return API_VERSIONS.v5;
|
|
@@ -81,6 +84,21 @@ function __runRunBeforeScript(...args) {
|
|
|
81
84
|
};
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
87
|
+
|
|
88
|
+
case API_VERSIONS.v6_4: {
|
|
89
|
+
api = {
|
|
90
|
+
getStories: () => {
|
|
91
|
+
return clientAPI.raw();
|
|
92
|
+
},
|
|
93
|
+
selectStory: async i => {
|
|
94
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
95
|
+
storyId: clientAPI.raw()[i].id,
|
|
96
|
+
});
|
|
97
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
return {version, ...api};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-storybook",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=8.6.0"
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"directory": "packages/eyes-storybook"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@applitools/driver": "1.
|
|
62
|
-
"@applitools/eyes-sdk-core": "12.24.
|
|
61
|
+
"@applitools/driver": "1.4.5",
|
|
62
|
+
"@applitools/eyes-sdk-core": "12.24.7",
|
|
63
63
|
"@applitools/functional-commons": "1.6.0",
|
|
64
|
-
"@applitools/logger": "1.0.
|
|
64
|
+
"@applitools/logger": "1.0.7",
|
|
65
65
|
"@applitools/monitoring-commons": "1.0.19",
|
|
66
66
|
"@applitools/spec-driver-puppeteer": "1.1.0",
|
|
67
|
-
"@applitools/test-server": "1.0.
|
|
68
|
-
"@applitools/visual-grid-client": "15.8.
|
|
67
|
+
"@applitools/test-server": "1.0.8",
|
|
68
|
+
"@applitools/visual-grid-client": "15.8.53",
|
|
69
69
|
"boxen": "4.2.0",
|
|
70
70
|
"chalk": "3.0.0",
|
|
71
71
|
"detect-port": "1.3.0",
|
|
@@ -79,11 +79,10 @@
|
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@applitools/scripts": "^1.0.1",
|
|
81
81
|
"@applitools/sdk-release-kit": "0.13.4",
|
|
82
|
-
"@applitools/sdk-shared": "0.9.
|
|
82
|
+
"@applitools/sdk-shared": "0.9.11",
|
|
83
83
|
"@applitools/snaptdout": "^1.0.1",
|
|
84
84
|
"@applitools/utils": "1.2.4",
|
|
85
|
-
"@storybook/
|
|
86
|
-
"@storybook/react": "^5.2.8",
|
|
85
|
+
"@storybook/react": "^6.4.0",
|
|
87
86
|
"@testing-library/dom": "^5.6.1",
|
|
88
87
|
"babel-core": "^6.26.3",
|
|
89
88
|
"babel-loader": "^8.0.6",
|
|
@@ -4,6 +4,7 @@ const API_VERSIONS = {
|
|
|
4
4
|
v4: 'v4',
|
|
5
5
|
v5: 'v5',
|
|
6
6
|
v5_2: 'v5_2',
|
|
7
|
+
v6_4: 'v6_4',
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
function getClientAPI() {
|
|
@@ -16,7 +17,9 @@ function getClientAPI() {
|
|
|
16
17
|
function getStorybookVersion() {
|
|
17
18
|
const addons = frameWindow.__STORYBOOK_ADDONS;
|
|
18
19
|
|
|
19
|
-
if (frameWindow.
|
|
20
|
+
if (frameWindow.__STORYBOOK_PREVIEW__) {
|
|
21
|
+
return API_VERSIONS.v6_4;
|
|
22
|
+
} else if (frameWindow.__STORYBOOK_STORY_STORE__) {
|
|
20
23
|
return API_VERSIONS.v5_2;
|
|
21
24
|
} else if (frameWindow.__STORYBOOK_CLIENT_API__ && frameWindow.__STORYBOOK_CLIENT_API__.raw) {
|
|
22
25
|
return API_VERSIONS.v5;
|
|
@@ -78,6 +81,21 @@ function getClientAPI() {
|
|
|
78
81
|
};
|
|
79
82
|
break;
|
|
80
83
|
}
|
|
84
|
+
|
|
85
|
+
case API_VERSIONS.v6_4: {
|
|
86
|
+
api = {
|
|
87
|
+
getStories: () => {
|
|
88
|
+
return clientAPI.raw();
|
|
89
|
+
},
|
|
90
|
+
selectStory: async i => {
|
|
91
|
+
frameWindow.__STORYBOOK_PREVIEW__.urlStore.setSelection({
|
|
92
|
+
storyId: clientAPI.raw()[i].id,
|
|
93
|
+
});
|
|
94
|
+
await frameWindow.__STORYBOOK_PREVIEW__.renderSelection();
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
81
99
|
}
|
|
82
100
|
|
|
83
101
|
return {version, ...api};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const getClientAPI = require('./getClientAPI');
|
|
2
2
|
|
|
3
|
-
function renderStoryWithClientAPI(index) {
|
|
3
|
+
async function renderStoryWithClientAPI(index) {
|
|
4
4
|
let api;
|
|
5
5
|
try {
|
|
6
6
|
api = getClientAPI();
|
|
7
|
-
api.selectStory(index);
|
|
7
|
+
await api.selectStory(index);
|
|
8
8
|
} catch (ex) {
|
|
9
9
|
return {message: ex.message, version: api ? api.version : undefined};
|
|
10
10
|
}
|
|
@@ -72,7 +72,7 @@ class StorybookConnector extends EventEmitter {
|
|
|
72
72
|
|
|
73
73
|
const successMessageListener = str => {
|
|
74
74
|
const isReady = stripAnsi(str).match(
|
|
75
|
-
/Storybook \d{1,2}\.\d{1,2}\.\d{1,2}(
|
|
75
|
+
/Storybook \d{1,2}\.\d{1,2}\.\d{1,2}(.+)? started|Storybook started on =>/,
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
if (isReady) {
|