Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note about the need to remove the entries in behat.yml to use BEHAT_PARAMS #514

Merged
merged 2 commits into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.