David Redmayne
David Redmayne

Reputation: 232

Jasmine HTML2 Reporter

I have been using Jasmine2-HTML-Reporter and it's been fine. Produces a multi-spec report with screenshots - just as I need.

However, something seems to have gone awry! Now I will only get a report for the first Spec and nothing for any other spec. Also, the system used to delete the previous report/screenshot but now this has to be done manually.

I really cannot think what's changed in the rest of the package to cause this!!

Here's the entry in the conf.js files...identical for each conf file. I've tried adding the various switches - no effect at all!

Thanks

 var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');

exports.config = {
//seleniumAddress: 'http://localhost:444/wd/hub',
params: require ('Models/Baths.js'), 
directConnect: true,

capabilities: {
  cssSelectorsEnabled: true,
  'browserName': 'chrome',


   specs:['Specs/001-First.js',
        'Specs/003-Exp.js'
],


allScriptsTimeout: 120000,
getPageTimetout: 30000,

framework: 'jasmine2',
showColors: true,
isVerbose: true,


onPrepare: function() {

Jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
 takeScreenshots: true,
savePath: './Reports',
  fileName: 'B&Q'
})
  );

  var SpecReporter = require ( 'jasmine-spec-reporter').SpecReporter;
  jasmine.getEnv().addReporter( new SpecReporter( {
  displayStacktrace:      true,
  displayFailureSummary:  true,
  displayPendingSummary:  true,
  displaySuccessfulSpec:  true,
  displayFailedSpec:      true,
  displaySpecDuration:    true,
  displaySuiteNumber:     false,
  colors: {
success: 'green',
failure: 'red',
pending: 'yellow'
 },
   customProcessors: []

} ));

  }
}
};

Upvotes: 1

Views: 144

Answers (1)

tyaga001
tyaga001

Reputation: 169

Try with below conf file, it should work for you.

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
var log4js = require('log4js');
var params = process.argv;
var args = process.argv.slice(3);

exports.config = {
  //seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.48.2.jar',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  allScriptsTimeout: 100000,
  framework: 'jasmine2',

  onPrepare: function () {

    browser.manage().timeouts().implicitlyWait(11000);
    var width = 768;
    var height = 1366;
    browser.driver.manage().window().setSize(768, 1366);
    browser.ignoreSynchronization = false;

    jasmine.getEnv().addReporter(
      new Jasmine2HtmlReporter({
        savePath: __dirname+'/qualityreports/testresults/e2e',
        takeScreenshots: false,
        filePrefix: 'automationReport',
        consolidate: true,
        cleanDestination: false,
        consolidateAll: true

      })
    );
  },

  suites:{

    example:['./test/e2e/specs/**/*Spec.js',]
  },


  capabilities: {
    'browserName': 'chrome'
  },


  resultJsonOutputFile:'./results.json',

  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 100000
  }
};

Upvotes: 0

Related Questions