Behat Drupal Extension extends the popular Behat Drupal Extension in order to provide the following features:
- Additional step definitions covering contributed modules, core functionality and popular third-party plugins.
- Contexts can access the global Behat service container.
- Developers can organize their test using dependency injection by declaring their services in a YAML file and/or override default Behat services.
- Developers can override Drupal driver core classes and allow their step definitions to run transparently on different Drupal core versions.
For more information please check the documentation.
Mink is a browser emulators abstraction layer.
It defines a basic API through which you can talk with specific browser emulator libraries.
Mink drivers define a bridge between Mink and those libraries.
-
Clone this repo/project which has all the drupal and behat dependencies
-
Move all the child directories of this project(from "core" directory till web.config file) under your MAMP server location (/Applications/MAMP/htdocs) (Prerequisite : MAMP/WAMP/LAMP should be installed in your device) -- To install mamp in your device please refer site.
-
Run
composer install
(Prerequisite-composer should be install in your device) -- To install composer in your device please refer documentation. -
Setup the site on your local machine
-
update local site url in the behat.yml file for all the profiles, placed in your project root directory. site url is added for the: "Drupal\MinkExtension"
default:
suites:
...
formatters:
...
extensions:
Drupal\MinkExtension:
...
base_url: http://localhost:8888
...
- Execute your all behat tests from /Applications/MAMP/htdocs in browser mode
vendor/bin/behat
or to execute test in headless mode
vendor/bin/behat --profile="headless"
Note: 8_deleteTestMedia.feature is added only to delete dummy media from the application generated due to file upload behat scenario.