Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScreenCheck

Hierarchy

  • ScreenCheck

Index

Properties

Static taiko

taiko: Taiko

The taiko exported API

Methods

Static compareImages

  • compareImages(left: string | Buffer, right: string | Buffer): Promise<{ diffImage: PNG; missmatching: number }>
  • Compares PNG data and returns a diff PNG (with pngjs) and count of missmatching pixels.

    Parameters

    • left: string | Buffer

      reference PNG data buffer

    • right: string | Buffer

      new PNG data buffer

    Returns Promise<{ diffImage: PNG; missmatching: number }>

Static detectLatestAutoRunIdIndex

  • detectLatestAutoRunIdIndex(): number
  • Determines the latest run index. Useful when using default setup data.

    Returns number

Static generateName

  • generateName(taiko: Taiko, fullPage?: boolean, ...args: TaikoSearchElement[]): Promise<string>
  • Generates a name for a unique name for a screenshot.

    Parameters

    • taiko: Taiko

      an instance of taiko

    • Default value fullPage: boolean = false

      if true is capture of whole page

    • Rest ...args: TaikoSearchElement[]

      taiko screenshot search elements

    Returns Promise<string>

Static Protected getRefDir

  • getRefDir(): string
  • Returns the absolute path of the reference run input directory.

    Returns string

Static getReferenceImagePath

  • getReferenceImagePath(current: string): Promise<string | undefined>
  • Returns the absolute path of the reference image corresponding to the given current image relative path.

    Parameters

    • current: string

      the path of the new image for which a reference image is required

    Returns Promise<string | undefined>

Static Protected getRunDir

  • getRunDir(): string
  • Returns the absolute path of the run output directory.

    Returns string

Static init

  • init(taiko: Taiko): void
  • The entrypoint for the taiko plugin. Should be called explicitly only when imported programmatically.

    entrypoint

    Parameters

    • taiko: Taiko

      taiko exported API

    Returns void

Static isContainerEnvironment

  • isContainerEnvironment(): boolean
  • Detect if execution is inside a container environment.

    remarks

    Exposed as isContainerEnvironment in taiko CLI

    Returns boolean

Static latestRunId

  • latestRunId(): string
  • Latest run. This value determines the relative directory from which to load reference data when default setup is used.

    Returns string

Static nextRunId

  • nextRunId(): string
  • Current run. This value determines the relative directory to store data when default setup is used.

    Returns string

Static openBrowser

  • openBrowser(options?: any, useOriginalCall?: Boolean): Promise<void>
  • opens the browser, ensuring renderer pixel ratio is 1:1 to display device

    Parameters

    • Default value options: any = {}

      taiko openBrowser options

    • Default value useOriginalCall: Boolean = false

      use default arguments when launching chromium, otherwise forces 1:1 pixel ratio (default)

    Returns Promise<void>

Static screencheck

  • screencheck(options?: TaikoScreenshotOptions, ...args: TaikoSearchElement[]): Promise<ScreenCheckResult>
  • The screencheck method that is intended to replace the taiko builtin screenshot method. This method is exported to the taiko CLI

    cli

    screencheck()

    Parameters

    • Optional options: TaikoScreenshotOptions

      taiko screenshot options.

    • Rest ...args: TaikoSearchElement[]

      taiko search elements

    Returns Promise<ScreenCheckResult>

Static setup

Static simplifyPath

  • simplifyPath(path: string): string
  • Removes structure from a file path to flatten it to a filename. e.g. /foo/bar/buzz.zip becomes foo-bar-buzz-zip

    Parameters

    • path: string

      a file path to simplify

    Returns string

Generated using TypeDoc