diff --git a/lib/compare-with-baseline.js b/lib/compare-with-baseline.js index 9752464..e864773 100644 --- a/lib/compare-with-baseline.js +++ b/lib/compare-with-baseline.js @@ -70,7 +70,7 @@ module.exports = function compareWithBaseline( completeDiffPath, diff.image ), resolve) - .then(() => promptScreenshotOverride( + .then(() => ( completeLatestPath, completeBaselinePath, completeDiffPath @@ -98,6 +98,23 @@ module.exports = function compareWithBaseline( resolve(true) }) .catch(() => resolve(false)) + } else if (!identical && !prompt && !always_save_diff_screenshot) { + saveScreenshot( + completeLatestPath, + screenshot + ) + .then(() => saveScreenshot( + completeDiffPath, + diff.image + ), resolve) + .then(() => ( + completeLatestPath, + completeBaselinePath, + completeDiffPath + ), resolve) + .then( + resolve + ) } else if (identical) { // Cleanup here in case user fixed bug and reran tests cleanupScreenshots(