creevey 0.8.0-beta.0 → 0.9.0-beta.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 +5 -9
- package/lib/cjs/client/addon/Manager.js +0 -1
- package/lib/cjs/client/addon/preset.js +1 -0
- package/lib/cjs/client/addon/readyForCapture.js +12 -0
- package/lib/cjs/client/addon/withCreevey.js +313 -41
- package/lib/cjs/client/shared/components/ImagesView/BlendView.js +3 -3
- package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +3 -3
- package/lib/cjs/client/shared/components/ImagesView/SlideView.js +4 -3
- package/lib/cjs/client/shared/components/ImagesView/SwapView.js +3 -3
- package/lib/cjs/client/shared/helpers.js +1 -1
- package/lib/cjs/client/web/main.js +6 -6
- package/lib/cjs/index.js +27 -9
- package/lib/cjs/server/config.js +7 -3
- package/lib/cjs/server/extract.js +11 -4
- package/lib/cjs/server/index.js +2 -4
- package/lib/cjs/server/master/index.js +3 -9
- package/lib/cjs/server/master/master.js +1 -0
- package/lib/cjs/server/master/pool.js +29 -29
- package/lib/cjs/server/master/server.js +75 -3
- package/lib/cjs/server/messages.js +124 -12
- package/lib/cjs/server/parser.js +85 -0
- package/lib/cjs/server/selenium/browser.js +119 -21
- package/lib/cjs/server/stories.js +49 -46
- package/lib/cjs/server/storybook/providers/browser.js +78 -0
- package/lib/cjs/server/storybook/providers/hybrid.js +79 -0
- package/lib/cjs/server/storybook/{nodejs-provider.js → providers/nodejs.js} +32 -13
- package/lib/cjs/server/utils.js +7 -0
- package/lib/cjs/server/worker/helpers.js +2 -6
- package/lib/cjs/server/worker/worker.js +15 -3
- package/lib/cjs/shared.js +78 -6
- package/lib/cjs/types.js +5 -0
- package/lib/esm/client/addon/Manager.js +0 -1
- package/lib/esm/client/addon/preset.js +1 -0
- package/lib/esm/client/addon/readyForCapture.js +5 -0
- package/lib/esm/client/addon/withCreevey.js +303 -41
- package/lib/esm/client/shared/components/ImagesView/BlendView.js +2 -3
- package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +2 -3
- package/lib/esm/client/shared/components/ImagesView/SlideView.js +3 -3
- package/lib/esm/client/shared/components/ImagesView/SwapView.js +2 -3
- package/lib/esm/client/shared/helpers.js +1 -1
- package/lib/esm/index.js +6 -3
- package/lib/esm/server/config.js +7 -5
- package/lib/esm/server/extract.js +8 -4
- package/lib/esm/server/index.js +2 -3
- package/lib/esm/server/master/index.js +4 -10
- package/lib/esm/server/master/master.js +1 -0
- package/lib/esm/server/master/pool.js +31 -31
- package/lib/esm/server/master/server.js +73 -5
- package/lib/esm/server/messages.js +118 -12
- package/lib/esm/server/parser.js +63 -0
- package/lib/esm/server/selenium/browser.js +116 -23
- package/lib/esm/server/stories.js +50 -46
- package/lib/esm/server/storybook/providers/browser.js +61 -0
- package/lib/esm/server/storybook/providers/hybrid.js +63 -0
- package/lib/esm/server/storybook/{nodejs-provider.js → providers/nodejs.js} +30 -13
- package/lib/esm/server/utils.js +6 -1
- package/lib/esm/server/worker/helpers.js +2 -6
- package/lib/esm/server/worker/worker.js +16 -4
- package/lib/esm/shared.js +59 -5
- package/lib/esm/types.js +3 -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 +9 -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/preset.d.ts +24 -22
- package/lib/types/client/addon/readyForCapture.d.ts +6 -0
- 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 -13
- package/lib/types/client/shared/components/ImagesView/BlendView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/ImagesView.d.ts +25 -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 +9 -9
- package/lib/types/client/shared/components/PageFooter/Paging.d.ts +8 -8
- package/lib/types/client/shared/components/PageHeader/ImagePreview.d.ts +12 -12
- package/lib/types/client/shared/components/PageHeader/PageHeader.d.ts +17 -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 +12 -12
- package/lib/types/client/web/CreeveyContext.d.ts +11 -11
- package/lib/types/client/web/CreeveyLoader.d.ts +3 -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 +13 -13
- package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +33 -33
- package/lib/types/client/web/CreeveyView/SideBar/TestLink.d.ts +8 -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 +2 -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 +2 -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 +6 -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 -6
- package/lib/types/server/master/pool.d.ts +31 -30
- 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 +28 -18
- package/lib/types/server/parser.d.ts +12 -0
- package/lib/types/server/selenium/browser.d.ts +17 -14
- 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 -0
- package/lib/types/server/storybook/providers/hybrid.d.ts +4 -0
- package/lib/types/server/storybook/providers/nodejs.d.ts +9 -0
- package/lib/types/server/update.d.ts +2 -2
- package/lib/types/server/utils.d.ts +20 -19
- package/lib/types/server/worker/chai-image.d.ts +6 -6
- package/lib/types/server/worker/helpers.d.ts +8 -7
- 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 +16 -4
- package/lib/types/types.d.ts +488 -459
- package/package.json +12 -6
- package/storybook-static/stories.json +21 -0
- package/types/mocha.d.ts +1 -0
- package/lib/types/server/storybook/nodejs-provider.d.ts +0 -5
@@ -8,7 +8,7 @@ import { Key, until } from 'selenium-webdriver';
|
|
8
8
|
import { isImageError } from '../../types';
|
9
9
|
import { subscribeOn, emitTestMessage, emitWorkerMessage } from '../messages';
|
10
10
|
import chaiImage from './chai-image';
|
11
|
-
import { getBrowser, switchStory } from '../selenium';
|
11
|
+
import { closeBrowser, getBrowser, switchStory } from '../selenium';
|
12
12
|
import { CreeveyReporter, TeamcityReporter } from './reporter';
|
13
13
|
import { addTestsFromStories } from './helpers';
|
14
14
|
import { logger } from '../logger';
|
@@ -49,6 +49,7 @@ export default async function worker(config, options) {
|
|
49
49
|
let retries = 0;
|
50
50
|
let images = {};
|
51
51
|
let error = undefined;
|
52
|
+
const screenshots = [];
|
52
53
|
const testScope = [];
|
53
54
|
|
54
55
|
function runHandler(failures) {
|
@@ -173,13 +174,23 @@ export default async function worker(config, options) {
|
|
173
174
|
|
174
175
|
mocha.cleanReferencesAfterRun(false);
|
175
176
|
chai.use(chaiImage(getExpected, config.diffOptions));
|
177
|
+
if ((await getBrowser(config, options.browser)) == null) return;
|
176
178
|
await addTestsFromStories(mocha.suite, config, {
|
177
179
|
browser: options.browser,
|
178
180
|
watch: options.ui,
|
179
|
-
debug: options.debug
|
181
|
+
debug: options.debug,
|
182
|
+
port: options.port
|
180
183
|
});
|
181
|
-
|
182
|
-
|
184
|
+
|
185
|
+
try {
|
186
|
+
var _await$getBrowser;
|
187
|
+
|
188
|
+
await ((_await$getBrowser = await getBrowser(config, options.browser)) === null || _await$getBrowser === void 0 ? void 0 : _await$getBrowser.getCurrentUrl());
|
189
|
+
} catch (_) {
|
190
|
+
await closeBrowser();
|
191
|
+
}
|
192
|
+
|
193
|
+
const browser = await getBrowser(config, options.browser);
|
183
194
|
const sessionId = (_await$browser$getSes = await (browser === null || browser === void 0 ? void 0 : browser.getSession())) === null || _await$browser$getSes === void 0 ? void 0 : _await$browser$getSes.getId();
|
184
195
|
if (browser == null) return;
|
185
196
|
const interval = setInterval(() => void browser.getCurrentUrl().then(url => {
|
@@ -194,6 +205,7 @@ export default async function worker(config, options) {
|
|
194
205
|
this.expect = chai.expect;
|
195
206
|
this.browserName = options.browser;
|
196
207
|
this.testScope = testScope;
|
208
|
+
this.screenshots = screenshots;
|
197
209
|
});
|
198
210
|
mocha.suite.beforeEach(switchStory);
|
199
211
|
subscribeOn('test', message => {
|
package/lib/esm/shared.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { mapValues, mergeWith } from 'lodash';
|
1
|
+
import { mapValues, mergeWith, cloneDeepWith } from 'lodash';
|
2
2
|
// NOTE: Copy-paste from storybook/api
|
3
3
|
export const combineParameters = (...parameterSets) => // eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
4
4
|
mergeWith({}, ...parameterSets, (_, srcValue) => {
|
@@ -13,10 +13,64 @@ export const denormalizeStoryParameters = ({
|
|
13
13
|
stories
|
14
14
|
}) => {
|
15
15
|
return mapValues(stories, storyData => {
|
16
|
-
var _kindParameters$story;
|
16
|
+
var _globalParameters$cre, _kindParameters$story, _kindParameters$story2;
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
};
|
18
|
+
storyData.parameters.creevey = combineParameters((_globalParameters$cre = globalParameters.creevey) !== null && _globalParameters$cre !== void 0 ? _globalParameters$cre : {}, (_kindParameters$story = (_kindParameters$story2 = kindParameters[storyData.kind]) === null || _kindParameters$story2 === void 0 ? void 0 : _kindParameters$story2.creevey) !== null && _kindParameters$story !== void 0 ? _kindParameters$story : {}, storyData.parameters.creevey);
|
19
|
+
return storyData;
|
21
20
|
});
|
21
|
+
};
|
22
|
+
export const isSerializedRegExp = exp => {
|
23
|
+
return typeof exp === 'object' && exp !== null && Reflect.get(exp, '__regexp') === true;
|
24
|
+
};
|
25
|
+
export const serializeRegExp = exp => {
|
26
|
+
const {
|
27
|
+
source,
|
28
|
+
flags
|
29
|
+
} = exp;
|
30
|
+
return {
|
31
|
+
__regexp: true,
|
32
|
+
source,
|
33
|
+
flags
|
34
|
+
};
|
35
|
+
};
|
36
|
+
export const deserializeRegExp = ({
|
37
|
+
source,
|
38
|
+
flags
|
39
|
+
}) => {
|
40
|
+
return new RegExp(source, flags);
|
41
|
+
};
|
42
|
+
export const serializeRawStories = stories => {
|
43
|
+
return mapValues(stories, storyData => {
|
44
|
+
const creevey = storyData.parameters.creevey;
|
45
|
+
|
46
|
+
if ((creevey === null || creevey === void 0 ? void 0 : creevey.skip) !== undefined) {
|
47
|
+
creevey.skip = cloneDeepWith(creevey.skip, value => {
|
48
|
+
if (value instanceof RegExp) {
|
49
|
+
return serializeRegExp(value);
|
50
|
+
}
|
51
|
+
|
52
|
+
return undefined;
|
53
|
+
});
|
54
|
+
}
|
55
|
+
|
56
|
+
return storyData;
|
57
|
+
});
|
58
|
+
};
|
59
|
+
export const deserializeRawStories = stories => {
|
60
|
+
return mapValues(stories, deserializeStory);
|
61
|
+
};
|
62
|
+
export const deserializeStory = story => {
|
63
|
+
const creevey = story.parameters.creevey;
|
64
|
+
|
65
|
+
if ((creevey === null || creevey === void 0 ? void 0 : creevey.skip) !== undefined) {
|
66
|
+
creevey.skip = cloneDeepWith(creevey.skip, value => {
|
67
|
+
if (isSerializedRegExp(value)) {
|
68
|
+
return deserializeRegExp(value);
|
69
|
+
}
|
70
|
+
|
71
|
+
return undefined;
|
72
|
+
});
|
73
|
+
}
|
74
|
+
|
75
|
+
return story;
|
22
76
|
};
|
package/lib/esm/types.js
CHANGED
@@ -29,6 +29,9 @@ export function isProcessMessage(message) {
|
|
29
29
|
export function isWorkerMessage(message) {
|
30
30
|
return isProcessMessage(message) && message.scope == 'worker';
|
31
31
|
}
|
32
|
+
export function isStoriesMessage(message) {
|
33
|
+
return isProcessMessage(message) && message.scope == 'stories';
|
34
|
+
}
|
32
35
|
export function isTestMessage(message) {
|
33
36
|
return isProcessMessage(message) && message.scope == 'test';
|
34
37
|
}
|
package/lib/types/cli.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
#!/usr/bin/env node
|
1
|
+
#!/usr/bin/env node
|
@@ -1,37 +1,37 @@
|
|
1
|
-
import { API } from '@storybook/api';
|
2
|
-
import { SetStoriesPayload } from '@storybook/api/dist/ts3.9/lib/stories';
|
3
|
-
import { CreeveyStatus, CreeveyUpdate, TestData, TestStatus, StoriesRaw } from '../../types';
|
4
|
-
import { CreeveyClientApi } from '../shared/creeveyClientApi';
|
5
|
-
export declare class CreeveyManager {
|
6
|
-
storybookApi: API;
|
7
|
-
storyId: string;
|
8
|
-
activeBrowser: string;
|
9
|
-
selectedTestId: string;
|
10
|
-
status: CreeveyStatus;
|
11
|
-
creeveyApi: CreeveyClientApi | null;
|
12
|
-
stories: StoriesRaw;
|
13
|
-
updateStatusListeners: Array<(update: CreeveyUpdate) => void>;
|
14
|
-
changeTestListeners: Array<(testId: string) => void>;
|
15
|
-
constructor(storybookApi: API);
|
16
|
-
initAll: () => Promise<void>;
|
17
|
-
onUpdateStatus(listener: (update: CreeveyUpdate) => void): () => void;
|
18
|
-
onChangeTest(listener: (testId: string) => void): () => void;
|
19
|
-
handleCreeveyUpdate: (update: CreeveyUpdate) => void;
|
20
|
-
getCurrentTest: () => TestData | undefined;
|
21
|
-
onStoryRendered: (storyId: string) => void;
|
22
|
-
onStart: () => void;
|
23
|
-
onStop: () => void;
|
24
|
-
onImageApprove: (id: string, retry: number, image: string) => void;
|
25
|
-
onStartAllStoryTests: () => void;
|
26
|
-
onStartAllTests: () => void;
|
27
|
-
onSetStories: (data: SetStoriesPayload) => void;
|
28
|
-
setActiveBrowser: (browser: string) => void;
|
29
|
-
setSelectedTestId: (testId: string) => void;
|
30
|
-
getStoryTests: (storyId: string) => TestData[];
|
31
|
-
getBrowsers: () => string[];
|
32
|
-
getTestsByStoryIdAndBrowser: (browser: string) => TestData[];
|
33
|
-
getTabTitle: (browser: string) => string;
|
34
|
-
setPanelsTitle: () => void;
|
35
|
-
addStatusesToSideBar(): Promise<void>;
|
36
|
-
addStatusToStoryName(name: string, status: TestStatus | undefined, skip: string | boolean): string;
|
37
|
-
}
|
1
|
+
import { API } from '@storybook/api';
|
2
|
+
import { SetStoriesPayload } from '@storybook/api/dist/ts3.9/lib/stories';
|
3
|
+
import { CreeveyStatus, CreeveyUpdate, TestData, TestStatus, StoriesRaw } from '../../types';
|
4
|
+
import { CreeveyClientApi } from '../shared/creeveyClientApi';
|
5
|
+
export declare class CreeveyManager {
|
6
|
+
storybookApi: API;
|
7
|
+
storyId: string;
|
8
|
+
activeBrowser: string;
|
9
|
+
selectedTestId: string;
|
10
|
+
status: CreeveyStatus;
|
11
|
+
creeveyApi: CreeveyClientApi | null;
|
12
|
+
stories: StoriesRaw;
|
13
|
+
updateStatusListeners: Array<(update: CreeveyUpdate) => void>;
|
14
|
+
changeTestListeners: Array<(testId: string) => void>;
|
15
|
+
constructor(storybookApi: API);
|
16
|
+
initAll: () => Promise<void>;
|
17
|
+
onUpdateStatus(listener: (update: CreeveyUpdate) => void): () => void;
|
18
|
+
onChangeTest(listener: (testId: string) => void): () => void;
|
19
|
+
handleCreeveyUpdate: (update: CreeveyUpdate) => void;
|
20
|
+
getCurrentTest: () => TestData | undefined;
|
21
|
+
onStoryRendered: (storyId: string) => void;
|
22
|
+
onStart: () => void;
|
23
|
+
onStop: () => void;
|
24
|
+
onImageApprove: (id: string, retry: number, image: string) => void;
|
25
|
+
onStartAllStoryTests: () => void;
|
26
|
+
onStartAllTests: () => void;
|
27
|
+
onSetStories: (data: SetStoriesPayload) => void;
|
28
|
+
setActiveBrowser: (browser: string) => void;
|
29
|
+
setSelectedTestId: (testId: string) => void;
|
30
|
+
getStoryTests: (storyId: string) => TestData[];
|
31
|
+
getBrowsers: () => string[];
|
32
|
+
getTestsByStoryIdAndBrowser: (browser: string) => TestData[];
|
33
|
+
getTabTitle: (browser: string) => string;
|
34
|
+
setPanelsTitle: () => void;
|
35
|
+
addStatusesToSideBar(): Promise<void>;
|
36
|
+
addStatusToStoryName(name: string, status: TestStatus | undefined, skip: string | boolean): string;
|
37
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { CreeveyManager } from '../Manager';
|
2
|
-
interface AddonProps {
|
3
|
-
active?: boolean;
|
4
|
-
browser: string;
|
5
|
-
manager: CreeveyManager;
|
6
|
-
}
|
7
|
-
export declare const Addon: ({ active, browser, manager }: AddonProps) => JSX.Element | null;
|
8
|
-
export {};
|
1
|
+
import { CreeveyManager } from '../Manager';
|
2
|
+
interface AddonProps {
|
3
|
+
active?: boolean;
|
4
|
+
browser: string;
|
5
|
+
manager: CreeveyManager;
|
6
|
+
}
|
7
|
+
export declare const Addon: ({ active, browser, manager }: AddonProps) => JSX.Element | null;
|
8
|
+
export {};
|
@@ -1,7 +1,7 @@
|
|
1
|
-
interface IconProps {
|
2
|
-
width?: number;
|
3
|
-
height?: number;
|
4
|
-
}
|
5
|
-
export declare const NextIcon: ({ width, height }: IconProps) => JSX.Element;
|
6
|
-
export declare const ForwardIcon: ({ width, height }: IconProps) => JSX.Element;
|
7
|
-
export {};
|
1
|
+
interface IconProps {
|
2
|
+
width?: number;
|
3
|
+
height?: number;
|
4
|
+
}
|
5
|
+
export declare const NextIcon: ({ width, height }: IconProps) => JSX.Element;
|
6
|
+
export declare const ForwardIcon: ({ width, height }: IconProps) => JSX.Element;
|
7
|
+
export {};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { TestData } from '../../../types';
|
2
|
-
interface PanelProps {
|
3
|
-
tests: TestData[];
|
4
|
-
selectedTestId: string;
|
5
|
-
onChangeTest: (testId: string) => void;
|
6
|
-
onImageApprove: (id: string, retry: number, image: string) => void;
|
7
|
-
}
|
8
|
-
export declare const Panel: ({ tests, selectedTestId, onChangeTest, onImageApprove }: PanelProps) => JSX.Element;
|
9
|
-
export {};
|
1
|
+
import { TestData } from '../../../types';
|
2
|
+
interface PanelProps {
|
3
|
+
tests: TestData[];
|
4
|
+
selectedTestId: string;
|
5
|
+
onChangeTest: (testId: string) => void;
|
6
|
+
onImageApprove: (id: string, retry: number, image: string) => void;
|
7
|
+
}
|
8
|
+
export declare const Panel: ({ tests, selectedTestId, onChangeTest, onImageApprove }: PanelProps) => JSX.Element;
|
9
|
+
export {};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { TestData } from '../../../types';
|
3
|
-
interface TestSelectProps {
|
4
|
-
tests: TestData[];
|
5
|
-
selectedTestId: string;
|
6
|
-
onChangeTest: (testId: string) => void;
|
7
|
-
}
|
8
|
-
export default function TestSelect(props: TestSelectProps): JSX.Element;
|
9
|
-
export {};
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TestData } from '../../../types';
|
3
|
+
interface TestSelectProps {
|
4
|
+
tests: TestData[];
|
5
|
+
selectedTestId: string;
|
6
|
+
onChangeTest: (testId: string) => void;
|
7
|
+
}
|
8
|
+
export default function TestSelect(props: TestSelectProps): JSX.Element;
|
9
|
+
export {};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CreeveyManager } from '../Manager';
|
2
|
-
interface ToolsProps {
|
3
|
-
manager: CreeveyManager;
|
4
|
-
}
|
5
|
-
export declare const Tools: ({ manager }: ToolsProps) => JSX.Element | null;
|
6
|
-
export {};
|
1
|
+
import { CreeveyManager } from '../Manager';
|
2
|
+
interface ToolsProps {
|
3
|
+
manager: CreeveyManager;
|
4
|
+
}
|
5
|
+
export declare const Tools: ({ manager }: ToolsProps) => JSX.Element | null;
|
6
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
export declare const decorators: import("@storybook/addons").MakeDecoratorResult[];
|
1
|
+
export declare const decorators: import("@storybook/addons").MakeDecoratorResult[];
|
@@ -1,22 +1,24 @@
|
|
1
|
-
/// <reference types="webpack-dev-server" />
|
2
|
-
import { Configuration } from 'webpack';
|
3
|
-
export declare function config(entry?: string[]): string[];
|
4
|
-
export declare function managerEntries(entry?: string[]): string[];
|
5
|
-
declare global {
|
6
|
-
const
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
/// <reference types="webpack-dev-server" />
|
2
|
+
import { Configuration } from 'webpack';
|
3
|
+
export declare function config(entry?: string[]): string[];
|
4
|
+
export declare function managerEntries(entry?: string[]): string[];
|
5
|
+
declare global {
|
6
|
+
const __CREEVEY_SERVER_HOST__: string;
|
7
|
+
const __CREEVEY_SERVER_PORT__: number;
|
8
|
+
const __CREEVEY_CLIENT_PORT__: number | null;
|
9
|
+
}
|
10
|
+
export interface CreeveyAddonOptions {
|
11
|
+
creeveyConfigPath?: string;
|
12
|
+
creeveyPreExtract?: string;
|
13
|
+
creeveyHost?: string;
|
14
|
+
creeveyPort?: number;
|
15
|
+
clientPort?: number;
|
16
|
+
configType: string;
|
17
|
+
configDir: string;
|
18
|
+
outputDir: string;
|
19
|
+
skipExtract?: boolean;
|
20
|
+
presets?: {
|
21
|
+
apply: <T>(preset: string) => Promise<T | undefined>;
|
22
|
+
};
|
23
|
+
}
|
24
|
+
export declare function managerWebpack(config: Configuration, options: CreeveyAddonOptions): Promise<Configuration>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { API } from '@storybook/api';
|
2
|
-
export declare const ADDON_ID = "creevey";
|
3
|
-
export declare function registerCreeveyPanels(storybookApi: API): Promise<void>;
|
1
|
+
import { API } from '@storybook/api';
|
2
|
+
export declare const ADDON_ID = "creevey";
|
3
|
+
export declare function registerCreeveyPanels(storybookApi: API): Promise<void>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { TestStatus } from '../../types';
|
2
|
-
export declare function getEmojiByTestStatus(status: TestStatus | undefined, skip?: string | boolean): string;
|
1
|
+
import { TestStatus } from '../../types';
|
2
|
+
export declare function getEmojiByTestStatus(status: TestStatus | undefined, skip?: string | boolean): string;
|
@@ -1,13 +1,24 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
import type { PreviewWeb } from '@storybook/preview-web';
|
2
|
+
import type { AnyFramework } from '@storybook/csf';
|
3
|
+
import type { StoryStore } from '@storybook/client-api';
|
4
|
+
import { MakeDecoratorResult, Channel } from '@storybook/addons';
|
5
|
+
import { CaptureOptions, StoriesRaw, StorybookGlobals } from '../../types';
|
6
|
+
declare global {
|
7
|
+
interface Window {
|
8
|
+
__CREEVEY_SERVER_HOST__: string;
|
9
|
+
__CREEVEY_SERVER_PORT__: number;
|
10
|
+
__CREEVEY_WORKER_ID__: number;
|
11
|
+
__CREEVEY_GET_STORIES__: () => Promise<StoriesRaw | void>;
|
12
|
+
__CREEVEY_SELECT_STORY__: (storyId: string, kind: string, name: string, shouldWaitForReady: boolean, callback: (response: [error?: string | null, isCaptureCalled?: boolean]) => void) => void;
|
13
|
+
__CREEVEY_UPDATE_GLOBALS__: (globals: StorybookGlobals) => void;
|
14
|
+
__CREEVEY_INSERT_IGNORE_STYLES__: (ignoreElements: string[]) => HTMLStyleElement;
|
15
|
+
__CREEVEY_REMOVE_IGNORE_STYLES__: (ignoreStyles: HTMLStyleElement) => void;
|
16
|
+
__CREEVEY_HAS_PLAY_COMPLETED_YET__: (callback: (isPlayCompleted: boolean) => void) => void;
|
17
|
+
__CREEVEY_SET_READY_FOR_CAPTURE__?: () => void;
|
18
|
+
__STORYBOOK_ADDONS_CHANNEL__: Channel;
|
19
|
+
__STORYBOOK_STORY_STORE__: StoryStore<AnyFramework>;
|
20
|
+
__STORYBOOK_PREVIEW__: PreviewWeb<AnyFramework>;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
export declare function withCreevey(): MakeDecoratorResult;
|
24
|
+
export declare function capture(options?: CaptureOptions): Promise<void>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
-
export declare const BlendView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
1
|
+
import React from 'react';
|
2
|
+
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
+
export declare const BlendView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
@@ -1,25 +1,25 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { Images, ImagesViewMode } from '../../../../types';
|
3
|
-
import { Theme } from '@storybook/theming';
|
4
|
-
export declare const themeBorderColors: {
|
5
|
-
actual: string;
|
6
|
-
expect: string;
|
7
|
-
diff: string;
|
8
|
-
};
|
9
|
-
export declare function getBorderColor(theme: Theme, color: string): string;
|
10
|
-
interface ViewProps {
|
11
|
-
actual: string;
|
12
|
-
diff: string;
|
13
|
-
expect: string;
|
14
|
-
}
|
15
|
-
export interface ViewPropsWithTheme extends ViewProps {
|
16
|
-
theme: Theme;
|
17
|
-
}
|
18
|
-
interface ImagesViewProps {
|
19
|
-
url: string;
|
20
|
-
image: Images;
|
21
|
-
canApprove: boolean;
|
22
|
-
mode: ImagesViewMode;
|
23
|
-
}
|
24
|
-
export declare function ImagesView({ url, image, canApprove, mode }: ImagesViewProps): JSX.Element;
|
25
|
-
export {};
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Images, ImagesViewMode } from '../../../../types';
|
3
|
+
import { Theme } from '@storybook/theming';
|
4
|
+
export declare const themeBorderColors: {
|
5
|
+
actual: string;
|
6
|
+
expect: string;
|
7
|
+
diff: string;
|
8
|
+
};
|
9
|
+
export declare function getBorderColor(theme: Theme, color: string): string;
|
10
|
+
interface ViewProps {
|
11
|
+
actual: string;
|
12
|
+
diff: string;
|
13
|
+
expect: string;
|
14
|
+
}
|
15
|
+
export interface ViewPropsWithTheme extends ViewProps {
|
16
|
+
theme: Theme;
|
17
|
+
}
|
18
|
+
interface ImagesViewProps {
|
19
|
+
url: string;
|
20
|
+
image: Images;
|
21
|
+
canApprove: boolean;
|
22
|
+
mode: ImagesViewMode;
|
23
|
+
}
|
24
|
+
export declare function ImagesView({ url, image, canApprove, mode }: ImagesViewProps): JSX.Element;
|
25
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
-
export declare const SideBySideView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
1
|
+
import React from 'react';
|
2
|
+
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
+
export declare const SideBySideView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
-
export declare const SlideView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
1
|
+
import React from 'react';
|
2
|
+
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
+
export declare const SlideView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
-
export declare const SwapView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
1
|
+
import React from 'react';
|
2
|
+
import { ViewPropsWithTheme } from './ImagesView';
|
3
|
+
export declare const SwapView: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ViewPropsWithTheme, "theme">>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export { ImagesView } from './ImagesView';
|
2
|
-
export { BlendView } from './BlendView';
|
3
|
-
export { SideBySideView } from './SideBySideView';
|
4
|
-
export { SlideView } from './SlideView';
|
5
|
-
export { SwapView } from './SwapView';
|
1
|
+
export { ImagesView } from './ImagesView';
|
2
|
+
export { BlendView } from './BlendView';
|
3
|
+
export { SideBySideView } from './SideBySideView';
|
4
|
+
export { SlideView } from './SlideView';
|
5
|
+
export { SwapView } from './SwapView';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
export interface PageFooterProps {
|
3
|
-
canApprove: boolean;
|
4
|
-
retriesCount: number;
|
5
|
-
retry: number;
|
6
|
-
onRetryChange: (retry: number) => void;
|
7
|
-
onApprove: () => void;
|
8
|
-
}
|
9
|
-
export declare function PageFooter({ canApprove, retriesCount, retry, onRetryChange, onApprove, }: PageFooterProps): JSX.Element;
|
1
|
+
/// <reference types="react" />
|
2
|
+
export interface PageFooterProps {
|
3
|
+
canApprove: boolean;
|
4
|
+
retriesCount: number;
|
5
|
+
retry: number;
|
6
|
+
onRetryChange: (retry: number) => void;
|
7
|
+
onApprove: () => void;
|
8
|
+
}
|
9
|
+
export declare function PageFooter({ canApprove, retriesCount, retry, onRetryChange, onApprove, }: PageFooterProps): JSX.Element;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
export interface PagingProps {
|
3
|
-
activePage: number;
|
4
|
-
onPageChange: (pageNumber: number) => void;
|
5
|
-
pagesCount: number;
|
6
|
-
}
|
7
|
-
export declare type ItemType = number | '.' | 'forward';
|
8
|
-
export declare function Paging(props: PagingProps): JSX.Element;
|
1
|
+
/// <reference types="react" />
|
2
|
+
export interface PagingProps {
|
3
|
+
activePage: number;
|
4
|
+
onPageChange: (pageNumber: number) => void;
|
5
|
+
pagesCount: number;
|
6
|
+
}
|
7
|
+
export declare type ItemType = number | '.' | 'forward';
|
8
|
+
export declare function Paging(props: PagingProps): JSX.Element;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Theme } from '@storybook/theming';
|
3
|
-
interface ImageSwapProps {
|
4
|
-
url: string;
|
5
|
-
isActive: boolean;
|
6
|
-
onClick: (imageName: string) => void;
|
7
|
-
imageName: string;
|
8
|
-
theme: Theme;
|
9
|
-
error?: boolean;
|
10
|
-
}
|
11
|
-
export declare const ImagePreview: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ImageSwapProps, "theme">>;
|
12
|
-
export {};
|
1
|
+
import React from 'react';
|
2
|
+
import { Theme } from '@storybook/theming';
|
3
|
+
interface ImageSwapProps {
|
4
|
+
url: string;
|
5
|
+
isActive: boolean;
|
6
|
+
onClick: (imageName: string) => void;
|
7
|
+
imageName: string;
|
8
|
+
theme: Theme;
|
9
|
+
error?: boolean;
|
10
|
+
}
|
11
|
+
export declare const ImagePreview: React.SFC<import("emotion-theming/types/helper").AddOptionalTo<ImageSwapProps, "theme">>;
|
12
|
+
export {};
|
@@ -1,17 +1,17 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { ImagesViewMode, Images } from '../../../../types';
|
3
|
-
interface PageHeaderProps {
|
4
|
-
title: string[];
|
5
|
-
images?: Partial<{
|
6
|
-
[name: string]: Images;
|
7
|
-
}>;
|
8
|
-
errorMessage?: string | null;
|
9
|
-
showViewModes: boolean;
|
10
|
-
showTitle?: boolean;
|
11
|
-
viewMode: ImagesViewMode;
|
12
|
-
imagesWithError?: string[];
|
13
|
-
onImageChange: (name: string) => void;
|
14
|
-
onViewModeChange: (viewMode: ImagesViewMode) => void;
|
15
|
-
}
|
16
|
-
export declare function PageHeader({ title, images, errorMessage, showViewModes, showTitle, viewMode, imagesWithError, onImageChange, onViewModeChange, }: PageHeaderProps): JSX.Element | null;
|
17
|
-
export {};
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ImagesViewMode, Images } from '../../../../types';
|
3
|
+
interface PageHeaderProps {
|
4
|
+
title: string[];
|
5
|
+
images?: Partial<{
|
6
|
+
[name: string]: Images;
|
7
|
+
}>;
|
8
|
+
errorMessage?: string | null;
|
9
|
+
showViewModes: boolean;
|
10
|
+
showTitle?: boolean;
|
11
|
+
viewMode: ImagesViewMode;
|
12
|
+
imagesWithError?: string[];
|
13
|
+
onImageChange: (name: string) => void;
|
14
|
+
onViewModeChange: (viewMode: ImagesViewMode) => void;
|
15
|
+
}
|
16
|
+
export declare function PageHeader({ title, images, errorMessage, showViewModes, showTitle, viewMode, imagesWithError, onImageChange, onViewModeChange, }: PageHeaderProps): JSX.Element | null;
|
17
|
+
export {};
|