Beheaded on behat
Submitted by clemens on Tue, 2014/07/01 - 2:50pm
As my behavior is not driven by skills I jump into Behat or Behavior Driven Development or BDD for short to BDD Drupal 8. Installing Behat is a no brainer as written down on http://behat.org/ home page. But what if one needs extensions. That is a little asking for trouble as both Behat 2 and Behat 3 exists.
This is what happened to me.
Feature: Test Drupal 8
How to connect to a Drupal 8
Scenario: Run behat without extensions
Given I try to connect to "http://drupal.d8"
Then I should fail
Scenario: Run behat with mink extension
Given I try to connect to "http://drupal.d8"
Then I should suggest
And
We did implement Behat on our internal Symfony2 app together with Selenium so I had a good chance of getting to work on Drupal 8 with https://www.drupal.org/project/drupalextension.
Unfortunately I choose to work with Behat 3 doing composer require behat/behat:~3
. But configuration file for behat.yml and the path for extensions changed.
vendor/bin/behat --config-reference
vendor/bin/behat --config-reference --profile=drupal8
Behat 2
Behat 3
default:
extensions:
Behat\MinkExtension:
goutte: ~
selenium2: ~
base_url: http://drupal.d8/
Drupal\DrupalExtension:
blackbox: ~