Skip to content

Commit

Permalink
if no prompt and baseline override settings is provided, always save …
Browse files Browse the repository at this point in the history
…the latest and diff screenshots
  • Loading branch information
enriquecastl committed Oct 8, 2017
1 parent 2205b1e commit c60761c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/compare-with-baseline.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = function compareWithBaseline(
completeDiffPath,
diff.image
), resolve)
.then(() => promptScreenshotOverride(
.then(() => (
completeLatestPath,
completeBaselinePath,
completeDiffPath
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c60761c

Please sign in to comment.