drupal/drupal-extension

Drupal extension for Behat

Fund package maintenance!
jhedstrom

Installs: 14 961 365

Dependents: 193

Suggesters: 0

Security: 0

Stars: 211

Watchers: 24

Forks: 193

Open Issues: 95

Type:behat-extension

pkg:composer/drupal/drupal-extension

v5.2.0 2026-03-03 15:03 UTC

This package is auto-updated.

Last update: 2026-03-04 01:08:13 UTC


README

Behat Drupal Extension Logo

Behat Drupal Extension

Latest Stable Version Total Downloads Latest Unstable Version License

ci GitHub Issues GitHub Pull Requests Documentation Status

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.

Use it for testing your Drupal site.

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

Quick start

  1. Install using Composer:

    composer require --dev drupal/drupal-extension
  2. Create a file called behat.yml with a minimal configuration. For more information on configuration options, see Full documentation

    default:
      autoload: ['%paths.base%/tests/bootstrap']
      suites:
        default:
          paths: ['%paths.base%/tests/features']
          contexts:
            - Drupal\DrupalExtension\Context\DrupalContext
      extensions:
        Drupal\MinkExtension:
          browserkit_http: ~
          base_url: http://example.org/  # Replace with your site's URL
        Drupal\DrupalExtension:
          blackbox: ~
  3. Initialize Behat in your project:

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

    vendor/bin/behat -di
  5. Optionally, define your own steps in tests/bootstrap/FeatureContext.php

  6. Start adding your feature files to the tests/features directory of your repository.

Credits

Additional resources

Examples and code snippets

Release notes

See CHANGELOG.

Contributing

Features and bug fixes are welcome!

See CONTRIBUTING.md for more information.