Awesome Open Source
Awesome Open Source

Behat Drupal Extension

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.

Build Status

The Drupal Extension 4.x supports Drupal 7, 8, and 9, utilizes Behat 3.2+ and runs on PHP 7.3+. It is compatible with Symfony components 3.x as well as 4.x so it can be used on Drupal 8 and 9.

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

Use it for testing your Drupal site.

If you're new to the Drupal Extension, we recommend starting with the Full documentation

Documentation Status

Quick start

  1. Install using Composer:

    mkdir projectdir
    cd projectdir
    curl -sS | php
    COMPOSER_BIN_DIR=bin php composer.phar require drupal/drupal-extension='~4.0'
  2. In the projectdir, create a file called behat.yml. Below is the minimal configuration. Many more options are covered in the Full documentation

        - Drupal\DrupalExtension\Context\DrupalContext
      goutte: ~
      base_url:  # Replace with your site's URL
      blackbox: ~
  1. In the projectdir, run

    bin/behat --init
  2. Find pre-defined steps to work with using:

    bin/behat -di
  3. Define your own steps in projectdir\features\FeatureContext.php

  4. Start adding your feature files to the features directory of your repository.


Additional resources

Examples and code snippets

Release notes



Features and bug fixes are welcome! First-time contributors can jump in with the issues tagged good first issue.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
php (16,621
drupal (73
behat (23