Im doing end to end testing of a Angular website using protractor, but wanted to export the results to a file that Jenkins can read (JUnitXmlReporter), so for this to work I need to do a "simple change" to my protractor config file on the "onPrepare":
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
framework: 'jasmine',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
specs: [
'./test1.js',
'./test2.js'
],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
isVerbose: true
},
onPrepare: function() {
var jasmineReporters = require('jasmine-node-reporter-fix');
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter('protractor_output', true, true, 'testresults.e2e.');
}
};
but once I add this "onPrepare" code, all the test run without waiting for the browser to render the html. If I remove the "onPrepare" code, all the test will start working as expected, but no files generated for jenkins.
Any ideas whats wrong?