soyuka / contexts
Behatch contexts
Installs: 1 072 874
Dependents: 10
Suggesters: 0
Security: 0
Stars: 27
Watchers: 4
Forks: 203
Language:Gherkin
Requires
- php: >=8.0
- behat/behat: ^3.0.13
- friends-of-behat/mink-extension: ^2.3.1
- justinrainbow/json-schema: ^5.0|^6.0
- symfony/dom-crawler: ^2.4|^3.0|^4.0|^5.0|^6.0|^7.0
- symfony/http-foundation: ^2.3|^3.0|^4.0|^5.0|^6.0|^7.0
- symfony/property-access: ^2.3|^3.0|^4.0|^5.0|^6.0|^7.0
Requires (Dev)
- atoum/atoum: ^4.0
- atoum/stubs: ^2.6
- behat/mink-goutte-driver: ^1.1
- behat/mink-selenium2-driver: ^1.6
- fabpot/goutte: ^3.2
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: ^9.5
Replaces
- sanpi/behatch-contexts: v3.3.13
- dev-main
- v3.3.13
- v3.3.12
- v3.3.11
- v3.3.10
- v3.3.9
- v3.3.8
- v3.3.7
- v3.3.6
- v3.3.5
- v3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.8.1
- 2.8.0
- 2.7.1
- 2.7
- 2.6.1
- 2.6
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0
- dev-add-gh-actions
- dev-fix-json-not-null
- dev-rest-dot-parameters
- dev-phpstan
- dev-selenium
- dev-behat-2.x
This package is auto-updated.
Last update: 2024-11-08 14:13:13 UTC
README
Behatch contexts provide most common Behat tests.
Installation
This extension requires:
- Behat 3+
- Mink
- Mink extension
Project dependency
- Install Composer
- Require the package with Composer:
$ composer require --dev soyuka/contexts
- Activate extension by specifying its class in your
behat.yml
:
# behat.yml default: # ... extensions: Behatch\Extension: ~
Project bootstraping
- Download the Behatch skeleton with composer:
$ php composer.phar create-project behatch/skeleton
Browser, json, table and rest step need a mink configuration, see Mink extension for more information.
Usage
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
Examples
This project is self-tested, you can explore the features directory to find some examples.
Configuration
browser
- more browser related steps (like mink)timeout
- default timeout
debug
- helper steps for debuggingscreenshotDir
- the directory where store screenshots
system
- shell related stepsroot
- the root directory of the filesystem
json
- JSON related stepsevaluationMode
- javascript "foo.bar" or php "foo->bar"
table
- play with HTML the tablesrest
- send GET, POST, ... requests and test the HTTP headersxml
- XML related steps
Configuration Example
For 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"