A simple patch that allows Dojo DOH to generate XML JUnit compliant report
Place this module in the DOH folder (at the same directory as the "runner.js"). And load it from the _nodeRunner.js, if you need to generate XML output.
In order to make sure this script does work. Please follow these steps:
- clone the dojo/util repo (https://github.com/dojo/util):
git clone https://github.com/dojo/util dojo-utils
- cd into the DOH folder
cd dojo-utils/doh/
- copy the runner-junit.js in this folder (near _nodeRunner.js)
├── LICENSE
├── README
├── Robot.html
├── _browserRunner.js
├── _nodeRunner.js <-- THIS
├── _parseURLargs.js
├── _rhinoRunner.js
├── _sounds
├── doh.profile.js
├── junit.xml
├── main.js
├── mobileRunner.html
├── package.json
├── plugins
├── robot
├── robot.js
├── runner-junit.js <-- THIS
├── runner.html
├── runner.js
├── runner.sh
├── small_logo.png
└── tests
- edit the _nodeRunner.js and include the runner-junit module, you should have something like this:
define(["doh/runner-junit", "require"], function(doh, require) {
- test it like this (you need to install Nodejs):
node ../../dojo/dojo.js baseUrl=../../dojo load=doh test=tests/selfTest.js > report.xml
- Voila!
This patch overrides the DOH methods, in order to implement the new XML output. The DOH methods being overriden start from this line.
This code needs some improvements. Please feel free to submit fixes or fork...
Dojo license (http://dojotoolkit.org/license)