Background: I'm using Jasmine as my test framework for Protractor, I've been using jasmine spec reporter for reporting. Yesterday I slightly changed my jasmineNodeOpts
parameters in my protractor conf.js to include the print()
function i.e.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 120000,
includeStackTrace : true,
isVerbose : true,
print: function () {}
},
I added this print function because I learned it would remove the .
before each report. For example, my test reports used to come back:
. ✓ should display a profile question about IT loads
. ✓ checks the width of the progress bar
. ✓ selects an option from the radio buttons and updates the progress bar
And now those leading dots are removed. However, now my final report has also slight changed from:
14 specs, 2 failures Finished in 45.473 seconds // this is the old, desired output
To this:
Executed 14 of 14 specs (2 FAILED) in 45 secs. // this is my current, undesired output
I want the best of both worlds, having the .
removed from my report but retaining the previous overall report.
Problem: I cannot find detailed documentation on jasmineNodeOpts
and/or that print()
function. It is mentioned in jasmine-spec-reporter and the protractor reference conf but there is no real documentation on how it works, only very weak examples are provided.
Does anyone know where I can learn more about this print()
function and/or how to change my final test output?
I have one solution for this case. This is kind of a hack, a small change in the jasmine-spec-reporter - displaySummary logic
Replace the method -
summary(metrics)
atnode_modules/jasmine-spec-reporter/src/spec-display.js
with the below logicI just checked and its generating the execution summary as you are expecting