Skip to content

Commit

Permalink
Merge pull request #514 from jonpugh/patch-2
Browse files Browse the repository at this point in the history
Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS

Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>
  • Loading branch information
jhedstrom committed Oct 26, 2018
1 parent 156fb90 commit 6654a01
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion doc/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you intend to run your tests on different environments these settings should
not be committed to ``behat.yml``. Instead they should be exported in an
environment variable. Before running tests Behat will check the ``BEHAT_PARAMS``
environment variable and add these settings to the ones that are present in
``behat.yml``. This variable should contain a JSON object with your settings.
``behat.yml``. This variable should contain a JSON object with your settings.

Example JSON object:

Expand All @@ -38,5 +38,47 @@ object into a single line and surround with single quotes:
$ export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}'
You must also remove (or comment out) the entries that you use in behat.yml for the values in BEHAT_PARAMS to take affect.

.. code-block:: yml
default:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
extensions:
Behat\MinkExtension:
goutte: ~
selenium2: ~
# Must comment out for BEHAT_PARAMS to be effective.
# base_url: http://seven.l
Drupal\DrupalExtension:
# Anything used in BEHAT_PARAMS must be removed or commented.
# drupal:
# drupal_root: /var/www
# drush:
# alias: '@site'
blackbox: ~
# You can use profiles if you wish to allow users to run tests locally.
# Usage:
# bin/behat --profile=local
local:
extensions:
Behat\MinkExtension:
base_url: 'localhost'
Drupal\DrupalExtension:
drush:
alias: '@self'
drupal:
drupal_root: '../web'
There is also a `Drush extension <https://github.com/pfrenssen/drush-bde-env>`_
that can help you generate these environment variables.

0 comments on commit 6654a01

Please sign in to comment.