Search code examples
jenkinsphantomjsqunit

How to get jenkins to run my qunit test using phantomjs


Im working on getting our CI (Jenkins) to use and run our qunit test, we have qunit-reporter, qunit.compposite and phantomjs to execute the whole. Im not ant expert so im using windows batch command as a prestep with the following command

phantomjs src\test\webapp\js\runner.js src\test\webapp\jquery.all.test.html > test-report.xml

Now this runs and generates the junit xml file, with a few issues, firstly since I use pipe phantomjs performance information is also put into the file so that's my first issue

My second issue is that I have no idea in the world how I can get Jenkins to actually read the xml file instead of just considering it random stuff, similar to it interpreting when we have junit test run.

Just for reference the project is a maven project.

All advice is welcome :)


Solution

  • In Jenkins, configure your job, add a post build action, select publish JUnit test result report then add the path to your xml file in the requested field.