UNPKG

creevey

Version:

Cross-browser screenshot testing tool for Storybook with fancy UI Runner

39 lines (38 loc) 1.77 kB
import { API } from '@storybook/api'; import { denormalizeStoryParameters } from '../../shared/index.js'; import { CreeveyStatus, CreeveyUpdate, TestData, TestStatus, StoriesRaw } from '../../types.js'; import { CreeveyClientApi } from '../shared/creeveyClientApi.js'; export declare const ADDON_ID = "creevey"; export declare class CreeveyController { storybookApi: API; storyId: string; activeBrowser: string; selectedTestId: string; status: CreeveyStatus; creeveyApi: CreeveyClientApi | null; stories: StoriesRaw; updateStatusListeners: ((update: CreeveyUpdate) => void)[]; changeTestListeners: ((testId: string) => void)[]; constructor(storybookApi: API); initAll: () => Promise<void>; onUpdateStatus(listener: (update: CreeveyUpdate) => void): () => void; onChangeTest(listener: (testId: string) => void): () => void; handleCreeveyUpdate: (update: CreeveyUpdate) => void; getCurrentTest: () => TestData | undefined; onStoryRendered: (storyId: string) => void; onStart: () => void; onStop: () => void; onImageApprove: (id: string, retry: number, image: string) => void; onStartAllStoryTests: () => void; onStartAllTests: () => void; onSetStories: (data: Parameters<typeof denormalizeStoryParameters>["0"]) => void; setActiveBrowser: (browser: string) => void; setSelectedTestId: (testId: string) => void; getStoryTests: (storyId: string) => TestData[]; getBrowsers: () => string[]; getTestsByStoryIdAndBrowser: (browser: string) => TestData[]; getTabTitle: (browser: string) => string; setPanelsTitle: () => void; addStatusesToSideBar(): void; addStatusToStoryName(name: string, status: TestStatus | undefined, skip: string | boolean): string; }