@@ -29,7 +29,10 @@ class ResembleHelper extends Helper {
29
29
async _compareImages ( image1 , image2 , diffImage , options ) {
30
30
image1 = this . config . baseFolder + image1 ;
31
31
image2 = this . config . screenshotFolder + image2 ;
32
-
32
+ if ( typeof this . config . consoleOutput == 'undefined' )
33
+ {
34
+ this . config . consoleOutput = true
35
+ }
33
36
return new Promise ( ( resolve , reject ) => {
34
37
if ( options . boundingBox !== undefined )
35
38
{
@@ -38,15 +41,15 @@ class ResembleHelper extends Helper {
38
41
} ) ;
39
42
}
40
43
41
- if ( options . tolerance !== undefined )
44
+ if ( options . tolerance !== undefined && this . config . consoleOutput )
42
45
{
43
46
console . log ( "Tolerance Level Provided " + options . tolerance ) ;
44
47
var tolerance = options . tolerance ;
45
48
}
46
- resemble . compare ( image1 , image2 , options , ( err , data ) => {
49
+ resemble . compare ( image1 , image2 , options , ( err , data ) => {
47
50
if ( err ) {
48
51
reject ( err ) ;
49
- } else {
52
+ } else {
50
53
resolve ( data ) ;
51
54
if ( data . misMatchPercentage >= tolerance ) {
52
55
mkdirp ( getDirName ( this . config . diffFolder + diffImage ) , function ( err ) {
@@ -98,7 +101,9 @@ class ResembleHelper extends Helper {
98
101
}
99
102
100
103
var misMatch = await this . _fetchMisMatchPercentage ( baseImage , options ) ;
101
- console . log ( "MisMatch Percentage Calculated is " + misMatch ) ;
104
+ if ( this . config . consoleOutput ) {
105
+ console . log ( "MisMatch Percentage Calculated is " + misMatch ) ;
106
+ }
102
107
assert ( misMatch <= options . tolerance , "MissMatch Percentage " + misMatch ) ;
103
108
}
104
109
0 commit comments