API Docs for: 0.2.7
Show:

BlinkDiffComparison Class

Module: Helpers
Parent Module: WebDriver

Blink-Diff comparison object

Constructor

BlinkDiffComparison

(
  • driver
)

Parameters:

Methods

_getApprovedImagePath

(
  • title
  • [id=1]
)
String private

Gets the approved path for the current image

Parameters:

  • title String

    Unique title of image

  • [id=1] String optional

    Unique identifier for multiple images with the same title

Returns:

_getBaseName

(
  • title
  • id
)
String private

Gets the name of the file-base, converting unique identifiers to filename safe strings

Parameters:

  • title String

    Unique title of image

  • id String

    Unique identifier for multiple images with the same title

Returns:

_getBuildImagePath

(
  • title
  • [id=1]
)
String private

Gets the build path for the current image

Parameters:

  • title String

    Unique title of image

  • [id=1] String optional

    Unique identifier for multiple images with the same title

Returns:

_getDiffImagePath

(
  • title
  • [id=1]
)
String private

Gets the difference path for the current image

Parameters:

  • title String

    Unique title of image

  • [id=1] String optional

    Unique identifier for multiple images with the same title

Returns:

_getFolderName

() String private

Gets the name of the browser folder, categorizing screenshots from the same browser + platform

Returns:

_logMethodCall

(
  • event
)
private

Logs a method call by an event

Parameters:

_needsApprovedSuffix

() Boolean private

Checks if a filename suffix is required for the approved folder

Note: This is only true if multiple file-types end up in the same folder

Returns:

_needsBuildSuffix

() Boolean private

Checks if a filename suffix is required for the build folder

Note: This is only true if multiple file-types end up in the same folder

Returns:

_needsDiffSuffix

() Boolean private

Checks if a filename suffix is required for the diff folder

Note: This is only true if multiple file-types end up in the same folder

Returns:

_prepareFolders

() private

Prepares all of the folders, creating them if needed

_requestJSON

(
  • method
  • path
  • [body]
)
private

Performs a context dependent JSON request for the current session. The result is parsed for errors.

Parameters:

Returns:

:

_saveBlob

(
  • filePath
  • blob
)
private

Saves a blob to the filesystem

Parameters:

compare

(
  • title
  • imageBlob
  • [options]
)

Compares a specific screenshot

Parameters:

  • title String

    Unique title of image

  • imageBlob Buffer

    Image buffer of current screenshot

  • [options] Object optional

    Comparison options

getApprovedPath

() String

Gets the path where approved screenshots are found

Returns:

getBuildPath

() String

Gets the path where current screenshots will be written to

Returns:

getDiffPath

() String

Gets the path where differences will be written to

Returns:

getDriver

() Driver

Gets the driver object. Direct-access. No need to wait.

Returns:

getOptions

() Object

Gets the default comparison options

Returns:

setup

()

Setup of comparison

shouldAutoApprove

() Boolean

Should screenshot be auto-approved?

Returns:

shouldBatchFailures

() Boolean

Batch failures until the end?

Returns:

shouldFailOnAdditions

() Boolean

Should comparison fail on additions?

Returns:

shouldFailOnDifference

() Boolean

Should an exception be thrown when there are differences?

Returns:

shouldOutputOnSuccess

() Boolean

Should an output be created when comparison is successful?

Returns:

tearDown

()

Tear-down of comparison