In order to perform UI testing your applications on DEV@cloud, you may need to have an X11 windowing server installed. (you can of course also use the SauceLabs selenium testing feature of DEV@cloud, in which case, you don't need to read further). The following is a guide for people running tests on DEV@cloud build servers:
There are several ways to acquire this X11 display
DEV@cloud supports the second of these options directly using the Xvfb application.
Xvfb is deployed into the build executors and just needs to be started to be available for your application.
If your job is configured with multiple build steps, you need to propagate the DISPLAY env variable to all steps. The simpler way is to use the setEnv plugin to define DISPLAY for the whole build.
For maven 2/3 jobs, you'll need the m2 extra steps plugin to start Xvfb as a pre-build step.
If you get an error similar to the following it means that you haven't started Xvfb properly.
Testing Angular.js via the unfortunately named Testacular framework uses a script like the following:
export DISPLAY=:1
Xvfb :1 &
node_version=v0.8.14
install_name=node-$node_version-linux-x64
node_home=$PWD/$install_name
if [ ! -e $install_name.tar.gz ]
then
wget http://nodejs.org/dist/$node_version/$install_name.tar.gz
tar xf $install_name.tar.gz
$node_home/bin/npm install -g testacular
fi
export PATH=$PATH:$node_home/bin
scripts/test.sh
Note that you also have to change the testacular.conf.js file to have singleRun=true; so it stops when the tests have run.
You can of course run selenium-webdriver directly on the build servers if you wish - they will work nicely with the included browsers on the platform. This supports a variety of languages.
For web apps GUI testing, many people are looking to write tests in javascript - the javascript testing tools can be used, but you need to assemble some together to get nice-to-look-at tests. The following are some links that can help with this:
Some other links which you may find useful: