We use Jenkins for the continuous integration of .NET web applications with NAnt/NUnit for the .NET tests. Jenkins is configured with 9 slaves (all of which are Windows Server 2003) that runs many builds along with their automated tests.
We are trying to setup js-test-driver for running our JavaScript unit tests and the below NAnt task is working well locally on the developer workstations. Internet explorer is the only browser we would like to test on, as that is the only target browser for all our web applications.
<target name="jsTests" >
<echo message="Running JavaScript tests..." />
<exec program="java.exe">
<arg line="-jar '${jstestdriver.dir}\JsTestDriver.jar'" />
<arg line="--config '${ui.webtests.dir}\JsTestDriver.conf'" />
<arg line="--port 9876"/>
<arg line="--browser 'C:\program files\internet explorer\iexplore.exe'"/>
<arg line="--verbose"/>
<arg line="--reset"/>
<arg line="--tests all"/>
<arg line="--testOutput '${results.jstestdriver.dir}'"/>
</exec>
</target>
We are running into problems with the same task on Jenkins, probably because:
- it's a server and we are running as a service account
- there are security restrictions on the browser installation on the server
The GettingStarted
page on the js-test-driver wiki says we could run the browsers on a different machine than where the js-test-driver server is running:
Before you can run any of your tests you need to start the test server and capture at least one slave browser. The server does not have to reside on the machine where the test runner is, and the browsers themselves can be at different machines as well.
- Has anyone done this on Jenkins/Windows setup?
- Are there any other alternatives for a scalable setup to run js-test-driver?
<target name="jsTests" > <echo message="Running JavaScript tests..." /> <exec program="java.exe"> <arg line="-jar '${jstestdriver.dir}\JsTestDriver.jar'" /> <arg line="--config '${ui.webtests.dir}\JsTestDriver.conf'" /> <arg line="--verbose"/> <arg line="--reset"/> <arg line="--tests all"/> <arg line="--testOutput '${results.jstestdriver.dir}'"/> </exec> </target>
– Krause