Running Jstestdriver with PhantomJs in Windows

Using JSTestDriver with PhantomJS Locally
PahntomJS is command line web browser
JSTestDriver can be integrated to Jenkins; it can also be used for unit testing JavaScritpt Code; Only that it needs a browser running to execute the test cases.Using PahntomJs as the browser will  remove the need for a GUI browser to be launched from the script driven CI evnironment.
Steps
First start JStestdriver
D:\Coding\lib>java -jar JsTestDriver-1.3.5.jar  --port 9876 --captureConsole --runnerMode DEBUG
Starting Phantomjs browser and using it to capture the JStestdriver
Download Phantomjs
Download and use the javascript that is used to capture the pahntom browser
d:\Program_Files\phantomjs-1.7.0-windows>phantomjs.exe phantomjs-jstd.js
Wed Oct 31 2012 12:07:26 GMT+0530 (India Standard Time): Attempting (1) to load:
Run your JStestdiver tests
 D:\Coding\portlet\....\src\main\webapp\js>java -jar d:\Coding\lib\JsTestDriver-1.3.5.jar --tests all  --runnerMode DEBUG
Thats all
Note – Phantomjs can be used to change user agents (default is Safari)

Better Still, Running your JavaScript tests from Eclipse
Download and istall JStestDriver Eclipse Plugin from http://code.google.com/p/js-test-driver/wiki/UsingTheEclipsePlugin
Screen shot below for configuraiton 


Comments

Popular posts from this blog

OpenLayers Advanced Clustering and Setting dynamic images for OpenLayer Styles via Ajax

Long running Java process resource consumption monitoring , leak detection and GC tuning

Compiling OpenCV with CUDA (GPU) using CMake (GUI)