Server configuration
First we need to configure the server. Open jsunit/build.xml. At the top there are various properties that the Server
uses. Change these properties as appropriate. (These Ant properties are set as system environment variables when the JsUnit server is invoked
from Ant targets.)
- browserFileNames is a comma-separated list of paths to the executables of the browsers on which you want
to run your JsUnit test suite. For example, if you want to run the tests on Internet Explorer and Firefox, its value might be
d:\program files\internet explorer\iexplore.exe,d:\program files\Mozilla Firefox\firefox.exe
- url is the URL on which the browsers will open. This needs to be the URL to the testRunner.html in JsUnit installation,
just as if you were opening JsUnit in a browser. However, in addition, you need to pass in an appropriate to autoRun the tests
and to submit them to the JsUnit server (see Standard Query Strings). For example, if your
JsUnit distributed is installed in d:\dev\jsunit, and your test suite is at d:\dev\jsunit\tests\mySuite.html, its value might be
file:///d:/dev/jsunit/testRunner.html?testPage=d:\dev\jsunit\tests\mySuite.html&autoRun=true&submitresults=true
- port is the port on which the JsUnit server will run. If no value is provided, 8080 is assumed.
- resourceBase is the directory that will be used as the document root for the JsUnit server. If not specified, it defaults
to the jsunit installation directory. You probably won't need to change this - for most people, a blank value is appropriate.
- logsdirectory is the directory into which the JsUnit Server will write its XML logs. If not specified, it defaults to the
"jsunit/logs" directory. Again, for most people, the default value is fine.
- remoteMachineURLs is a comma-separated list of URLs of remote machines on which you want to run your tests. These remote machines
need to have a JsUnit server running on them, configured appropriately.
Another way of running the JsUnit server is through the use of jsunit.properties. With version 2.1, this has been deprecated..
If jsunit.properties exists in the working directory, JsUnit will look in it for each of the above properties (in the form key=value). If
jsunit.properties does not exist, JsUnit will look for environment variables for each property instead (which are set by the Ant script).