How can I save protractor test results

Is there a way to output the protractor test results to a file that will be viewed outside the command line after the test starts, including viewing detailed failures?

+6
source share
3 answers

I found a nice clean way to keep test results in an orderly way using the Jasmine reporter.

How to install and configure the Jasmine reporter:

Install the Jasmine Reporter:

npm install -g jasmine-reporters 

Add the following to the protractor-config.js file:

  onPrepare: function() { require('jasmine-reporters'); jasmine.getEnv().addReporter( new jasmineReporters.JUnitXmlReporter('outputxmldir', true, true)); } 

Create the folder outputxmldir (all test outputs will be placed here).

Run the protractor and now the results will be exported to an XML file in the outputxmldir folder.

+7
source

Is just a test output enough?

 protractor conf.js > test.log 

Greetings.

+6
source

You can also set the resultJsonOutputFile parameter in the configuration file:

 export.config = { (...) // If set, protractor will save the test output in json format at this path. // The path is relative to the location of this config. resultJsonOutputFile:'./result.json', (...) } 

More information about the configuration file can be found at:

https://raw.githubusercontent.com/angular/protractor/master/docs/referenceConf.js

+4
source

All Articles