Daniel Siepmann
3ba3c1f4e2
* Added hint about writing tests in native language, e.g. German, with one example. |
||
---|---|---|
features/simple-examples/daniel-siepmann | ||
.gitignore | ||
behat.yml | ||
composer.json | ||
composer.lock | ||
LICENSE.txt | ||
readme.md |
This repository will provide all you need to get you up and running with Behat and mink in a basic setup.
Install
- Install Composer
- Clone the repository, or download.
- Run
composer install
from within the repository.
Withbin/behat -di
you can verify whether Behat works and the language is available to write website tests.
For non headless browser
Headless means without a GUI, just CLI. This is default for this setup. So all your tests are run without a GUI of an actual browser.
To use a real browser like Firefox, you need to install selenium standalone server, in addition, by downloading from http://www.seleniumhq.org/download/
Execute
Per default you just can run your tests. Therefor execute: bin/behat features
.
If you wanna see your tests running in real time inside the browser, or need a
specific feature, you need to start the selenium server before running the
tests.
Start selenium server: java -jar bin/selenium-server-standalone-2.48.2.jar
.
Modify the call to match path and filename of downloaded server.
Uncomment the line containing default_session
in behat.yml
, then run your
tests again.
Extending
Once the tests work you are set to start your own. Just follow the official documentation and write your own tests.
Support
Native support is given for Firefox. This repository aims to provide basic support to get you started. For full support contact us or dive deeper on your own.
Further languages
English for your tests works out of the box. But it also will provide further
languages, e.g. German. To verify your language exists, run ./bin/behat --lang de -di
. If it exists, e.g. German in this case, you should get a list of
available definitions. In addition you can run ./bin/behat --story-syntax --lang de
to get information how to write the stories in your language.
Note, what the last command points out, you have to add the language at the
beginning, with a leading #
. E.g.: # language: de
.
Further resources
- http://docs.behat.org/en/v2.5/
- http://mink.behat.org/en/latest/index.html
- http://blog.lepine.pro/images/2012-03-behat-cheat-sheet-en.pdf
For further features
- PHPStorm plugin for Behat: http://projectspace.pl/plugins/behat/screenshots/
- Diff Screenshots from Testsessions: https://github.com/jadu/BehatPerceptualDiffExtension
- Web GUI for all your features: https://github.com/Halleck45/BDDWizard