Skip to content

Commit 76bfbc0

Browse files
author
Nils Langner
committed
Using devition in percent in failure message
1 parent b7df280 commit 76bfbc0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module/VisualCeption.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ public function compareScreenshot ($identifier, $elementID = null)
112112

113113
$this->debug($compareResult);
114114

115-
if ($compareResult[1] > $this->maximumDeviation) {
115+
$deviation = round($compareResult[1] * 100, 2);
116+
117+
if ($deviation > $this->maximumDeviation) {
116118
$compareScreenshotPath = $this->getDeviationScreenshotPath($identifier);
117119
$compareResult[0]->writeImage($compareScreenshotPath);
118-
$this->assertTrue(false, "The deviation of the taken screenshot is too high. See $compareScreenshotPath for a deviation screenshot.");
120+
$this->assertTrue(false, "The deviation of the taken screenshot is too high (".$deviation."%).\nSee $compareScreenshotPath for a deviation screenshot.");
119121
}
120122
}
121123

0 commit comments

Comments
 (0)