Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I write the output of jasmine-spec-reporter to file?

Tags:

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.

like image 277
fuzzi Avatar asked May 05 '16 18:05

fuzzi


People also ask

What is the use of jasmine Spec reporter?

To generate better reports, we use a package called jasmine-spec-reporter . This reporter displays more detailed information about running the tests, as well as having some customization options.

How do I create a report in Jasmine?

To configure Jasmine to generate reports in the JunitXML format, instantiate the JUnitXmlReporter reporter by adding the following code to your tests. var reporters = require('jasmine-reporters'); var junitReporter = new reporters.

What is a spec reporter?

The spec reporter displays a detailed report of all the tests in the terminal.


2 Answers

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

like image 121
KCaradonna Avatar answered Oct 30 '22 01:10

KCaradonna


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
}));
like image 37
Bastien Caudan Avatar answered Oct 30 '22 02:10

Bastien Caudan