ruru-protractor-html-screenshot-reporter
Protractor test results in HTML format with screen captures.
Will work with multi-capabilities and spec file sharding.
##BETA BETA BETA BETA
Needs more tests, more use in different configurations.
Build status:
Test coverage:
Installation
npm install ruru-protractor-html-screenshot-reporter
Usage
Place the following in your Protractor configuration file
var HTMLScreenshotReporter = require('ruru-protractor-html-screenshot-reporter');
Create an instance of the reporter passing (optional) configuration parameters
var htmlReporter = new HTMLScreenshotReporter({
title : 'My Protractor End to End Test Report',
targetPath : 'target',
screenshotsFolder : 'screenshots-folder',
fileName : 'protractor-e2e-report.html'
});
Place the following in your Protractor configuration file
exports.config = {
framework : 'jasmine2',
resultJsonOutputFile : 'my-protractor-e2e-results.json',
...
onPrepare : function () {
jasmine.getEnv().addReporter(htmlReporter);
return browser.getProcessedConfig().then(function (config) {
return browser.getCapabilities().then(function (cap) {
browser.version = cap.get('version');
browser.browserName = cap.get('browserName');
browser.baseUrl = config.baseUrl;
});
});
},
afterLaunch : function (exitCode) {
return new Promise(function (resolve) {
htmlReporter.generateHtmlReport(exports.config.resultJsonOutputFile);
});
}
}
Development
If you want to build and test this project you will be able to by:
npm install
npm test