S Patchamatla S Patchamatla - 5 months ago 42
Javascript Question

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.params.envi='DEVINT';
//For output reports
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter('./test', true, true));

},


When i ran the tests it ran successfully, but im not seeing any reports generated.

Any Suggestions?

Answer

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.

Comments