onAfterCommand(command) {
        if (this.options.useOnAfterCommandForScreenshot) {
            if (this.isScreenshotCommand(command) && command.result.value) {
                const timestamp = moment().format('YYYYMMDD-HHmmss.SSS');
                const filepath = path.join(this.options.outputDir, '/screenshots/', this.cid, timestamp, this.options.filename + '.png');
                fs.outputFileSync(filepath, Buffer.from(command.result.value, 'base64'));

                let test = this.getTest(this.testUid);
                test.events.push({type: 'screenshot', value: filepath});
            }
        }
    }
//this is a hack to get around lack of onScreenshot event
this is a hack to get around lack of onScreenshot event
this is a hack to get around lack of onScreenshot event
onAfterCommand(command) {
        if (this.options.useOnAfterCommandForScreenshot) {
            if (this.isScreenshotCommand(command) && command.result.value) {
                const timestamp = moment().format('YYYYMMDD-HHmmss.SSS');
                const filepath = path.join(this.options.outputDir, '/screenshots/', this.cid, timestamp, this.options.filename + '.png');
                fs.outputFileSync(filepath, Buffer.from(command.result.value, 'base64'));
                let test = this.getTest(this.testUid);
                test.events.push({type: 'screenshot', value: filepath});
            }
        }
    }
onAfterCommand ( command ) { if ( this . options . useOnAfterCommandForScreenshot ) { if ( this . isScreenshotCommand ( command ) && command . result . value ) { const timestamp = moment ( ) . format ( 'YYYYMMDD-HHmmss.SSS' ) ; const filepath = path . join ( this . options . outputDir , '/screenshots/' , this . cid , timestamp , this . options . filename + '.png' ) ; fs . outputFileSync ( filepath , Buffer . from ( command . result . value , 'base64' ) ) ; let test = this . getTest ( this . testUid ) ; test . events . push ( { type : 'screenshot' , value : filepath } ) ; } } }
this is a hack to get around lack of onScreenshot event
this is a hack to get around lack of onScreenshot event