From c8465407fc32f9b4630f5ef577f897adee7b84be Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 11 Oct 2018 15:09:01 -0400 Subject: [PATCH 1/2] Adding note about the need to remove the entries in behat.yml to override this. --- doc/environment.rst | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/environment.rst b/doc/environment.rst index 8454e1ae..77e5b29a 100644 --- a/doc/environment.rst +++ b/doc/environment.rst @@ -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: @@ -38,5 +38,42 @@ 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. + +```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: + 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 `_ that can help you generate these environment variables. From f1a7e01c6f20186adb31f3c4731581e1f82eab65 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 11 Oct 2018 15:12:21 -0400 Subject: [PATCH 2/2] Fixing markup --- doc/environment.rst | 69 ++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/doc/environment.rst b/doc/environment.rst index 77e5b29a..3693534c 100644 --- a/doc/environment.rst +++ b/doc/environment.rst @@ -40,39 +40,44 @@ object into a single line and surround with single quotes: You must also remove (or comment out) the entries that you use in behat.yml for the values in BEHAT_PARAMS to take affect. -```yml -default: - suites: +.. code-block:: yml + 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: - 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' - -``` + 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 `_