File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,6 @@ node_modules/
3
3
4
4
# Personal notes
5
5
local-notes.md
6
+
7
+ .idea
8
+
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' ) ;
2
- const PNG = require ( 'pngjs' ) . PNG ;
2
+ const { PNG } = require ( 'pngjs' ) ;
3
3
const pixelmatch = require ( 'pixelmatch' ) ;
4
4
const path = require ( 'path' ) ;
5
5
const Helper = require ( '@codeceptjs/helper' ) ;
@@ -39,7 +39,7 @@ class PixelmatchHelper extends Helper {
39
39
} ;
40
40
41
41
/**
42
- * Default tolserance level for comparisons.
42
+ * Default tolerance level for comparisons.
43
43
*
44
44
* @type {float }
45
45
*/
@@ -1045,6 +1045,13 @@ class PixelmatchHelper extends Helper {
1045
1045
if ( data && data instanceof Buffer ) {
1046
1046
fs . writeFileSync ( path , data ) ;
1047
1047
}
1048
+
1049
+ // if allure is used, attached the diff screenshot
1050
+ const allure = codeceptjs . container . plugins ( "allure" ) ;
1051
+ if ( allure ) {
1052
+ this . debug ( `Attaching diff screenshot to Allure report...` ) ;
1053
+ allure . addAttachment ( `${ this . globalDiffPrefix } _screenshot.png` , data , "image/png" ) ;
1054
+ }
1048
1055
}
1049
1056
1050
1057
/**
You can’t perform that action at this time.
0 commit comments