Skip to content

Comparison Results

Philipp Stracker edited this page Aug 12, 2021 · 5 revisions

Both methods checkVisualDifferences() and getVisualDifferences() return a Promise that resolves to the following "comparison results" object:

match

(boolean) - Whether the differences are within the allowed tolerance level.

diffImage

(string) - Filename of the diff-file.

diffPixels

(int) - Absolute count of different pixels.

totalPixels

(int) - Absolute count of all pixels inside the image.

relevantPixels

(int) - Absolute count of pixels, that are not ignored and inside the bounds-area.

difference

(float) - Relative difference between both images. The percentage is calculated from the diffPixels and relevantPixels values.

Sample

const res = await I.getVisualDifferences("dashboard");

console.log('Match: ', res.match);
console.log('Diff-Image: ', res.diffImage);
console.log('Diff Pixels: ', res.diffPixels);
console.log('Total Pixels: ', res.totalPixels);
console.log('Relevant Pixels: ', res.relevantPixels);
console.log('Difference: ', res.difference);
Clone this wiki locally