- Docker (Community Edition)
- Docker Compose
- Git
- PHP7
- Composer
- Behat
- Mink
- MinkExtension
- Behat Drupal Extension
- Selenium (Standalone Chrome and Standalone Firefox)
git clone [email protected]:mtift/behat-selenium.git
- Move to the necessary directory:
cd behat-selenium/tests
- Start docker:
docker-compose up -d
- Run all tests:
./run-behat
- To test your site, add features in the
tests/features
directory. - Run
./run-behat -dl
to see a list of available gherkin commands. - Add custom gherkin commands to
tests/features/bootstrap/FeatureContext.php
. - Use the @javascript tag to test your javascript code.
- Use the @api tag to test your Drupal code.
- To run the tests for a single feature:
./run-behat features/drupal.feature
- To test a different site, change the "base_url" value in
tests/behat.yml
. - Shut down docker:
docker-compose down
- To view the HTML report of your tests, visit
http://<your-docker-host-ip>:8000/html_report
(e.g.http://localhost:8000/html_report
) or openbehat-selenium/tests/html_report/index.html
- This project was created as a PHP-specific replacement for Selenium IDE tests
- This project was inspired by: