-
Notifications
You must be signed in to change notification settings - Fork 5
Helper Configuration
The only required option is the require
value, which is always "codeceptjs-pixelmatchhelper"
. The other configuration values are optional. Here is a full list of supported items:
helpers: {
PixelmatchHelper: {
require: "codeceptjs-pixelmatchhelper", // Mandatory and static!
dirExpected: "./tests/screenshots/base/", // Optional but recommended.
dirDiff: "./tests/screenshots/diff/", // Optional but recommended.
dirActual: "./tests/output/", // Optional.
diffPrefix: "Diff_", // Optional.
tolerance: 2.5, // Optional.
threshold: 0.05, // Optional.
dumpIntermediateImage: true // Optional.
}
}
Folder that contains the expected base images. Those base images are usually generated once from a stable website/app and are rarely updated.
Defaults to "./tests/screenshots/base/"
Folder that receives the diff-images for all comparison where the matching fails. The diff-folder is an output folder; any files in this folder can potentially be overwritten. Only failed tests generate a diff-image.
Defaults to "./tests/screenshots/diff/"
Folder that holds the actual screenshots that should be tested against an expected base images. The actual screenshot are usually generated fresh for every test.
Defaults to global.output_dir
You can define a custom prefix for diff-images with this option.
Defaults to "Diff_"
The default tolerance for all comparisons. This value can always be overwritten for a single comparison using the options
object (see below). The tolerance can be a float value between 0 and 100.
Defaults to 0
The default threshold for all comparisons. This value can always be overwritten for a single comparison using the options
object (see below). The tolerance can be a float value between 0 and 1.
Defaults to 0.1
Whether to save the intermediate images to the global output folder, after applying the bounds and ignore-boxes. This value can always be overwritten for a single comparison using the options
object (see below).
This is useful for debugging your tests, but not recommended for production usage.
Defaults to false
Manual
Methods
Data Structures
Appendix
Development