Skip to content

Latest commit

 

History

History
268 lines (174 loc) · 8.09 KB

README.md

File metadata and controls

268 lines (174 loc) · 8.09 KB

@knappi/addon-storyshots-selenium

@knappi/addon-storyshots-selenium

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

AfterEachScreenshotFunction

Ƭ AfterEachScreenshotFunction: function

Defined in src/types.ts:51

Type declaration:

▸ (options: BasicHookOptions & WithImage & WithSize): Promise‹void›

Parameters:

Name Type
options BasicHookOptions & WithImage & WithSize

BeforeEachScreenshotFunction

Ƭ BeforeEachScreenshotFunction: function

Defined in src/types.ts:42

Type declaration:

▸ (driver: WebDriver, options: BasicHookOptions & WithSize): Promise‹void›

Parameters:

Name Type
driver WebDriver
options BasicHookOptions & WithSize

BeforeFirstScreenshotFunction

Ƭ BeforeFirstScreenshotFunction: function

Defined in src/types.ts:33

Type declaration:

▸ (driver: WebDriver, options: BasicHookOptions): Promise‹void›

Parameters:

Name Type
driver WebDriver
options BasicHookOptions

GetMatchOptionsFunction

Ƭ GetMatchOptionsFunction: function

Defined in src/types.ts:57

Type declaration:

▸ (options: GetMatchOptionsOptions): Promise‹Partial‹MatchImageSnapshotOptions›› | Partial‹MatchImageSnapshotOptions›

Parameters:

Name Type
options GetMatchOptionsOptions

GetMatchOptionsOptions

Ƭ GetMatchOptionsOptions: BasicHookOptions & WithSize

Defined in src/types.ts:55


ImageSnapshotOptions

Ƭ ImageSnapshotOptions: Partial‹OptionalImageSnapshotOptions› & RequiredImageSnapshotOptions

Defined in src/types.ts:105


InternalImageSnapshotOptions

Ƭ InternalImageSnapshotOptions: OptionalImageSnapshotOptions & RequiredImageSnapshotOptions

Defined in src/types.ts:99


VoidAsyncFunction

Ƭ VoidAsyncFunction: function

Defined in src/public-utils.ts:4

A function that returns a void-promise

Type declaration:

▸ (): Promise‹void›


WidthXHeightString

Ƭ WidthXHeightString: string

Defined in src/types.ts:25

String of the form "1000x800"

Variables

Const sectionDebug

sectionDebug: SectionDebug = createSectionDebug(createDebug("addon-storyshots-selenium:index"))

Defined in src/index.ts:18

Functions

doNothing

doNothing(): VoidAsyncFunction

Defined in src/public-utils.ts:20

returns an async function that resolves immediately, without doing anything.

Returns: VoidAsyncFunction


imageSnapshot

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.
  • Close down all drivers.

Parameters:

Name Type
options ImageSnapshotOptions

Returns: TestMethod


waitMillis

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