Add appropriate packages to build slave:
sudo apt-get install xvfb # virtual display sudo apt-get install x11-apps # installs xwd (for taking screenshots) sudo apt-get install imagemagick # for converting screenshots sudo apt-get install firefox
Create xvfb launch script:
#!/bin/bash if [ -z "$1" ]; then echo "`basename $0` {start|stop}" exit fi case "$1" in start) /usr/bin/Xvfb :5 -ac -screen 0 1024x768x8 &;; stop) killall Xvfb;; esac
Set xvfb script to launch at startup:
sudo update-rc.d xvfb defaults 10
Install Selenium server on build slave:
wget http://selenium.googlecode.com/files/selenium-server-standalone-2.0b2.jar sudo mkdir /var/lib/selenium sudo mv selenium-server-standalone-2.0b2.jar /var/lib/selenium cd /var/lib/selenium sudo ln -s selenium-server-standalone-2.0b2.jar selenium-server.jar
Add Jenkins plugin (only if using Selenium directly rather than through Django test suite):
Configure "Exceute shell" job:
export DISPLAY=":5" && java -jar /path/to/selenium-server.jar -browserSessionReuse -htmlSuite *firefox "http://path/to/app" "/path/to/tests/suite.html" "/path/to/results/results.html" OR (since we have Django + Selenium integration) ./run_tests.sh --with-selenium
Configure post-build reporting in plugin:
- Depends on plugin...
Run a build!
- Better to use the Django/Selenium integration as we have it now or generate a selenium test suite to be driven directly by Selenium + Jenkins?
- Which plugin to use (if driving with Selenium directly).