Posts

Showing posts with the label jasmine

How to get spec name to be used as output file name in protractor-html-reporter-2?

Image
Clash Royale CLAN TAG #URR8PPP How to get spec name to be used as output file name in protractor-html-reporter-2? I'm using protractor html reporter 2 for my reporting. I need to get spec name as html report output file name. i'm using the below code in my config file. var today = new Date(), timeStamp = today.getMonth() + 1 + '-' + today.getDate() + '-' + today.getFullYear(); onPrepare: function () { browser.driver.manage().window().maximize(); var fs = require('fs-extra'); scriptName=function(){ return browser.getProcessedConfig().then(function(config){ return config.specs; }); }; fs.emptyDir('./target/htmlReports/'+scriptName+'-'+timeStamp+'/screenShots/', function (err) { console.log(err); }); jasmine.getEnv().addReporter({ specDone: function(result) { //if (result.status == 'failed' || result.status == 'passed') { ...