Behat - Gizra/KnowledgeBase GitHub Wiki
#Install on local machine Go to your behat directory(i.e openscholar/behat)
curl -s https://getcomposer.org/installer | php
php composer.phar install
On MAC:
curl -sk https://getcomposer.org/installer | php
php composer.phar install
#Setting up behat You need to create a new alias for your site. Copy the file aliases.drushrc.php from the behat directory to your drush directory, usually ~/.drush. The file need to be changed according to local environment:
uri: Change this to your address of the installation - http://localhost/openscholar/www
root: Change this to the path of the installation - /var/www/openscholar/www
If you want to check this worked type drush @os en node. This will enable the module node but since it's already enabled you'll get
node is already enabled. [ok]
There were no extensions that could be enabled. [ok]
After the composer finished to download all the components you need to copy the file behat.local.yml.example to behat.local.yml. After copying the example file to the new file you need to change the next value:
Replace BASE_URL to the address of the instllation(watch the section above)
replace DRUSH_ALIAS to the alias you just created above.
Tutorial
You can see more tutorials for behat: http://affinitybridge.com/blog/testing-drupal-distributions-using-behat-mink-drupal-extension-and-travis-ci
https://github.com/openscholar/openscholar/wiki/Behat-tests
#Add drupal module The behat we're using based on another module of drupal called Drupal extension. You can go to http://drupal.org/project/drupalextension in case you encountered an error. Another module that may be a reference is the module http://www.drual.org/project/doobie which is the module that mapped the drupal.org site to behat tests and may be helpful while writing tests.