@@ -84,15 +84,13 @@ class ResembleHelper extends Helper {
8484 async screenshotElement ( selector , name ) {
8585 const helper = this . _getHelper ( ) ;
8686 if ( this . helpers [ 'Puppeteer' ] ) {
87- const configuration = this . config ;
88-
8987 await helper . waitForVisible ( selector ) ;
9088 const els = await helper . _locate ( selector ) ;
9189 if ( ! els . length ) throw new Error ( `Element ${ selector } couldn't be located` ) ;
9290 const el = els [ 0 ] ;
9391
9492 await el . screenshot ( {
95- path : configuration . screenshotFolder + name + '.png'
93+ path : global . output_dir + "/" + name + '.png'
9694 } ) ;
9795 }
9896 else throw new Error ( "Method only works with Puppeteer" ) ;
@@ -230,6 +228,7 @@ class ResembleHelper extends Helper {
230228 }
231229
232230 const awsC = this . config . aws ;
231+ this . config . screenshotFolder = global . output_dir + "/" ;
233232
234233 if ( awsC !== undefined && options . prepareBaseImage === false ) {
235234 await this . _download ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage ) ;
@@ -268,6 +267,7 @@ class ResembleHelper extends Helper {
268267 }
269268
270269 const awsC = this . config . aws ;
270+ this . config . screenshotFolder = global . output_dir + "/" ;
271271
272272 if ( awsC !== undefined && options . prepareBaseImage === false ) {
273273 await this . _download ( awsC . accessKeyId , awsC . secretAccessKey , awsC . region , awsC . bucketName , baseImage ) ;
0 commit comments