Run ownCloud Cucumber tests on Fedora 17

ownCloud uses automated testing to check for problems, and writing and executing these tests is important for any contributor. In my capacity as an ownCloud systems developer I use these tests to quickly verify that my apps don’t break after merging or pulling new code. For those less familiar with Ruby however, getting the Cucumber based behaviour tests running can be confusing. Here’s how to do it on Fedora.

  • Install the necessary dependencies:
    sudo yum install libxslt libxslt-devel libyaml libyaml-devel xorg-x11-server-Xvfb openssl-devel
  • Install RVM. If you have previously installed it, you may need to reinstall it so that the newly available libraries are used:
    sudo rvm install 1.9.3
  • Install the Selenium gem:
    sudo gem install selenium-webdriver
  • Clone the acceptance-testing repository from GitHub:
    git clone https://github.com/owncloud/acceptance-testing
  • Switch to root (su), and enter the newly created directory (this will trigger the .rvmrc shell script):
    cd acceptance-testing
  • Accept the warning and agree to run the script
  • If the script encounters errors (e.g. “RVM not found” or “RVM is not a function”), then open a new terminal, and repeat steps from “Switch to root”.
  • If you are testing a copy of ownCloud running locally on your machine, start your webserver, e.g.:
    service httpd start
  • Run cucumber to execute the tests:
    cucumber HOST=foo.bar.com features