Skip to content Skip to sidebar Skip to footer

Unable To Generate Report When Using Jasmine-reporters In Protractor

i Used the following code in config var jasmineReporters = require('jasmine-reporters'); onPrepare: function() { browser.driver.manage().window().maximize(); browser.pa

Solution 1:

I had the same problem. It was sloved by:

framework: "jasmine2",  //must set it if you use JUnitXmlReporter

    onPrepare: function(){  //configure junit xml report

        var jasmineReporters = require('jasmine-reporters');
        jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
            consolidateAll: true,
            filePrefix: 'guitest-xmloutput',
            savePath: 'test/reports'
        }));

    },

Look on the current documentation of https://github.com/larrymyers/jasmine-reporters. At the bottom is the instruction for protractor. I solved the same problem by adding this to protractor.conf.js


Solution 2:

Not sure it would help but here is what is working for me:

onPrepare: function () {
    require("jasmine-reporters");

    // junit reporter
    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("test-results", true, true, prePendStr));
    });
},

Using jasmine 1.3, jasmine-reporters 1.0.1, protractor 2.0.


Solution 3:

s-patchamatla You need to downgrade version of Jasmine to jasmine-reporters@1.0.0

Newer versions of jasmine reporters does no longer attaches to the Jasmine object

so, in case you tried to use jasmine-reporters with Protractor, you need to use a 1.x version of jasmine-reporters.

npm install jasmine-reporters@~1.0.0

onPrepare: function () {
    require("jasmine-reporters");

    // junit reporter
    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(<report path>, true, true, prePendStr));
    });
}

i guess this should work for you.


Post a Comment for "Unable To Generate Report When Using Jasmine-reporters In Protractor"