@knappi/addon-storyshots-selenium
- BasicHookOptions
- BrowserSpecification
- LifeCycleMethod
- OptionalImageSnapshotOptions
- RequiredImageSnapshotOptions
- StoryParameters
- TestMethod
- TestMethodArgs
- TestMethodContext
- WithImage
- WithSize
- AfterEachScreenshotFunction
- BeforeEachScreenshotFunction
- BeforeFirstScreenshotFunction
- GetMatchOptionsFunction
- GetMatchOptionsOptions
- ImageSnapshotOptions
- InternalImageSnapshotOptions
- VoidAsyncFunction
- WidthXHeightString
Ƭ AfterEachScreenshotFunction: function
Defined in src/types.ts:51
▸ (options
: BasicHookOptions &
WithImage &
WithSize): Promise‹void›
Parameters:
Name | Type |
---|---|
options |
BasicHookOptions & WithImage & WithSize |
Ƭ BeforeEachScreenshotFunction: function
Defined in src/types.ts:42
▸ (driver
: WebDriver, options
:
BasicHookOptions &
WithSize): Promise‹void›
Parameters:
Name | Type |
---|---|
driver |
WebDriver |
options |
BasicHookOptions & WithSize |
Ƭ BeforeFirstScreenshotFunction: function
Defined in src/types.ts:33
▸ (driver
: WebDriver, options
:
BasicHookOptions): Promise‹void›
Parameters:
Name | Type |
---|---|
driver |
WebDriver |
options |
BasicHookOptions |
Ƭ GetMatchOptionsFunction: function
Defined in src/types.ts:57
▸ (options
:
GetMatchOptionsOptions):
Promise‹Partial‹MatchImageSnapshotOptions›› |
Partial‹MatchImageSnapshotOptions›
Parameters:
Name | Type |
---|---|
options |
GetMatchOptionsOptions |
Ƭ GetMatchOptionsOptions: BasicHookOptions & WithSize
Defined in src/types.ts:55
Ƭ ImageSnapshotOptions: Partial‹OptionalImageSnapshotOptions› & RequiredImageSnapshotOptions
Defined in src/types.ts:105
Ƭ InternalImageSnapshotOptions: OptionalImageSnapshotOptions & RequiredImageSnapshotOptions
Defined in src/types.ts:99
Ƭ VoidAsyncFunction: function
Defined in src/public-utils.ts:4
A function that returns a void-promise
▸ (): Promise‹void›
Ƭ WidthXHeightString: string
Defined in src/types.ts:25
String of the form "1000x800"
• sectionDebug: SectionDebug = createSectionDebug(createDebug("addon-storyshots-selenium:index"))
Defined in src/index.ts:18
▸ doNothing(): VoidAsyncFunction
Defined in src/public-utils.ts:20
returns an async function that resolves immediately, without doing anything.
Returns: VoidAsyncFunction
▸ imageSnapshot(options
:
ImageSnapshotOptions):
TestMethod
Defined in src/index.ts:33
Create and compare image snapshots as part of the storyshots addon.
The resulting function has beforeAll
and afterAll
-hooks attached.
Althogether, the following process will be performed:
- Setup selenium-drivers for all specified browsers
- For all drivers in parallel, perform the following steps:
- Iterate through the stories. For each story
- open the story in the browser
- resize the browser to the specified window sizes
- take a screenshot of the window
- compare the screenshot to the baseline-version in the project.
- Iterate through the stories. For each story
- Close down all drivers.
Parameters:
Name | Type |
---|---|
options |
ImageSnapshotOptions |
Returns: TestMethod
▸ waitMillis(millis
: number):
VoidAsyncFunction
Defined in src/public-utils.ts:13
Returns a async function that resolves after the specified time in milliseconds.
This function can be used to configure a delay in the
Before*Screenshot
hooks.
Parameters:
Name | Type | Description |
---|---|---|
millis |
number | the number of milliseconds |
Returns: VoidAsyncFunction