When sharding tests (aka running tests in parallel; ie: shardTestFiles: true), instead of reporting results when all tests are finished, Protractor rep
Solution2-> Step 1. From the latest version of html-reporter, filePrefix should be fileNamePrefix, so function should be:
onPrepare: function() {
return new Promise(function (fulfill, reject) {
browser.getCapabilities().then(function (value) {
reportName = value.get('webdriver.remote.sessionid') + '_' + value.get('browserName') + '_' + Math.floor(Math.random()*1E16);
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/',
screenshotsFolder: 'images',
consolidate: true,
consolidateAll: true,
fileNamePrefix: reportName + ".html"
})
);
fulfill();
})
});
},