1 Environment specific settings
2 =============================
4 Some of the settings in ``behat.yml`` are environment specific. For example the
5 base URL may be ``http://mysite.localhost`` on your local development
6 environment, while on a test server it might be ``http://127.0.0.1:8080``. Some
7 other environment specific settings are the Drupal root path and the paths to
8 search for subcontexts.
10 If you intend to run your tests on different environments these settings should
11 not be committed to ``behat.yml``. Instead they should be exported in an
12 environment variable. Before running tests Behat will check the ``BEHAT_PARAMS``
13 environment variable and add these settings to the ones that are present in
14 ``behat.yml``. This variable should contain a JSON object with your settings.
22 "Behat\\MinkExtension": {
23 "base_url": "http://myproject.localhost"
25 "Drupal\\DrupalExtension": {
27 "drupal_root": "/var/www/myproject"
34 To export this into the ``BEHAT_PARAMS`` environment variable, squash the JSON
35 object into a single line and surround with single quotes:
39 $ export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}'
41 There is also a `Drush extension <https://github.com/pfrenssen/drush-bde-env>`_
42 that can help you generate these environment variables.