Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Best practice: How to get behat tests running locally

Ethan Mallove edited this page Feb 22, 2016 · 7 revisions

How to get behat tests running locally

  1. Run the default installation script in your repository root.
    ~$ cd $REPO && bash default.install.sh

  2. Follow these instructions to install Composer PHP package manager:
    https://github.com/composer/composer
    Help for Mac OS X:
    http://stackoverflow.com/questions/14437588/having-trouble-installing-composer

  3. Verify Composer works:
    ~$ composer about

  4. Go to your behat directory inside the OpenScholar profile:
    ~$ cd docroot/profiles/openscholar/behat

  5. Install the dependencies:
    ~$ composer install

  6. Set your Behat local settings:
    (probably docroot "http://localhost" and drush alias "self")
    ~$ cp behat.local.yml.example behat.local.yml && vim behat.local.yml

    $ cat behat.local.yml
    1 default:
    2   context:
    3     parameters:
    4       drupal_users:
    5         admin:
    6           'admin'
    7         john:
    8           'jfk'
    9         michelle:
    

    10 'FourMoreYears' 11 bill: 12 'clinton' 13 alexander: 14 'bell' 15 demo: 16 'demo' 17 bruce: 18 'bruce' 19 klark: 20 'klark' 21 # the node ID of the group 22 vsite: 23 2 24 25 extensions: 26 Behat\MinkExtension\Extension: 27 base_url: BASE_URL 28 Drupal\DrupalExtension\Extension: 29 drupal: 30 drupal_root: "$FILL_IN_THIS_PATH_TO_DRUPAL" 31 api_driver: "drupal" 32 drush: 33 alias: DRUSH_ALIAS 34 35 36

  7. Run the tests:
    ~$ bin/behat

Clone this wiki locally