Behat integration

integration of Drupal runtime (bootstrap)
status: green

integration of SimpleTest test setup routine
status: green

use SimpleTest API functions and assertions in step definitions
status: green

Behat library and components
goal: it shouldn't be necessary to manually download and install behat nor extra components such as Gherkin, Symfony
status: red

Behat admin interface

rationale: not everyone has access to a console or doesn't want to learn unix commands
feature scope: plain interface to behat; no extra test case management functionalities;
status: red

* internal module callback to pass commands to behat
* user interface for behat commands + documentation of commands
* manage behat.yml configuration

Nice to haves

- Drush integration
- a demo site that runs headless tests and displays behat results


al.ex’s picture

Title: module features » module feature roadmap
zroger’s picture

I've created a sandbox project (tentatively named scenario) that integrates drush, behat and mink. It takes a different approach than what you have here, but I there is also some overlap. I'm not sure the two approaches are compatible, but it might make sense to try to combine our efforts.


  • Bootstraps Drupal
  • Uses behat

In Scenario but not Behat.module

  • Drush integration
  • Automatic install of dependencies (composer, behat, mink, symfony, etc)
  • Loads behat.yml and features directory from site directory. This works really well with drush aliases.
  • Generator for creating behat.yml and features directory
  • Base url set dynamically from drush alias

In Behat.module, but not Scenario

  • SimpleTest integration. Scenario doesn't use simpletest at all.
  • Admin interface

Basic usage of scenario is:

drush @site-alias scenario-run [--profile=profilename]

This will run behat using the config file and features from the site directory of @site-alias.

drush @site-alias scenario-init

This will generate behat.yml, FeatureContext.php and the features directory in the site directory of @site-alias.

drush @site-alias scenario-defs

This will display the available step definitions, like behat -dl.

All commands will validate the existence of the behat dependencies, and try to install them if they don't exist.

al.ex’s picture

Wow, sounds awesome! I'll take a closer look at it as soon as I return from holiday in two weeks. How about adding a brief README.txt that documents installation and usage just as you've explained above?


e3g’s picture

The article in Aug 2012 Drupal Watchdog on Behat & Mink references this project at the very end. So if I have Behat & Mink installed and working, the Behat integration module as it stands today just adds the Simpletest integration? Is that mainly to provide backwards compatibility for sites that already have a test suite in Simpletest?

e3g’s picture

Issue summary: View changes

moving "Behat library and components" down in list