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
Requires
- php: >=8.2
- behat/behat: ^3.22
- behat/gherkin: ^4.13
- behat/mink: ^1.12
- behat/mink-browserkit-driver: ^2.1.0
- drupal/drupal-driver: ^2.4
- friends-of-behat/mink-extension: ^2.7.1
- lullabot/mink-selenium2-driver: ^1.7
- symfony/css-selector: ^6.4.3 || ^7
- symfony/dom-crawler: ^6.4.3 || ^7
- symfony/http-client: ^6.4.3 || ^7
- webflo/drupal-finder: ^1.2
Requires (Dev)
- composer/installers: ^2.3
- dantleech/gherkin-lint: ^0.2.3
- drevops/behat-screenshot: ^2.2
- drevops/phpcs-standard: ^0.6.2
- drupal/coder: ^8.3.27
- drupal/core: ^11
- drupal/core-composer-scaffold: ^11
- drush/drush: ^12.5 || ^13.7
- ergebnis/composer-normalize: ^2.50
- grasmash/yaml-cli: ^3.2.1
- guzzlehttp/guzzle: ^7.8.2
- guzzlehttp/promises: ^2.0.3
- guzzlehttp/psr7: ^2.6.3
- justinrainbow/json-schema: ^5.3
- league/container: ^4.2
- masterminds/html5: ^2.8
- php-parallel-lint/php-parallel-lint: ^1.4
- phpspec/phpspec: ^7.0 || ^8.0
- phpstan/phpstan: ^2.1
- rector/rector: ^2.0
- symfony/browser-kit: ^6.4.3 || ^7
- symfony/config: ^6.4.3 || ^7
- symfony/console: ^6.4.3 || ^7
- symfony/dependency-injection: ^6.4.3 || ^7
- symfony/event-dispatcher: ^6.4.3 || ^7
- symfony/event-dispatcher-contracts: ^3.4.2
- symfony/filesystem: ^6.4.3 || ^7
- symfony/http-kernel: ^6.4.3 || ^7
- symfony/mime: ^6.4.3 || ^7
- symfony/routing: ^6.4.3 || ^7
- symfony/translation-contracts: ^3.4.2
- symfony/var-exporter: ^6.4.3 || ^7
- symfony/yaml: ^6.4.3 || ^7
- webmozart/assert: ^2
- dev-main
- v5.2.0
- 5.1.x-dev
- v5.1.0
- 5.0.x-dev
- v5.0.0
- v5.0.0rc1
- v5.0.0alpha1
- 4.2.x-dev
- v4.2.1
- 4.1.x-dev
- v4.1.0
- 4.0.x-dev
- v4.0.1
- v4.0.0
- v4.0.0rc1
- v4.0.0beta2
- v4.0.0beta1
- v4.0.0alpha4
- v4.0.0alpha3
- v4.0.0alpha2
- v4.0.0alpha1
- 3.4.x-dev
- v3.4.1
- v3.4.0
- 3.3.x-dev
- v3.3.1
- v3.3.0
- 3.2.x-dev
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- 3.1.x-dev
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- 3.1.0
- 3.0.x-dev
- v3.0.13
- v3.0.12
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- 3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 1.0.x-dev
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-feature/fix-comments-indent
- dev-feature/update-changelog-5.2
- dev-feature/simplify-feature-context
- dev-feature/update-tests
- dev-feature/add-phpstan-rector
- dev-feature/add-behat-screenshot
- dev-feature/fix-cs-spec
- dev-feature/update-readme
- dev-feature/move-build-artifact
- dev-feature/update-config-files
- dev-feature/move-tests
- dev-feature/separate-commands
- dev-feature/remove-obsolete-gherklinlint-file
- dev-fature/replace-gherkinlint
- dev-feature/default-to-drupal-11
- dev-feature/test-lower-upper-deps-ci
- dev-feature/add-release-drafter
- dev-feature/add-php-version-contraint
- dev-feature/normalise-composerjson
- dev-feature/php84-compat
- dev-feature/fix-ci-mar26
- dev-feature/add-composer-normalizer
- dev-feature/improve-ci
- dev-feature/remove-php7.4-ci
- dev-488-backend-authentication
- dev-prep-4.0
- dev-string-handlers
- dev-490-simplify-testing
- dev-tmp-driver-test
- dev-259-follow-up
- dev-eliza411-patch-1
- dev-fix-drush-endpoint-tests-again
- dev-fix-drush-endpoint-tests
- dev-fix-blackbox-tests
- dev-fix-d8
This package is auto-updated.
Last update: 2026-03-04 01:08:13 UTC
README
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.
Use it for testing your Drupal site.
If you're new to the Drupal Extension, we recommend starting with the Full documentation
Quick start
-
Install using Composer:
composer require --dev drupal/drupal-extension
-
Create a file called
behat.ymlwith a minimal configuration. For more information on configuration options, see Full documentationdefault: 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: ~
-
Initialize Behat in your project:
vendor/bin/behat --init
-
Find pre-defined steps to work with using:
vendor/bin/behat -di
-
Optionally, define your own steps in
tests/bootstrap/FeatureContext.php -
Start adding your feature files to the
tests/featuresdirectory of your repository.
Credits
- Originally developed by Jonathan Hedstrom with great help from eliza411
- Maintainers
Additional resources
Examples and code snippets
- Complex node creation, with field collections and entity references
- Achievements module support
- Drupal form element visibility
- Track down PHP notices
- Support for sites using basic HTTP authentication
Release notes
See CHANGELOG.
Contributing
Features and bug fixes are welcome!
See CONTRIBUTING.md for more information.