A library for writing web application tests in javascript.
Provides a procedural interface for writing tests, so you don't have to grok event based programming. Uses PhantomJS to provide a webkit-based headless browser to run your tests against.
phantom.injectJs('testlib.js');
var t = new Test('https://github.com');
t.open('/');
t.is(t.text('title'), 'GitHub · Social Coding', 'Homepage loaded');
t.done();
-
Clone this repository
-
Either install PhantomJS from the repository (Ubuntu natty, maverick)
sudo add-apt-repository ppa:jerome-etienne/neoip sudo apt-get update sudo apt-get install phantomjs
Or build PhantomJS from source
sudo apt-get install libqt4-dev qt4-qmake git clone git://github.com/ariya/phantomjs.git && cd phantomjs git checkout 1.4 qmake-qt4 && make sudo ln -s $(pwd)/bin/phantomjs /usr/local/bin/phantomjs
-
Test:
phantomjs github-test.js
Note: if you don't have an X server, install xvfb, and prepend the above command with
xvfb-run
It's early days for this project, feel free to contribute.
For now (a temporary restriction), the page you are testing must have JQuery loaded. We'll work around this shortly.
(C) 2012 Shoptime Software.
This project is licensed under the MIT license.