Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor test reports

I've established a considerable set of protractor test suites and I'm looking to implement it into jenkins to run these tests with each new build. To handle the output, simply outputting it to a text file doesn't suffice anymore e.g. protractor conf.js --suite [suiteName] > output.text

I've found protractor reporters here and here but I haven't found any information on manually manipulating the protractor output to represent it more clearly and attractively without the use of external frameworks / libraries.

Appreciate any input!

like image 690
Tom Nijs Avatar asked Apr 16 '15 13:04

Tom Nijs


1 Answers

It sounds like you want to create a custom Jasmine reporter. The reporter API is explained in the Jasmine docs.

Since you only want to do stuff with test results, you only need to implement the specDone callback. Your reporter would look something like this:

var myReporter = {
  specDone: function(results)( {
    writeToFile('Suite started: ' + result.description + ' whose full description is: ' + result.fullName);
  }
};

Then you can add your reporter to Jasmine in your conf file:

jasmine.getEnv().addReporter(myReporter);
like image 150
Andrew Eisenberg Avatar answered Nov 16 '22 22:11

Andrew Eisenberg