I was using Jasmine reporter 1.x before and I could generate nice Junit Xml reports. but then we moved to Jasmine reporter2.x because of some new cool features. But the probelm is that I am unable to generate correct Junit XML report for my test results. My XML output looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="focused specs" timestamp="2015-07-31T17:00:42" hostname="localhost" time="6.225" errors="0" tests="3" skipped="0" disabled="0" failures="0">
<testcase classname="focused specs" name="DDD" time="2.169" />
<testcase classname="focused specs" name="EEE" time="1.514" />
<testcase classname="focused specs" name="FFF" time="0.615" />
</testsuite>
<testsuite name="focused specs.SQLITE" timestamp="2015-07-31T17:00:46" hostname="localhost" time="0" errors="0" tests="0" skipped="0" disabled="0" failures="0">
</testsuite>
<testsuite name="focused specs.System admin page UI - delete user from MS SQL database through UI" timestamp="2015-07-31T17:00:46" hostname="localhost" time="1.924" errors="0" tests="3" skipped="0" disabled="0" failures="0">
<testcase classname="focused specs.System admin page UI - delete user from MS SQL database through UI" name="AAA" time="1.018" />
<testcase classname="focused specs.System admin page UI - delete user from MS SQL database through UI" name="BBB" time="0.171" />
<testcase classname="focused specs.System admin page UI - delete user from MS SQL database through UI" name="CCC" time="0.225" />
</testsuite>
</testsuites>
I do not understand why i see 'focused specs' inside class and test suite names. Also for my first test suite you can see that the testsuite name is missing (replaced by 'focused specs') and shown in the next tag 'SQLITE'. This is how i am using the reporter plugin inside my .conf file:
exports.config = {
//multiCapabilities: [{'browserName': 'firefox'},{'browserName': 'chrome'},{'browserName': 'internet explorer'}],
capabilities: {'browserName': 'chrome'},
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['./runner/runner-*.js'],
allScriptsTimeout: 10000,
getPageTimeout: 10000,
framework: 'jasmine2',
onPrepare: function() {
var jasmineReporters = 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 jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: 'XML-Results',
filePrefix: prePendStr
}));
});
},
};
Any ideas as to why I am suffering?
Thanks.