Introduction to Behat Drupal Extension

Profile picture for user devraj

The Drupal Extension is an integration layer between Behat, Mink Extension, and Drupal. It provides step definitions for common testing scenarios specific to Drupal sites. The Drupal Extension 4 supports Drupal 6, 7 and 8, and utilized Behat 3.2+ and runs on PHP 5.5+. For Drupal 6 support (or Behat 2), use the 1.0 version.

The Drupal Extension to Behat and Mink assists in the performance of these common Drupal testing tasks:

  • Set up test data with Drush or the Drupal API. You can create node, users, vocabularies, taxonomy
  • Define theme regions and test data appears within them
  • Clear the cache, log out, and other useful steps
  • Detect and discover steps provided by contributed modules and themes

How Behat, Mink and Drupal Extension work together

  • Behat is a test framework for behavior-driven development (BDD) written in the PHP programming language. 
  • Mink removes API differences between different browser emulators providing different drivers for every browser emulator and providing you with an easy way to control the browser, traverse pages, manipulate page elements or interact with them.
  • Drupal Extension help in automation for Drupal Websites. The Drupal Extension to Behat and Mink assists in the performance of several common Drupal testing tasks.