Skip to content

Automatic tests using Behat

oren edited this page Oct 8, 2013 · 3 revisions
git clone https://github.com/openscholar/openscholar.git
cd openscholar/openscholar/behat
# Install composer
curl -sk https://getcomposer.org/installer | php
php composer.phar install

# Create local YML file
cp behat.local.yml.example behat.local.yml

With your text editor, edit the new behat.local.yml and change the base_url.

default:
  context:
    parameters:
      drupal_users:
        admin:
          'admin'
        john:
          'jfk'
        michelle:
          'FourMoreYears'
      # the node ID of the group
      vsite:
        1
  extensions:
    Behat\MinkExtension\Extension:
      base_url:  BASE_URL
    Drupal\DrupalExtension\Extension:
      drush:
        alias: openscholar

Next we need to define a Drush alias. Create a aliases.drushrc.php typically located under ~/.drush. Make sure the uri and root properties are pointing to the correct place.

<?php

$aliases['openscholar'] = array(
  'uri' => 'http://localhost/openscholar',
  'root' => '/var/www/openscholar',
);

Last, execute all the tests

bin/behat
Clone this wiki locally