Skip to content
Nuvole's Behat Drupal Extension.
Branch: 1.x
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.github_changelog_generator
.gitignore
.scrutinizer.yml
.travis.yml
CHANGELOG.md
LICENSE.txt
README.md
behat-8.3.x-dev.yml
behat-8.4.x-dev.yml
behat-8.5.x-dev.yml
behat-8.6.x-dev.yml
behat.yml.dist
composer.json
docker-compose.yml
grumphp.yml.dist
phpunit.xml.dist
runner.yml.dist
services.yml

README.md

Behat Drupal Extension

Build Status Scrutinizer Code Quality Latest Stable Version Latest Unstable Version Total Downloads License

Nuvole's Behat Drupal Extension extends the popular Behat Drupal Extension in order to provide the following features:

  • Additional step definitions covering contributed modules, core functionality and popular third-party plugins.
  • Contexts can access the global Behat service container.
  • Developers can organize their test using dependency injection by declaring their services in a YAML file and/or override default Behat services.
  • Developers can override Drupal driver core classes and allow their step definitions to run transparently on different Drupal core versions.

For more information please check the documentation.

Installation and setup

Install Nuvole's Behat Drupal Extension with Composer by running:

$ composer require nuvoleweb/drupal-behat

Setup the extension by following the Quick start section available on the original Behat Drupal Extension page, just use NuvoleWeb\Drupal\DrupalExtension instead of the native Drupal\DrupalExtension in your behat.yml as shown below:

default:
  suites:
    default:
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
        - NuvoleWeb\Drupal\DrupalExtension\Context\DrupalContext
        ...
  extensions:
    Behat\MinkExtension:
      goutte: ~
      ...
    # Use "NuvoleWeb\Drupal\DrupalExtension" instead of "Drupal\DrupalExtension".
    NuvoleWeb\Drupal\DrupalExtension:
      api_driver: "drupal"
      ...
      services: "tests/my_services.yml"
      text:
        node_submit_label: "Save and publish"

Extension settings

Nuvole's Behat Drupal Extension accepts all parameters of the original Behat Drupal Extension and it provides the following additional ones:

Parameter Description
services: "tests/my_services.yml" Path to your custom service definition YAML file.
text.node_submit_label: "Save and publish" Label of node form submit button (different in Drupal 7/6 and Drupal 8).

Additional resources

You can’t perform that action at this time.