From 694a6c3abe04a0dfa41e8aeb140094754b4e85db Mon Sep 17 00:00:00 2001 From: ShaunDychko Date: Thu, 8 Jun 2017 19:47:20 +0200 Subject: [PATCH] Document the `paths:` key in `behat.yml` to run tests located in contributed modules (#371) * Update behat-sub.yml * Update subcontexts.rst --- doc/_static/snippets/behat-sub.yml | 2 ++ doc/subcontexts.rst | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/_static/snippets/behat-sub.yml b/doc/_static/snippets/behat-sub.yml index 785db85a..0096b721 100644 --- a/doc/_static/snippets/behat-sub.yml +++ b/doc/_static/snippets/behat-sub.yml @@ -5,6 +5,8 @@ default: - FeatureContext - Drupal\DrupalExtension\Context\DrupalContext - Drupal\DrupalExtension\Context\MinkContext + paths: + - "./path_to_module/features" extensions: Behat\MinkExtension: goutte: ~ diff --git a/doc/subcontexts.rst b/doc/subcontexts.rst index b2365f5d..a67dadff 100644 --- a/doc/subcontexts.rst +++ b/doc/subcontexts.rst @@ -17,14 +17,15 @@ behat.yml .. literalinclude:: _static/snippets/behat-sub.yml :language: yaml :linenos: - :emphasize-lines: 22-24 + :emphasize-lines: 8-9,25-26 The Drupal Extension will search recursively within the directory or directories specified to discover and load any file ending in `.behat.inc`. This system, although created with Drupal contrib projects in mind, searches where it's pointed, so you can also use it for your own subcontexts, a strategy you might employ to re-use step definitions particular to your shop or company's -development patterns. +development patterns. The `paths` key allows running tests located in features +within the `features` directory of a contributed/custom module. Disable autoloading -------------------