With composer and built on php:5.6-apache
362
A self-contained Docker image to run Behat with no external dependencies.
Features:
Use this image using the example folder as the basis to start.
Sample setup and tests can be found in the example folder.
Features:
git clone https://github.com/https://github.com/waynetheisinger/behat behat
cd behat/example
docker-compose up -d
./tools/runbehat features/basket.feature
To run Behat tests that require a real browser (e.g. for JavaScript support) a headless Selenium Chrome/Firefox can be used.
In this case, you get two containers - one running a built-in PHP server for access to HTML reports and one running Selenium. Behat runs within the first container and talks to the Selenium container to run tests with a real browser (Chrome/Firefox).
Uncomment a respective line in docker-compose.yml:
# Pick/uncomment one
image: selenium/standalone-chrome
#image: selenium/standalone-firefox
Update container configuration
docker-compose up -d
Update behat.yml as necessary
Chrome
browser_name: chrome
selenium2:
wd_host: http://browser:4444/wd/hub
capabilities: { "browser": "chrome", "version": "*" }
Firefox
browser_name: firefox
selenium2:
wd_host: http://browser:4444/wd/hub
capabilities: { "browser": "firefox", "version": "*" }
Run tests
HTML report will be generated into the html_report folder.
It can be accessed by navigating to http://<your-docker-host-ip>:8000/html_report in your browser.
Replace <your-docker-host-ip> as necessary (e.g. localhost).
The following command will start a bash session in the container.
docker exec -itu appuser $(docker-compose ps -q behat) bash
This is my base container at the start of a BDD or TDD project however, you will probably finding yourself needing to install more testing frameworks.
For instance:
And Static analysis tools:
see Php the right way for more details
Content type
Image
Digest
Size
218.7 MB
Last updated
over 7 years ago
docker pull wayneintacart/behat