To address this, we have series of tests that run through the application in a web browser, clicking and interacting with the app live. We use a combination of Capybara (automation), Selenium Web Driver (web browser interface) and Jenkins (continuous integration).
A challenge in this process was getting the web browser to run on a headless server. Our CI server with Jenkins lives in the Amazon Web Services cloud, and doesn’t have X-windows running on it. So, how do we get a web browser? Here is our solution.
Setting Up Headless Browser Automation
We started off by installing Xvfb , an X server that requires no display devices. Configuration consisted of little more than:
sudo apt-get install xvfb
The Jenkins build script looks like this:
With a little bit of Jenkins configuration, this process is fully automated. Now every time we check code into our master branch (on github), Jenkins runs all the tests, and drops me an IM message about 15 minutes later telling me whether they succeeded or not. Sweet!