This add-on integrates Behat into your DDEV project, providing a convenient ddev behat command that runs Behat tests inside the web container.
ddev add-on get Metadrop/ddev-behat
ddev restartAfter installation, make sure to commit the .ddev directory to version control.
Once installed, you can run Behat tests using:
# Run all Behat tests
ddev behat
# Run specific feature file
ddev behat features/example.feature
# Run with specific tags
ddev behat --tags=@smoke
# Get help
ddev behat --helpBehat configuration should be placed in your project's behat.yml file. Example:
default:
suites:
default:
contexts:
- FeatureContext
extensions:
Behat\MinkExtension:
base_url: http://web
selenium2:
wd_host: http://selenium:4444/wd/hubBehat and its dependencies should be installed via Composer in your project:
ddev composer require --dev behat/behat
ddev composer require --dev drupal/drupal-extension # For Drupal projectsContributed and maintained by @Metadrop