Run protractor from Jenkins cannot generate report
I'm trying to run protractor from Jenkins, my spec run successfully, however it cannot generate html and/or xml report, I got following issue:
Warning: writing junit report failed for 'xmloutput', 'testresults.e2e.ApricotAppToolBar.xml'. Reasons: Rhino attempt: java is not defined PhantomJs attempt: window is not defined NodeJS attempt: EPERM, operation not permitted 'C:\cygwin64\home\juneh\git\vmw\iup-platform-client\clients\software_manager\test\xmloutput\testresults.e2e.ApricotAppToolBar.xml'
If I run the same specs from command line, then reports can be generated. Why it is prohibiting reports generated from Jenkins? Any advice is greatly appreciated
I don't think this problem is coming from Protractor. It looks like the error is maybe coming from the jasmine reporters? Are you using the jasmine-reporters module?
Had a similar issue recently, PhantomJS seemed to be related. Targeting Chrome instead seemed to help, otherwise wasn't able to resolve.
I tried targeting chrome only by: capabilities: { browserName: 'chrome' }, but still report is not generated through jenkins, did I miss any other set up?
On Friday, August 1, 2014 4:23 PM, JT [email protected] wrote:
Had a similar issue recently, PhantomJS seemed to be related. Targeting Chrome instead seemed to help, otherwise wasn't able to resolve. — Reply to this email directly or view it on GitHub.
I noticed when I run protractor from Jenkins, the browser is not launched, yet tests are run successfully. If I run from cmd line, browser is launched. Is protractor supposed to work that way with Jenkins?
@chun2014,
I am running Protractor successfully from Jenkins and it opens up browser successfully.
If I delete the existing reporter folder, create new folder from scratch and then run it will launch the browser, but if I already have reporting folder and suppose to append results under it, then browser will not launch, and report cannot be generated. Looks like a bug.
Same issue here. My config:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
jasmineNodeOpts: {
isVerbose: true
},
onPrepare: function () {
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('test', true, true)
);
}
}
After a succesful protractor run:
Rhino attempt: java is not defined
PhantomJs attempt: window is not defined
NodeJS attempt: ENOENT, no such file or directory: '[path]\test\TEST-app.xml'
The same problem
I am hitting the same problem:
Rhino attempt: java is not defined
PhantomJs attempt: window is not defined
NodeJS attempt: ENOENT, no such file or directory
I am using gulp-protractor with multiCapabilities and the protractor-html-screenshot-reporter provides a great report, but the JUnit one fails. I need JUnit for Jenkins.
Same issue here
Rhino attempt: java is not defined
PhantomJs attempt: window is not defined
NodeJS attempt: ENOENT, no such file or directory
Dunno what happend, but that began to work, after cleaning npm modules, and using 1.0.0 version of jasmine reporters and creating tmp folder.
onPrepare: function () {
browser.get(browser.baseUrl);
var reporters = require('jasmine-reporters');
jasmine.getEnv().addReporter( new jasmine.JUnitXmlReporter("tmp", true, true, "alt-prepend-"));
}
Seems to me that folder for reports should be precreated before run
Same issue. Not only under Jenkins but in my local develop environment too.
As @AntonSerhiienko says, it is solved by pre-creating the reports folder. However unlike @chun2014, I could make repeated runs without having to delete and re-create the reports folder.
The output error message is confusing, though.
I just published [email protected] which uses node-mkdirp to create the output directory before writing. The jasmine2.x branch of jasmine-reporters has been doing this since it was first published, but the logic had never been added to the 1.x branch.
This should help clear up this type of issue in the future.