Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,23 @@ private static boolean checkIfImagesMatch(String elementName, boolean negate, St

//Write result to disk
boolean didTheyMatch = comparisonResult.getImageComparisonState() == ImageComparisonState.MATCH;
if(didTheyMatch == negate) {
if(didTheyMatch == negate)
FileManager.saveImage(outputFolder, failureImageName, comparisonResult.getResult());
}
else {
else
FileManager.saveImage(outputFolder, passedImageName, comparisonResult.getResult());

boolean debugBoolean = Configuration.toBoolean("debug");
if(debugBoolean) {
try {
FileManager.saveImage(outputFolder, imageId + "_" + "EXPECTED" + ".png", comparisonImage);
FileManager.saveImage(outputFolder, imageId + "_" + "ACTUAL" + ".png", currentStateImage);
}
catch(Exception e) {
String errorMessage = SentinelStringUtils.format("Debug mode was enabled, but an exception occurred parsing the setting. Ensure the passed value is 'true' or 'false'. Passed value {}. Exception {}", debugBoolean, e.getMessage());
log.error(errorMessage);
}
}

return didTheyMatch;
}

Expand Down