@@ -4,7 +4,26 @@ This composer plugin prepares your Drupal project for Behat tests.
## Requirements
tbd
The plugin works with any composer based Drupal project and can be added to such projects with `composer require lakedrops/behat4drupal`. It's recommended to also use the Docker4Drupal plugin (added with `composer require lakedrops/docker4drupal`) which will provide all the Docker containers for your development environment as well as those for Selenium and Chrome.
If your project is based on the [Drupal 8 Project Template](https://gitlab.lakedrops.com/composer/project/drupal-8) then everything is already included for you automatically.
## Usage
You will find links to further documentation on how to write Behat tests at the end of this file. Here we simply describe on how you can run your tests once they have been defined.
### Command line
You need to execute Behat inside of the Php Docker container. From the root of your project you can launch the containers with `docker-compose up -d` and then enter the Php container with `docker-compose exec --user root php sh`.
Inside of the container you'll be located at `/var/www/html` and in that directory you can run the Behat test suite with the command `vendor/bin/behat --no-interaction --config /var/www/html/tests/behat/behat.yml`
### PhpStorm
In any of the JetBrains IDEs you can call the Behat tests directly from the UI when preparing the project in 2 steps beforehand:
- Configure the PHP CLI interpreter: Go to the project settings in **Languages & Frameworks > PHP** and configure the remote PHP interpreter for Docker similar to [this screenshot](https://gitlab.lakedrops.com/composer/plugin/behat4drupal/uploads/f045b58e9ae4e6f8f0c3ea44baea2402/2018-09-12_16_22_46_screen.jpg)
- Configure the Run/Debug Configuration: Simply select Behat and of you go, see [this second screenshot](https://gitlab.lakedrops.com/composer/plugin/behat4drupal/uploads/f2f33070f711e891a0b61cdea04d1116/2018-09-12_16_25_05_screen.jpg)