A sandbox proof of concept for a session at Drupalcamp London (http://2013.drupalcamplondon.co.uk/session/zip-bdd-do-dah-zip-bdd-ay).
Uses the Drupal 7 Commerce Kickstart profile (http://drupal.org/project/commerce_kickstart), with Behat/Mink testing using Travis CI (https://travis-ci.org)
# Clone repo
git clone https://github.com/nlisgo/drupal-kickstart-behat.git public_html
# Create Drupal codebase
cd public_html
drush make build-commerce-kickstart.make www
# Create Drupal database
mysql -e 'create database DB_NAME;' -u USERNAME -p PASSWORD
# Install Drupal
cd www
drush si commerce_kickstart --sites-subdir=default --db-url=mysql://USERNAME:PASSWORD@127.0.0.1/DB_NAME --account-name=admin --account-pass=admin --site-mail=admin@example.com --site-name="Commerce Kickstart Profile" --yes
# Start webserver - in another terminal window from the Drupal root folder (public_html/www)
drush rs 8888
# Install testing tools - go back to the previous terminal window
cd ../tests/behat
curl -s http://getcomposer.org/installer | php
php composer.phar install
Copy behat.local.yml.example
to behat.local.yml
and edit behat.local.yml
by setting the drupal_root to the full path of the Drupal root
To run tests
# Run tests
./bin/behat
To run tests with javascript using selenium server
# Download selenium standalone server
curl -O http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar
# Run selenium - in another terminal window from the behat folder (public_html/tests/behat)
java -jar selenium-server-standalone-2.39.0.jar
# Run tests - go back to the previous terminal window
./bin/behat
Fork this project on github to your personal account.
Setup your Travis CI account by logging in to http://travis-ci.org with you github credentials.
Switch on the repository from with in Travis CI.
To start a Travis CI build either push a change to your github repo or navigate to the service hooks page on your github repo and find the Travis hook and click the 'Test Hook' button.