-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Description
The documentation says:
Note: seeVisualDiff and seeVisualDiffElement work only when the dimensions of the
screenshot as well as the base image are same so as to avoid unexpected results.
which is found in the code
codeceptjs-resemblehelper/index.js
Lines 79 to 83 in 3d9974d
if (!data.isSameDimensions) { | |
let dimensions1 = sizeOf(baseImage); | |
let dimensions2 = sizeOf(actualImage); | |
reject(new Error(`The base image is of ${dimensions1.height} X ${dimensions1.width} and actual image is of ${dimensions2.height} X ${dimensions2.width}. Please use images of same dimensions so as to avoid any unexpected results.`)); | |
} |
However the underlying resemble.js works just fine in calculating the diff percentage and tolerance and taking that into account.
I propose to make this check optional and thus introduce an option/parameter to skip that check
Background:
We use visual regression testing for webpages and as we allow some tolerance for minor layout changes. But this could also make a full page screenshot some few pixel longer.
This should be able to fail the test (as is the state now), but in fact only with 0 tolerance. However if you have a tolerance defined, tests should be able to run fine nevertheless if the change is within the tolerance.
Metadata
Metadata
Assignees
Labels
No labels