jasmine-reporters option for Protractor's multiCapabilities option

jasmine, protractor

Solution

I found a solution that solved the same problem for me here: https://github.com/angular/protractor/issues/60

In your protractor.conf file:

onPrepare: function(){
        require('jasmine-reporters');
        var capsPromise = browser.getCapabilities();
        capsPromise.then(function(caps){
            var browserName = caps.caps_.browserName.toUpperCase();
            var browserVersion = caps.caps_.version;
            var prePendStr = browserName + "-" + browserVersion + "-";
            jasmine.getEnv().addReporter(new
jasmine.JUnitXmlReporter("protractor_output", true, true,prePendStr));
        });
 }

This will result in reports like:

Problem

I am using [jasmine-reporters] for xml report with Protractor. Protractor's configuration for [jasmine-reporters] look like below, ``` onPrepare: function() { require('jasmine-reporters'); jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('../e2e_test_out', true, true, 'testresults.e2e.')); }, ``` above config working fine and gettting the result in 'e2e_test_out' directory with 'testresults.e2e.' prefix. But when I use protractor's multiCapabilities option, ``` multiCapabilities: [{ 'browserName': 'chrome' }, { 'browserName': 'internet explorer' }], ``` I am getting only one set of report. From that I could not understand the individual browser's result. Is there any way to generate two diff reports / combined reports for both the browsers?

Original source