When using the exposed checkDocument function only the viewport is taken a screenshot of. I would expect this to take a screenshot of the entire page so that I can check if visual regressions are present past the end of the current viewport. Instead this function seems to behave the same as checkViewport. Checking the source seems to confirm this.
Here's some sample code from my step definition (Cucumber) for ensuring the document hasn't visually regressed:
/**
* Check the screenshot of the page against the existing baseline
* @param {Function} done Function to execute when finished
*/
module.exports = (done) => {
const results = browser.checkDocument();
results.forEach((result) => {
expect(result.isWithinMisMatchTolerance).to.be.true;
});
done();
};
This works for the viewport but doesn't check changes beyond its boundary.
When using the exposed
checkDocument
function only the viewport is taken a screenshot of. I would expect this to take a screenshot of the entire page so that I can check if visual regressions are present past the end of the current viewport. Instead this function seems to behave the same ascheckViewport
. Checking the source seems to confirm this.Here's some sample code from my step definition (Cucumber) for ensuring the document hasn't visually regressed:
This works for the viewport but doesn't check changes beyond its boundary.