Behatch contexts provide most common Behat tests.
This extension requires:
$ composer require --dev behatch/contexts
behat.yml
:# behat.yml
default:
# ...
extensions:
Behatch\Extension: ~
$ php composer.phar create-project behatch/skeleton
Browser, json, table and rest step need a mink configuration, see Mink extension for more information.
In behat.yml
, enable desired contexts:
default:
suites:
default:
contexts:
- behatch:context:browser
- behatch:context:debug
- behatch:context:system
- behatch:context:json
- behatch:context:table
- behatch:context:rest
- behatch:context:xml
This project is self-tested, you can explore the features directory to find some examples.
browser
- more browser related steps (like mink)
timeout
- default timeoutdebug
- helper steps for debugging
screenshotDir
- the directory where store screenshotssystem
- shell related steps
root
- the root directory of the filesystemjson
- JSON related steps
evaluationMode
- javascript "foo.bar" or php "foo->bar"table
- play with HTML the tablesrest
- send GET, POST, ... requests and test the HTTP headersxml
- XML related stepsFor example, if you want to change default directory to screenshots - you can do it this way:
default:
suites:
default:
contexts:
- behatch:context:debug:
screenshotDir: "var"