Wednesday, October 31, 2012

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.
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
Screen shot below for configuraiton 

No comments:

Install/Upgrade NVIDI Driver in Ubuntu for CUDA SDK

Most linux distribution comes with the Nouveau display driver configured. If you need to use NVIDIA...