If you are not using composer.json on the remote Drupal site, then copy the entire contents of this project to either ROOT/drush or ROOT/sites/all/drush, then cd behat-drush-endpoint and run composer install.
The Behat Drush Endpoint is the remote component needed to work with the Behat Drupal Driver.
The Behat Drupal Driver contains three drivers: Blackbox, Direct Drupal API, and Drush. The Behat Drush Endpoint is only necessary when using the Drush driver.
Installation Instructions
If you are managing your Drupal site with Composer, then add the Behat Drush Endpoint to your project as follows:
If you are not using composer.json on the remote Drupal site, then copy the entire contents of this project to either ROOT/drush or ROOT/sites/all/drush, then cd behat-drush-endpoint and run composer install.
Behat Throws Error When Attempting To Call Drush
T:\git\behatmink (master -> origin)
λ bin\behat -c tests\behat\behat-drush.yml
Feature: Drush alias
In order to demonstrate the Drush driver
As a trainer
I need to show how to tag scenarios
Scenario: Untagged scenario uses blackbox driver and fails # features\Drush\DrushTests.feature:6
Given I am logged in as a user with the "authenticated user" role # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
No ability to generate random in Drupal\Driver\BlackboxDriver. Put `@api` into your feature and add an API driver (ex: `api_driver: drupal`) in behat.yml. (Drupal\Driver\Exception\UnsupportedDriverActionException)
When I click "My account" # Drupal\DrupalExtension\Context\MinkContext::assertClick()
Then I should see the heading "History" # Drupal\DrupalExtension\Context\MinkContext::assertHeading()
@api
Scenario: Tagged scenario uses Drush driver and succeeds # features\Drush\DrushTests.feature:12
Given I am logged in as a user with the "authenticated user" role # Drupal\DrupalExtension\Context\DrupalContext::assertAuthenticatedByRole()
'drush' is not recognized as an internal or external command,
operable program or batch file.
(RuntimeException)
When I click "My account" # Drupal\DrupalExtension\Context\MinkContext::assertClick()
Then I should see the heading "History" # Drupal\DrupalExtension\Context\MinkContext::assertHeading()
If you are managing your Drupal site with Composer, ensure that your composer.json contains the following entries:
``` json
{
"require-dev": {
"drush-ops/behat-drush-endpoint": "*",
"drupal/drupal-driver": "dev-master"
},
}
Adding drupa/drupal-driver Failed
T:\git\behatmink (master -> origin) λ php composer.phar require --dev drupal/drupal-driver:dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/drupal-extension v3.4.1 requires drupal/drupal-driver ~1.3 -> satisfiable by drupal/drupal-driver[1.3.x-dev, 1.4.x-dev].
- drupal/drupal-extension v3.4.1 requires drupal/drupal-driver ~1.3 -> satisfiable by drupal/drupal-driver[1.3.x-dev, 1.4.x-dev].
- drupal/drupal-extension v3.4.1 requires drupal/drupal-driver ~1.3 -> satisfiable by drupal/drupal-driver[1.3.x-dev, 1.4.x-dev].
- Can only install one of: drupal/drupal-driver[dev-master, 1.3.x-dev].
- Can only install one of: drupal/drupal-driver[dev-master, 1.4.x-dev].
- Installation request for drupal/drupal-driver dev-master -> satisfiable by drupal/drupal-driver[dev-master].
- Installation request for drupal/drupal-extension (locked at v3.4.1, required as ~3.0) -> satisfiable by drupal/drupal-extension[v3.4.1].
Installation failed, reverting ./composer.json to its original content.
CMDER: Install Drush Launcher phar to PATH
Behat Feature Files were failling due to 'drush' command not found
Installed Drush Launcher to the cmder/bin folder & created a windows batch file to call it with PHP
curl drush.phar to cmder's /bin folder ( so that its in the PATH )