CompareSnapshot: CompareSnapshot

View source: R/comparesnapshot.R

CompareSnapshotR Documentation

CompareSnapshot

Description

Takes snapshot of a widget and compares it against another snapshot.

Usage

CompareSnapshot(
  widget,
  diff.file,
  accepted.file,
  delay = 0.2,
  threshold = 0.1,
  strict = FALSE,
  ...
)

Arguments

widget

The htmlwidget to display.

diff.file

Character; the name of the snapshot file taken. Only saved if there is a difference.

accepted.file

Character; the name of the snapshot to be compared against. If this file does not exist, it will be created from a snapshot of the widget.

delay

Time to wait before taking screenshot, in seconds. Sometimes a longer delay is needed for all assets to display properly.

threshold

Similarity parameter for comparing screenshots.

strict

Whether to give warning if accepted.file does not exist.

...

Other parameters passed to CreateSnapshot.

Value

Return FALSE only if the snapshot of the widget differs from the accepted snapshot (i.e. returns TRUE when the accepted snapshot does not exist). The diff.file is only created if FALSE is returned otherwise the snapshot will be saved as accepted.file.


Displayr/flipChartTests documentation built on Feb. 23, 2024, 9:36 p.m.