I have 3 'it' specs with 27 expects in the code. protractor-html-screenshot-reporter includes 'it' specs but not expect level results.
Please let me know, can i make any configuration changes to make it work.
Thanks, Arpit Jain
I have 3 'it' specs with 27 expects in the code. protractor-html-screenshot-reporter includes 'it' specs but not expect level results.
Please let me know, can i make any configuration changes to make it work.
Thanks, Arpit Jain
protractor-html-screenshot-reporter
works on the spec-level (it
blocks).
According to the source code, it defines the reportSpecResults
function which is called by jasmine when the reporting results for a spec run.
The below code takes a screenshot on each Failed expect:
// takes screenshot on each failed expect
var originalAddMatcherResult = jasmine.Spec.prototype.addMatcherResult;
jasmine.Spec.prototype.addMatcherResult = function() {
++index;
if (!arguments[0].passed()) {
screenshot(this.description, index);
}
return originalAddMatcherResult.apply(this, arguments);
};
Hope this helps!