@@ -84,15 +84,13 @@ class ResembleHelper extends Helper {
84
84
async screenshotElement ( selector , name ) {
85
85
const helper = this . _getHelper ( ) ;
86
86
if ( this . helpers [ 'Puppeteer' ] ) {
87
- const configuration = this . config ;
88
-
89
87
await helper . waitForVisible ( selector ) ;
90
88
const els = await helper . _locate ( selector ) ;
91
89
if ( ! els . length ) throw new Error ( `Element ${ selector } couldn't be located` ) ;
92
90
const el = els [ 0 ] ;
93
91
94
92
await el . screenshot ( {
95
- path : configuration . screenshotFolder + name + '.png'
93
+ path : global . output_dir + "/" + name + '.png'
96
94
} ) ;
97
95
}
98
96
else throw new Error ( "Method only works with Puppeteer" ) ;
@@ -230,6 +228,7 @@ class ResembleHelper extends Helper {
230
228
}
231
229
232
230
const awsC = this . config . aws ;
231
+ this . config . screenshotFolder = global . output_dir + "/" ;
233
232
234
233
if ( awsC !== undefined && options . prepareBaseImage === false ) {
235
234
await this . _download ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage ) ;
@@ -268,6 +267,7 @@ class ResembleHelper extends Helper {
268
267
}
269
268
270
269
const awsC = this . config . aws ;
270
+ this . config . screenshotFolder = global . output_dir + "/" ;
271
271
272
272
if ( awsC !== undefined && options . prepareBaseImage === false ) {
273
273
await this . _download ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage ) ;
0 commit comments