5

I am currently using jasmine-spec-reporter to create a spec report for my Protractor test cases.

The output on the terminal looks great! Is there any way to save this output to file or somehow use protractor-jasmine2-screenshot-reporter to create a summary, but disable the screenshots?

I have tried looking online for solutions, but so far haven't been successful.

var SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'none'}));

https://github.com/jintoppy/protractor-html-screenshot-reporter

https://github.com/bcaudan/jasmine-spec-reporter

My current workaround is to use the protractor-jasmine2-screenshot-reporter to generate the report. This also generates screenshots (not very practical due to the volume being created).

If anyone has a solution to disabling the screenshots, or even not allowing the .png files to save, please share.

fuzzi
  • 1,967
  • 9
  • 46
  • 90

2 Answers2

2

The output on the terminal looks great! Is there any way to save this output to file

This package is what you want https://www.npmjs.com/package/jasmine-reporters. It contains several different reporting options. If you want to parse the xml into an html file you can use https://www.npmjs.com/package/jasmine-xml2html-converter

KCaradonna
  • 760
  • 6
  • 13
  • Is there an option to generate HTML files, without the stack traces? (I only see XML). I have implemented this, but it produces reports with full stack traces. – fuzzi May 05 '16 at 20:33
  • Not sure about excluding the stack trace but I edited answer to reflect your question about HTML – KCaradonna May 05 '16 at 20:49
  • This also generates screenshots (not very practical due to the volume being created). In the screenshot reporter are you using this flag? captureOnlyFailedSpecs: true – KCaradonna May 05 '16 at 20:51
  • Thanks @KCaradonna, I am only generating them on Failures, but there is over 1000 tests in different specs, and lots of false negatives are generated. – fuzzi May 05 '16 at 21:34
2

It seems that this guy had the same need: https://github.com/Kenzitron/protractor-jasmine2-html-reporter

You can turn off screenshot if needed:

jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
   takeScreenshots: false
}));
Bastien Caudan
  • 4,482
  • 1
  • 17
  • 29