Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Jasmine reporter in Protractor tests

I can not find how to change reporter style in protractors runner using jasmine framework.

What I have right now is:

enter image description here

But I would like something more like:

enter image description here

Is there a way to add custom reporter for jasmine that would show current test running instead of DOTS and Fs?

like image 335
Vytautas Butkus Avatar asked May 15 '14 12:05

Vytautas Butkus


3 Answers

I am building a jasmine reporter that does exactly what you want, jasmine-spec-reporter.


To configure in protractor.conf.js:

onPrepare: function(){
    var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
    jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
}
like image 187
Bastien Caudan Avatar answered Oct 23 '22 21:10

Bastien Caudan


Add the isVerbose flag to the protractor config, it's false by default:

exports.config = {
  . . .

  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    isVerbose: true
  }
};
like image 27
fer Avatar answered Oct 23 '22 23:10

fer


Add this dependency to your project:
npm install jasmine-spec-reporter --save-dev

And add this to your config file:

onPrepare: function(){
    var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
    jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
}
like image 4
Automation Tester Avatar answered Oct 23 '22 23:10

Automation Tester