1 Feature: Ability to find Drupal sub-contexts
2 In order to facilitate maintainable step-definitions
4 I need to be able to define step-definitions within corresponding Drupal modules or projects
7 Given a file named "foo.behat.inc" with:
11 use Behat\Behat\Tester\Exception\PendingException;
13 use Drupal\DrupalExtension\Context\DrupalSubContextInterface;
14 use Drupal\DrupalDriverManager;
16 class FooFoo implements DrupalSubContextInterface {
20 public function __construct(DrupalDriverManager $drupal) {
21 $this->drupal = $drupal;
25 * @Then /^I should have a subcontext definition$/
27 public function assertSubContextDefinition() {
28 throw new PendingException();
32 And a file named "features/foo.feature" with:
34 Feature: Test foo subcontext
36 Scenario: Test foo subcontext
37 Given I should have a subcontext definition
39 And a file named "behat.yml" with:
44 contexts: [Drupal\DrupalExtension\Context\DrupalContext]
49 base_url: http://drupal.org
50 Drupal\DrupalExtension:
56 Scenario: Step-definitions in sub-contexts are available
57 When I run "behat --no-colors -dl"
58 Then the output should contain:
60 Then /^I should have a subcontext definition$/
63 Scenario: Subcontext can be instantiated
64 When I run "behat --no-colors"
65 Then the output should contain:
67 TODO: write pending definition