creevey 0.9.0-beta.2 → 0.9.0-non-webpack.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/AUTHORS +15 -15
- package/CHANGELOG.md +1275 -1275
- package/LICENSE +21 -21
- package/README.md +7 -0
- package/addon/README.md +3 -0
- package/addon/package.json +4 -0
- package/docs/config.md +212 -212
- package/docs/grid.md +10 -10
- package/docs/tests.md +63 -63
- package/jest.config.js +6 -0
- package/lib/cjs/client/addon/Manager.js +123 -271
- package/lib/cjs/client/addon/components/Addon.js +17 -38
- package/lib/cjs/client/addon/components/Icons.js +12 -8
- package/lib/cjs/client/addon/components/Panel.js +17 -13
- package/lib/cjs/client/addon/components/TestSelect.js +11 -9
- package/lib/cjs/client/addon/components/Tools.js +21 -40
- package/lib/cjs/client/addon/decorator.js +1 -1
- package/lib/cjs/client/addon/index.js +31 -0
- package/lib/cjs/client/addon/preset.js +13 -32
- package/lib/cjs/client/addon/register.js +46 -70
- package/lib/cjs/client/addon/utils.js +1 -1
- package/lib/cjs/client/addon/withCreevey.js +164 -344
- package/lib/cjs/client/shared/components/ImagesView/BlendView.js +23 -21
- package/lib/cjs/client/shared/components/ImagesView/ImagesView.js +22 -18
- package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +42 -64
- package/lib/cjs/client/shared/components/ImagesView/SlideView.js +35 -48
- package/lib/cjs/client/shared/components/ImagesView/SwapView.js +24 -43
- package/lib/cjs/client/shared/components/ImagesView/index.js +9 -9
- package/lib/cjs/client/shared/components/PageFooter/PageFooter.js +12 -8
- package/lib/cjs/client/shared/components/PageFooter/Paging.js +14 -18
- package/lib/cjs/client/shared/components/PageHeader/ImagePreview.js +22 -18
- package/lib/cjs/client/shared/components/PageHeader/PageHeader.js +42 -67
- package/lib/cjs/client/shared/components/ResultsPage.js +39 -69
- package/lib/cjs/client/shared/creeveyClientApi.js +55 -82
- package/lib/cjs/client/shared/helpers.js +143 -214
- package/lib/cjs/client/shared/viewMode.js +5 -5
- package/lib/cjs/client/web/142.js +2 -0
- package/lib/cjs/client/web/142.js.LICENSE.txt +12 -0
- package/lib/cjs/client/web/32.js +1 -0
- package/lib/cjs/client/web/551.js +1 -0
- package/lib/cjs/client/web/566.js +2 -0
- package/lib/cjs/client/web/566.js.LICENSE.txt +31 -0
- package/lib/cjs/client/web/691.js +2 -0
- package/lib/cjs/client/web/691.js.LICENSE.txt +8 -0
- package/lib/cjs/client/web/725.js +1 -0
- package/lib/cjs/client/web/index.html +19 -19
- package/lib/cjs/client/web/main.js +2 -38
- package/lib/cjs/client/web/main.js.LICENSE.txt +49 -0
- package/lib/cjs/creevey.js +3 -5
- package/lib/cjs/index.js +4 -4
- package/lib/cjs/server/config.js +1 -1
- package/lib/cjs/server/docker.js +3 -7
- package/lib/cjs/server/index.js +1 -1
- package/lib/cjs/server/loaders/babel/creevey-plugin.js +1 -3
- package/lib/cjs/server/loaders/babel/helpers.js +13 -23
- package/lib/cjs/server/loaders/babel/register.js +1 -3
- package/lib/cjs/server/loaders/webpack/compile.js +31 -24
- package/lib/cjs/server/loaders/webpack/creevey-loader.js +10 -5
- package/lib/cjs/server/loaders/webpack/dummy-hmr.js +2 -7
- package/lib/cjs/server/loaders/webpack/mdx-loader.js +1 -1
- package/lib/cjs/server/loaders/webpack/start.js +1 -1
- package/lib/cjs/server/logger.js +2 -1
- package/lib/cjs/server/master/index.js +2 -2
- package/lib/cjs/server/master/pool.js +9 -18
- package/lib/cjs/server/master/runner.js +53 -66
- package/lib/cjs/server/master/server.js +2 -2
- package/lib/cjs/server/messages.js +8 -10
- package/lib/cjs/server/selenium/browser.js +23 -31
- package/lib/cjs/server/selenium/selenoid.js +5 -7
- package/lib/cjs/server/stories.js +9 -20
- package/lib/cjs/server/storybook/entry.js +5 -3
- package/lib/cjs/server/storybook/helpers.js +15 -21
- package/lib/cjs/server/storybook/providers/browser.js +5 -9
- package/lib/cjs/server/storybook/providers/nodejs.js +4 -4
- package/lib/cjs/server/update.js +1 -5
- package/lib/cjs/server/utils.js +13 -15
- package/lib/cjs/server/worker/reporter.js +8 -20
- package/lib/cjs/server/worker/worker.js +6 -16
- package/lib/cjs/shared/index.js +101 -0
- package/lib/cjs/shared/serializeRegExp.js +42 -0
- package/lib/cjs/types.js +6 -6
- package/lib/esm/client/addon/Manager.js +123 -271
- package/lib/esm/client/addon/components/Addon.js +15 -34
- package/lib/esm/client/addon/components/Icons.js +11 -7
- package/lib/esm/client/addon/components/Panel.js +17 -13
- package/lib/esm/client/addon/components/TestSelect.js +11 -9
- package/lib/esm/client/addon/components/Tools.js +19 -36
- package/lib/esm/client/addon/decorator.js +1 -1
- package/lib/esm/client/addon/index.js +2 -0
- package/lib/esm/client/addon/preset.js +10 -25
- package/lib/esm/client/addon/register.js +42 -66
- package/lib/esm/client/addon/utils.js +1 -1
- package/lib/esm/client/addon/withCreevey.js +157 -341
- package/lib/esm/client/shared/components/ImagesView/BlendView.js +21 -17
- package/lib/esm/client/shared/components/ImagesView/ImagesView.js +21 -17
- package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +40 -60
- package/lib/esm/client/shared/components/ImagesView/SlideView.js +33 -44
- package/lib/esm/client/shared/components/ImagesView/SwapView.js +22 -39
- package/lib/esm/client/shared/components/PageFooter/PageFooter.js +12 -8
- package/lib/esm/client/shared/components/PageFooter/Paging.js +14 -18
- package/lib/esm/client/shared/components/PageHeader/ImagePreview.js +22 -18
- package/lib/esm/client/shared/components/PageHeader/PageHeader.js +37 -60
- package/lib/esm/client/shared/components/ResultsPage.js +36 -64
- package/lib/esm/client/shared/creeveyClientApi.js +57 -84
- package/lib/esm/client/shared/helpers.js +127 -198
- package/lib/esm/client/shared/viewMode.js +4 -4
- package/lib/esm/creevey.js +3 -5
- package/lib/esm/index.js +1 -3
- package/lib/esm/server/docker.js +2 -2
- package/lib/esm/server/index.js +1 -1
- package/lib/esm/server/loaders/babel/creevey-plugin.js +1 -3
- package/lib/esm/server/loaders/babel/helpers.js +12 -22
- package/lib/esm/server/loaders/babel/register.js +1 -3
- package/lib/esm/server/loaders/webpack/compile.js +31 -24
- package/lib/esm/server/loaders/webpack/creevey-loader.js +9 -4
- package/lib/esm/server/loaders/webpack/dummy-hmr.js +2 -6
- package/lib/esm/server/loaders/webpack/start.js +1 -1
- package/lib/esm/server/master/index.js +2 -2
- package/lib/esm/server/master/pool.js +7 -18
- package/lib/esm/server/master/runner.js +53 -66
- package/lib/esm/server/master/server.js +2 -2
- package/lib/esm/server/messages.js +3 -5
- package/lib/esm/server/selenium/browser.js +20 -28
- package/lib/esm/server/selenium/selenoid.js +4 -6
- package/lib/esm/server/stories.js +9 -20
- package/lib/esm/server/storybook/entry.js +4 -2
- package/lib/esm/server/storybook/helpers.js +7 -15
- package/lib/esm/server/storybook/providers/browser.js +4 -5
- package/lib/esm/server/storybook/providers/nodejs.js +3 -3
- package/lib/esm/server/update.js +1 -5
- package/lib/esm/server/utils.js +5 -9
- package/lib/esm/server/worker/reporter.js +8 -20
- package/lib/esm/server/worker/worker.js +6 -16
- package/lib/esm/shared/index.js +78 -0
- package/lib/esm/shared/serializeRegExp.js +24 -0
- package/lib/types/cli.d.ts +1 -1
- package/lib/types/client/addon/Manager.d.ts +37 -37
- package/lib/types/client/addon/components/Addon.d.ts +8 -8
- package/lib/types/client/addon/components/Icons.d.ts +7 -7
- package/lib/types/client/addon/components/Panel.d.ts +9 -9
- package/lib/types/client/addon/components/TestSelect.d.ts +8 -9
- package/lib/types/client/addon/components/Tools.d.ts +6 -6
- package/lib/types/client/addon/decorator.d.ts +1 -1
- package/lib/types/client/addon/index.d.ts +2 -0
- package/lib/types/client/addon/preset.d.ts +23 -24
- package/lib/types/client/addon/readyForCapture.d.ts +6 -6
- package/lib/types/client/addon/register.d.ts +3 -3
- package/lib/types/client/addon/utils.d.ts +2 -2
- package/lib/types/client/addon/withCreevey.d.ts +24 -24
- package/lib/types/client/shared/components/ImagesView/BlendView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/ImagesView.d.ts +24 -25
- package/lib/types/client/shared/components/ImagesView/SideBySideView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/SlideView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/SwapView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/index.d.ts +5 -5
- package/lib/types/client/shared/components/PageFooter/PageFooter.d.ts +8 -9
- package/lib/types/client/shared/components/PageFooter/Paging.d.ts +7 -8
- package/lib/types/client/shared/components/PageHeader/ImagePreview.d.ts +12 -12
- package/lib/types/client/shared/components/PageHeader/PageHeader.d.ts +16 -17
- package/lib/types/client/shared/components/ResultsPage.d.ts +18 -18
- package/lib/types/client/shared/creeveyClientApi.d.ts +9 -9
- package/lib/types/client/shared/helpers.d.ts +46 -46
- package/lib/types/client/shared/viewMode.d.ts +4 -4
- package/lib/types/client/web/CreeveyApp.d.ts +11 -12
- package/lib/types/client/web/CreeveyContext.d.ts +11 -11
- package/lib/types/client/web/CreeveyLoader.d.ts +2 -3
- package/lib/types/client/web/CreeveyView/SideBar/Checkbox.d.ts +19 -19
- package/lib/types/client/web/CreeveyView/SideBar/Search.d.ts +6 -6
- package/lib/types/client/web/CreeveyView/SideBar/SideBar.d.ts +14 -14
- package/lib/types/client/web/CreeveyView/SideBar/SideBarHeader.d.ts +12 -13
- package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +33 -33
- package/lib/types/client/web/CreeveyView/SideBar/TestLink.d.ts +7 -8
- package/lib/types/client/web/CreeveyView/SideBar/TestStatusIcon.d.ts +10 -10
- package/lib/types/client/web/CreeveyView/SideBar/TestsStatus.d.ts +9 -9
- package/lib/types/client/web/CreeveyView/SideBar/Toggle.d.ts +6 -6
- package/lib/types/client/web/CreeveyView/SideBar/index.d.ts +1 -1
- package/lib/types/client/web/KeyboardEventsContext.d.ts +13 -13
- package/lib/types/client/web/index.d.ts +4 -4
- package/lib/types/creevey.d.ts +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/server/config.d.ts +4 -4
- package/lib/types/server/docker.d.ts +7 -7
- package/lib/types/server/extract.d.ts +2 -2
- package/lib/types/server/index.d.ts +2 -2
- package/lib/types/server/loaders/babel/creevey-plugin.d.ts +1 -1
- package/lib/types/server/loaders/babel/helpers.d.ts +19 -19
- package/lib/types/server/loaders/babel/register.d.ts +5 -5
- package/lib/types/server/loaders/hooks/mdx.d.ts +1 -1
- package/lib/types/server/loaders/hooks/svelte.d.ts +1 -1
- package/lib/types/server/loaders/webpack/compile.d.ts +2 -2
- package/lib/types/server/loaders/webpack/creevey-loader.d.ts +4 -2
- package/lib/types/server/loaders/webpack/dummy-hmr.d.ts +10 -10
- package/lib/types/server/loaders/webpack/mdx-loader.d.ts +6 -6
- package/lib/types/server/loaders/webpack/start.d.ts +1 -1
- package/lib/types/server/logger.d.ts +10 -6
- package/lib/types/server/master/api.d.ts +7 -7
- package/lib/types/server/master/index.d.ts +3 -3
- package/lib/types/server/master/master.d.ts +7 -7
- package/lib/types/server/master/pool.d.ts +31 -31
- package/lib/types/server/master/runner.d.ts +26 -26
- package/lib/types/server/master/server.d.ts +2 -2
- package/lib/types/server/messages.d.ts +27 -27
- package/lib/types/server/selenium/browser.d.ts +17 -17
- package/lib/types/server/selenium/index.d.ts +2 -2
- package/lib/types/server/selenium/selenoid.d.ts +3 -3
- package/lib/types/server/stories.d.ts +8 -8
- package/lib/types/server/storybook/entry.d.ts +18 -18
- package/lib/types/server/storybook/helpers.d.ts +24 -24
- package/lib/types/server/storybook/providers/browser.d.ts +4 -4
- package/lib/types/server/storybook/providers/hybrid.d.ts +4 -4
- package/lib/types/server/storybook/providers/nodejs.d.ts +9 -9
- package/lib/types/server/testsFiles/parser.d.ts +12 -12
- package/lib/types/server/testsFiles/register.d.ts +2 -2
- package/lib/types/server/update.d.ts +2 -2
- package/lib/types/server/utils.d.ts +20 -20
- package/lib/types/server/worker/chai-image.d.ts +6 -6
- package/lib/types/server/worker/helpers.d.ts +8 -8
- package/lib/types/server/worker/index.d.ts +1 -1
- package/lib/types/server/worker/reporter.d.ts +8 -8
- package/lib/types/server/worker/worker.d.ts +4 -4
- package/lib/types/{shared.d.ts → shared/index.d.ts} +7 -16
- package/lib/types/shared/serializeRegExp.d.ts +9 -0
- package/lib/types/types.d.ts +490 -489
- package/package.json +115 -102
- package/preset.js +9 -9
- package/types/babel__register.d.ts +1 -1
- package/types/chai.d.ts +12 -12
- package/types/event-source-polyfill.d.ts +6 -6
- package/types/mdx.d.ts +3 -2
- package/types/mocha.d.ts +20 -20
- package/types/png.d.ts +4 -4
- package/lib/cjs/client/web/1.js +0 -13
- package/lib/cjs/client/web/2.js +0 -1
- package/lib/cjs/shared.js +0 -124
- package/lib/esm/shared.js +0 -93
- package/storybook-static/stories.json +0 -21
package/lib/types/types.d.ts
CHANGED
@@ -1,489 +1,490 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="chai" />
|
3
|
-
import type { API as StorybookAPI } from '@storybook/api';
|
4
|
-
import type { DecoratorFunction } from '@storybook/addons';
|
5
|
-
import type { IKey } from 'selenium-webdriver/lib/input';
|
6
|
-
import type { Worker as ClusterWorker } from 'cluster';
|
7
|
-
import type { until, WebDriver, WebElementPromise } from 'selenium-webdriver';
|
8
|
-
import type Pixelmatch from 'pixelmatch';
|
9
|
-
import type { Context } from 'mocha';
|
10
|
-
export declare type DiffOptions = typeof Pixelmatch extends (x1: any, x2: any, x3: any, x4: any, x5: any, options?: infer T) => void ? T : never;
|
11
|
-
export declare type SetStoriesData = {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
*
|
49
|
-
*
|
50
|
-
* - StoryFn.story.
|
51
|
-
*
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
*
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
*
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
*
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
};
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
export
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
*
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
*
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
*
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
*
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
*
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
*
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
*
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
*
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
*
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
*
|
178
|
-
*
|
179
|
-
* In
|
180
|
-
*
|
181
|
-
*
|
182
|
-
*
|
183
|
-
*
|
184
|
-
*
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
*
|
190
|
-
*
|
191
|
-
*
|
192
|
-
*
|
193
|
-
*
|
194
|
-
*
|
195
|
-
*
|
196
|
-
*
|
197
|
-
*
|
198
|
-
*
|
199
|
-
*
|
200
|
-
*
|
201
|
-
*
|
202
|
-
*
|
203
|
-
*
|
204
|
-
*
|
205
|
-
*
|
206
|
-
*
|
207
|
-
*
|
208
|
-
*
|
209
|
-
*
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
*
|
223
|
-
*
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
*
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
*
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
*
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
export
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
};
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
}
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
}
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
};
|
328
|
-
|
329
|
-
export declare type
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
export declare type
|
344
|
-
export declare type
|
345
|
-
export declare type
|
346
|
-
export declare type
|
347
|
-
export declare type
|
348
|
-
export
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
export
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
}
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
}
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
export declare type
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
}
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
}
|
476
|
-
|
477
|
-
export declare
|
478
|
-
export declare function
|
479
|
-
export declare function
|
480
|
-
export declare function
|
481
|
-
export declare function
|
482
|
-
export declare function
|
483
|
-
export declare function
|
484
|
-
export declare function
|
485
|
-
export declare function
|
486
|
-
export declare function
|
487
|
-
export declare function
|
488
|
-
export declare function
|
489
|
-
export declare function
|
1
|
+
/// <reference types="node" />
|
2
|
+
/// <reference types="chai" />
|
3
|
+
import type { API as StorybookAPI } from '@storybook/api';
|
4
|
+
import type { DecoratorFunction } from '@storybook/addons';
|
5
|
+
import type { IKey } from 'selenium-webdriver/lib/input';
|
6
|
+
import type { Worker as ClusterWorker } from 'cluster';
|
7
|
+
import type { until, WebDriver, WebElementPromise } from 'selenium-webdriver';
|
8
|
+
import type Pixelmatch from 'pixelmatch';
|
9
|
+
import type { Context } from 'mocha';
|
10
|
+
export declare type DiffOptions = typeof Pixelmatch extends (x1: any, x2: any, x3: any, x4: any, x5: any, options?: infer T) => void ? T : never;
|
11
|
+
export declare type SetStoriesData = {
|
12
|
+
v?: number;
|
13
|
+
globalParameters: {
|
14
|
+
creevey?: CreeveyStoryParams;
|
15
|
+
};
|
16
|
+
kindParameters: Partial<{
|
17
|
+
[kind: string]: {
|
18
|
+
fileName: string;
|
19
|
+
creevey?: CreeveyStoryParams;
|
20
|
+
};
|
21
|
+
}>;
|
22
|
+
stories: StoriesRaw;
|
23
|
+
};
|
24
|
+
export declare type StoriesRaw = StorybookAPI extends {
|
25
|
+
setStories: (stories: infer SS) => void;
|
26
|
+
} ? SS : never;
|
27
|
+
export declare type StoryInput = StoriesRaw extends {
|
28
|
+
[id: string]: infer S;
|
29
|
+
} ? S : never;
|
30
|
+
export interface StoryMeta<StoryFnReturnType = unknown> {
|
31
|
+
title: string;
|
32
|
+
component?: unknown;
|
33
|
+
decorators?: DecoratorFunction<StoryFnReturnType>[];
|
34
|
+
parameters?: {
|
35
|
+
creevey?: CreeveyStoryParams;
|
36
|
+
[name: string]: unknown;
|
37
|
+
};
|
38
|
+
}
|
39
|
+
export interface CreeveyMeta {
|
40
|
+
parameters?: {
|
41
|
+
creevey?: CreeveyStoryParams;
|
42
|
+
[name: string]: unknown;
|
43
|
+
};
|
44
|
+
}
|
45
|
+
export interface CSFStory<StoryFnReturnType = unknown> {
|
46
|
+
(): StoryFnReturnType;
|
47
|
+
/**
|
48
|
+
* @deprecated
|
49
|
+
* CSF .story annotations deprecated; annotate story functions directly:
|
50
|
+
* - StoryFn.story.name => StoryFn.storyName
|
51
|
+
* - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
52
|
+
* See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
|
53
|
+
*/
|
54
|
+
story?: {
|
55
|
+
name?: string;
|
56
|
+
decorators?: DecoratorFunction<StoryFnReturnType>[];
|
57
|
+
parameters?: {
|
58
|
+
creevey?: CreeveyStoryParams;
|
59
|
+
[name: string]: unknown;
|
60
|
+
};
|
61
|
+
};
|
62
|
+
storyName?: string;
|
63
|
+
decorators?: DecoratorFunction<StoryFnReturnType>[];
|
64
|
+
parameters?: {
|
65
|
+
creevey?: CreeveyStoryParams;
|
66
|
+
[name: string]: unknown;
|
67
|
+
};
|
68
|
+
}
|
69
|
+
export interface CreeveyStory {
|
70
|
+
parameters?: {
|
71
|
+
creevey?: CreeveyStoryParams;
|
72
|
+
[name: string]: unknown;
|
73
|
+
};
|
74
|
+
}
|
75
|
+
export interface Capabilities {
|
76
|
+
browserName: string;
|
77
|
+
version?: string;
|
78
|
+
[prop: string]: unknown;
|
79
|
+
}
|
80
|
+
export declare type BrowserConfig = Capabilities & {
|
81
|
+
limit?: number;
|
82
|
+
gridUrl?: string;
|
83
|
+
storybookUrl?: string;
|
84
|
+
/**
|
85
|
+
* Storybook's globals to set in a specific browser
|
86
|
+
* @see https://github.com/storybookjs/storybook/blob/v6.0.0/docs/essentials/toolbars-and-globals.md
|
87
|
+
*/
|
88
|
+
_storybookGlobals?: StorybookGlobals;
|
89
|
+
/**
|
90
|
+
* Specify custom docker image. Used only with `useDocker == true`
|
91
|
+
* @default `selenoid/${browserName}:${version ?? 'latest'}`
|
92
|
+
*/
|
93
|
+
dockerImage?: string;
|
94
|
+
/**
|
95
|
+
* Command to start standalone webdriver
|
96
|
+
* Used only with `useDocker == false`
|
97
|
+
*/
|
98
|
+
webdriverCommand?: string[];
|
99
|
+
viewport?: {
|
100
|
+
width: number;
|
101
|
+
height: number;
|
102
|
+
};
|
103
|
+
};
|
104
|
+
export interface StorybookGlobals {
|
105
|
+
[key: string]: unknown;
|
106
|
+
}
|
107
|
+
export declare type Browser = boolean | string | BrowserConfig;
|
108
|
+
export interface HookConfig {
|
109
|
+
before?: () => unknown;
|
110
|
+
after?: () => unknown;
|
111
|
+
}
|
112
|
+
export interface DockerAuth {
|
113
|
+
key?: string;
|
114
|
+
username?: string;
|
115
|
+
password?: string;
|
116
|
+
auth?: string;
|
117
|
+
email?: string;
|
118
|
+
serveraddress?: string;
|
119
|
+
}
|
120
|
+
export interface Config {
|
121
|
+
/**
|
122
|
+
* Url to Selenium grid hub or standalone selenium.
|
123
|
+
* By default creevey will use docker containers
|
124
|
+
*/
|
125
|
+
gridUrl: string;
|
126
|
+
/**
|
127
|
+
* Url where storybook hosted on
|
128
|
+
* @default 'http://localhost:6006'
|
129
|
+
*/
|
130
|
+
storybookUrl: string;
|
131
|
+
/**
|
132
|
+
* Url where storybook hosted on
|
133
|
+
*/
|
134
|
+
resolveStorybookUrl?: () => Promise<string>;
|
135
|
+
/**
|
136
|
+
* Absolute path to directory with reference images
|
137
|
+
* @default path.join(process.cwd(), './images')
|
138
|
+
*/
|
139
|
+
screenDir: string;
|
140
|
+
/**
|
141
|
+
* Absolute path where test reports and diff images would be saved
|
142
|
+
* @default path.join(process.cwd(), './report')
|
143
|
+
*/
|
144
|
+
reportDir: string;
|
145
|
+
/**
|
146
|
+
* Absolute path to storybook config directory
|
147
|
+
* @default path.join(process.cwd(), './.storybook')
|
148
|
+
*/
|
149
|
+
storybookDir: string;
|
150
|
+
/**
|
151
|
+
* How much test would be retried
|
152
|
+
* @default 0
|
153
|
+
*/
|
154
|
+
maxRetries: number;
|
155
|
+
/**
|
156
|
+
* Define pixelmatch diff options
|
157
|
+
* @default { threshold: 0, includeAA: true }
|
158
|
+
*/
|
159
|
+
diffOptions: DiffOptions;
|
160
|
+
/**
|
161
|
+
* Browser capabilities
|
162
|
+
* @default { chrome: true }
|
163
|
+
*/
|
164
|
+
browsers: {
|
165
|
+
[key: string]: Browser;
|
166
|
+
};
|
167
|
+
/**
|
168
|
+
* Hooks that allow run custom script before and after creevey start
|
169
|
+
*/
|
170
|
+
hooks: HookConfig;
|
171
|
+
/**
|
172
|
+
* Creevey automatically download latest selenoid binary. You can define path to different verison.
|
173
|
+
* Works only with `useDocker == false`
|
174
|
+
*/
|
175
|
+
selenoidPath?: string;
|
176
|
+
/**
|
177
|
+
* Creevey extract tests by using babel transformations
|
178
|
+
* and load stories to nodejs directly.
|
179
|
+
* In some edge cases it may fail to load tests.
|
180
|
+
* In that case you can enable this option.
|
181
|
+
* Creevey uses Storybook webpack config to build nodejs bundle with tests.
|
182
|
+
* But it slightly slower and doesn't work if you use custom bundler for Storybook
|
183
|
+
*
|
184
|
+
* Affects only for Storybook 6.2+
|
185
|
+
* @default false
|
186
|
+
*/
|
187
|
+
useWebpackToExtractTests: boolean;
|
188
|
+
/**
|
189
|
+
* Creevey has two built-in stories providers.
|
190
|
+
*
|
191
|
+
* `nodejsStoriesProvider` - The first one is used by default except if CSFv3 is enabled in Storybook.
|
192
|
+
* This provider builds and runs storybook in nodejs env, that allows write interaction tests by using Selenium API.
|
193
|
+
* The downside is it depends from project build specific and slightly increases init time.
|
194
|
+
*
|
195
|
+
* `browserStoriesProvider` - The second one is used by default with CSFv3 storybook feature.
|
196
|
+
* It load stories from storybook which is running in browser, like storyshots or loki do it.
|
197
|
+
* The downside of this, you can't use interaction tests in Creevey, unless you use CSFv3.
|
198
|
+
* Where you can define `play` method for each story
|
199
|
+
*
|
200
|
+
* Usage
|
201
|
+
* ``` typescript
|
202
|
+
* import { nodejsStoriesProvider as provider } from 'creevey'
|
203
|
+
* // or
|
204
|
+
* import { browserStoriesProvider as provider } from 'creevey'
|
205
|
+
*
|
206
|
+
* // Creevey config
|
207
|
+
* module.exports = {
|
208
|
+
* storiesProvider: provider
|
209
|
+
* }
|
210
|
+
* ```
|
211
|
+
*/
|
212
|
+
storiesProvider: (config: Config, options: {
|
213
|
+
watch: boolean;
|
214
|
+
debug: boolean;
|
215
|
+
port: number;
|
216
|
+
}, storiesListener: (stories: Map<string, StoryInput[]>) => void) => Promise<StoriesRaw>;
|
217
|
+
/**
|
218
|
+
* Define custom babel options for load stories transformation
|
219
|
+
*/
|
220
|
+
babelOptions: (options: Record<string, unknown>) => Record<string, unknown>;
|
221
|
+
/**
|
222
|
+
* Allows you to start selenoid without docker
|
223
|
+
* and use standalone browsers
|
224
|
+
* @default true
|
225
|
+
*/
|
226
|
+
useDocker: boolean;
|
227
|
+
/**
|
228
|
+
* Custom selenoid docker image
|
229
|
+
* @default 'aerokube/selenoid:latest-release'
|
230
|
+
*/
|
231
|
+
dockerImage: string;
|
232
|
+
/**
|
233
|
+
* Should Creevey pull docker images or use local ones
|
234
|
+
* @default true
|
235
|
+
*/
|
236
|
+
pullImages: boolean;
|
237
|
+
/**
|
238
|
+
* Define auth config for private docker registry
|
239
|
+
*/
|
240
|
+
dockerAuth?: DockerAuth;
|
241
|
+
/**
|
242
|
+
* Enable to stop tests running right after the first failed test.
|
243
|
+
* The `--ui` CLI option ignores this option
|
244
|
+
*/
|
245
|
+
failFast: boolean;
|
246
|
+
/**
|
247
|
+
* Specify platform for docker images
|
248
|
+
*/
|
249
|
+
dockerImagePlatform: string;
|
250
|
+
testsRegex?: RegExp;
|
251
|
+
testsDir?: string;
|
252
|
+
tsConfig?: string;
|
253
|
+
}
|
254
|
+
export declare type CreeveyConfig = Partial<Config>;
|
255
|
+
export interface Options {
|
256
|
+
config?: string;
|
257
|
+
port: number;
|
258
|
+
ui: boolean;
|
259
|
+
update: boolean | string;
|
260
|
+
webpack: boolean;
|
261
|
+
debug: boolean;
|
262
|
+
extract: boolean | string;
|
263
|
+
tests: boolean;
|
264
|
+
browser?: string;
|
265
|
+
reporter?: string;
|
266
|
+
screenDir?: string;
|
267
|
+
reportDir?: string;
|
268
|
+
saveReport: boolean;
|
269
|
+
failFast?: boolean;
|
270
|
+
}
|
271
|
+
export declare type WorkerMessage = {
|
272
|
+
type: 'ready';
|
273
|
+
payload?: never;
|
274
|
+
} | {
|
275
|
+
type: 'error';
|
276
|
+
payload: {
|
277
|
+
error: string;
|
278
|
+
};
|
279
|
+
};
|
280
|
+
export declare type StoriesMessage = {
|
281
|
+
type: 'get';
|
282
|
+
payload?: never;
|
283
|
+
} | {
|
284
|
+
type: 'set';
|
285
|
+
payload: {
|
286
|
+
stories: StoriesRaw;
|
287
|
+
oldTests: string[];
|
288
|
+
};
|
289
|
+
} | {
|
290
|
+
type: 'update';
|
291
|
+
payload: [string, StoryInput[]][];
|
292
|
+
} | {
|
293
|
+
type: 'capture';
|
294
|
+
payload?: CaptureOptions;
|
295
|
+
};
|
296
|
+
export declare type TestMessage = {
|
297
|
+
type: 'start';
|
298
|
+
payload: {
|
299
|
+
id: string;
|
300
|
+
path: string[];
|
301
|
+
retries: number;
|
302
|
+
};
|
303
|
+
} | {
|
304
|
+
type: 'end';
|
305
|
+
payload: TestResult;
|
306
|
+
};
|
307
|
+
export declare type WebpackMessage = {
|
308
|
+
type: 'success';
|
309
|
+
payload?: never;
|
310
|
+
} | {
|
311
|
+
type: 'fail';
|
312
|
+
payload?: never;
|
313
|
+
} | {
|
314
|
+
type: 'rebuild succeeded';
|
315
|
+
payload?: never;
|
316
|
+
} | {
|
317
|
+
type: 'rebuild failed';
|
318
|
+
payload?: never;
|
319
|
+
};
|
320
|
+
export declare type DockerMessage = {
|
321
|
+
type: 'start';
|
322
|
+
payload?: never;
|
323
|
+
} | {
|
324
|
+
type: 'success';
|
325
|
+
payload: {
|
326
|
+
gridUrl: string;
|
327
|
+
};
|
328
|
+
};
|
329
|
+
export declare type ShutdownMessage = unknown;
|
330
|
+
export declare type ProcessMessage = (WorkerMessage & {
|
331
|
+
scope: 'worker';
|
332
|
+
}) | (StoriesMessage & {
|
333
|
+
scope: 'stories';
|
334
|
+
}) | (TestMessage & {
|
335
|
+
scope: 'test';
|
336
|
+
}) | (WebpackMessage & {
|
337
|
+
scope: 'webpack';
|
338
|
+
}) | (DockerMessage & {
|
339
|
+
scope: 'docker';
|
340
|
+
}) | (ShutdownMessage & {
|
341
|
+
scope: 'shutdown';
|
342
|
+
});
|
343
|
+
export declare type WorkerHandler = (message: WorkerMessage) => void;
|
344
|
+
export declare type StoriesHandler = (message: StoriesMessage) => void;
|
345
|
+
export declare type TestHandler = (message: TestMessage) => void;
|
346
|
+
export declare type WebpackHandler = (message: WebpackMessage) => void;
|
347
|
+
export declare type DockerHandler = (message: DockerMessage) => void;
|
348
|
+
export declare type ShutdownHandler = (message: ShutdownMessage) => void;
|
349
|
+
export interface Worker extends ClusterWorker {
|
350
|
+
isRunning?: boolean;
|
351
|
+
}
|
352
|
+
export interface Images {
|
353
|
+
actual: string;
|
354
|
+
expect?: string;
|
355
|
+
diff?: string;
|
356
|
+
error?: string;
|
357
|
+
}
|
358
|
+
export declare type TestStatus = 'unknown' | 'pending' | 'running' | 'failed' | 'success' | 'retrying';
|
359
|
+
export interface TestResult {
|
360
|
+
status: 'failed' | 'success';
|
361
|
+
images?: Partial<{
|
362
|
+
[name: string]: Images;
|
363
|
+
}>;
|
364
|
+
error?: string;
|
365
|
+
}
|
366
|
+
export interface ImagesError extends Error {
|
367
|
+
images: string | Partial<{
|
368
|
+
[name: string]: string;
|
369
|
+
}>;
|
370
|
+
}
|
371
|
+
export interface TestMeta {
|
372
|
+
id: string;
|
373
|
+
storyPath: string[];
|
374
|
+
browser: string;
|
375
|
+
testName?: string;
|
376
|
+
storyId: string;
|
377
|
+
}
|
378
|
+
export interface TestData extends TestMeta {
|
379
|
+
skip?: boolean | string;
|
380
|
+
retries?: number;
|
381
|
+
status?: TestStatus;
|
382
|
+
results?: TestResult[];
|
383
|
+
approved?: Partial<{
|
384
|
+
[image: string]: number;
|
385
|
+
}>;
|
386
|
+
}
|
387
|
+
export interface ServerTest extends TestData {
|
388
|
+
story: StoryInput;
|
389
|
+
fn: (this: Context) => Promise<void>;
|
390
|
+
}
|
391
|
+
export interface CreeveyStatus {
|
392
|
+
isRunning: boolean;
|
393
|
+
tests: Partial<{
|
394
|
+
[id: string]: TestData;
|
395
|
+
}>;
|
396
|
+
browsers: string[];
|
397
|
+
}
|
398
|
+
export interface CreeveyUpdate {
|
399
|
+
isRunning?: boolean;
|
400
|
+
tests?: Partial<{
|
401
|
+
[id: string]: TestData;
|
402
|
+
}>;
|
403
|
+
removedTests?: TestMeta[];
|
404
|
+
}
|
405
|
+
export interface SkipOption {
|
406
|
+
reason?: string;
|
407
|
+
in?: string | string[] | RegExp;
|
408
|
+
kinds?: string | string[] | RegExp;
|
409
|
+
stories?: string | string[] | RegExp;
|
410
|
+
tests?: string | string[] | RegExp;
|
411
|
+
}
|
412
|
+
export declare type SkipOptions = boolean | string | SkipOption | SkipOption[] | Record<string, SkipOption | SkipOption[]>;
|
413
|
+
export declare type CreeveyTestFunction = (this: {
|
414
|
+
browser: WebDriver;
|
415
|
+
until: typeof until;
|
416
|
+
keys: IKey;
|
417
|
+
expect: Chai.ExpectStatic;
|
418
|
+
takeScreenshot: () => Promise<string>;
|
419
|
+
updateStoryArgs: <Args extends Record<string, unknown>>(updatedArgs: Args) => Promise<void>;
|
420
|
+
readonly captureElement?: WebElementPromise;
|
421
|
+
}) => Promise<void>;
|
422
|
+
export interface CaptureOptions {
|
423
|
+
imageName?: string;
|
424
|
+
captureElement?: string | null;
|
425
|
+
ignoreElements?: string | string[] | null;
|
426
|
+
}
|
427
|
+
export interface CreeveyStoryParams extends CaptureOptions {
|
428
|
+
waitForReady?: boolean;
|
429
|
+
delay?: number | {
|
430
|
+
for: string[];
|
431
|
+
ms: number;
|
432
|
+
};
|
433
|
+
skip?: SkipOptions;
|
434
|
+
tests?: {
|
435
|
+
[name: string]: CreeveyTestFunction;
|
436
|
+
};
|
437
|
+
}
|
438
|
+
export interface ApprovePayload {
|
439
|
+
id: string;
|
440
|
+
retry: number;
|
441
|
+
image: string;
|
442
|
+
}
|
443
|
+
export declare type Request = {
|
444
|
+
type: 'status';
|
445
|
+
} | {
|
446
|
+
type: 'start';
|
447
|
+
payload: string[];
|
448
|
+
} | {
|
449
|
+
type: 'stop';
|
450
|
+
} | {
|
451
|
+
type: 'approve';
|
452
|
+
payload: ApprovePayload;
|
453
|
+
};
|
454
|
+
export declare type Response = {
|
455
|
+
type: 'status';
|
456
|
+
payload: CreeveyStatus;
|
457
|
+
} | {
|
458
|
+
type: 'update';
|
459
|
+
payload: CreeveyUpdate;
|
460
|
+
} | {
|
461
|
+
type: 'capture';
|
462
|
+
};
|
463
|
+
export interface CreeveyTest extends TestData {
|
464
|
+
checked: boolean;
|
465
|
+
}
|
466
|
+
export interface CreeveySuite {
|
467
|
+
path: string[];
|
468
|
+
skip: boolean;
|
469
|
+
status?: TestStatus;
|
470
|
+
opened: boolean;
|
471
|
+
checked: boolean;
|
472
|
+
indeterminate: boolean;
|
473
|
+
children: Partial<{
|
474
|
+
[title: string]: CreeveySuite | CreeveyTest;
|
475
|
+
}>;
|
476
|
+
}
|
477
|
+
export declare type ImagesViewMode = 'side-by-side' | 'swap' | 'slide' | 'blend';
|
478
|
+
export declare function noop(): void;
|
479
|
+
export declare function isDefined<T>(value: T | null | undefined): value is T;
|
480
|
+
export declare function isTest<T1, T2 extends TestData>(x?: T1 | T2): x is T2;
|
481
|
+
export declare function isObject(x: unknown): x is Record<string, unknown>;
|
482
|
+
export declare function isString(x: unknown): x is string;
|
483
|
+
export declare function isFunction(x: unknown): x is (...args: any[]) => any;
|
484
|
+
export declare function isImageError(error: unknown): error is ImagesError;
|
485
|
+
export declare function isProcessMessage(message: unknown): message is ProcessMessage;
|
486
|
+
export declare function isWorkerMessage(message: unknown): message is WorkerMessage;
|
487
|
+
export declare function isStoriesMessage(message: unknown): message is StoriesMessage;
|
488
|
+
export declare function isTestMessage(message: unknown): message is TestMessage;
|
489
|
+
export declare function isWebpackMessage(message: unknown): message is WebpackMessage;
|
490
|
+
export declare function isDockerMessage(message: unknown): message is DockerMessage;
|