seretos / behat-json-formatter
this library extends behat with an json formatter and publish commands to manage this generated json files
Installs: 1 905
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
- behat/behat: ^3.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- symfony/config: ^3.2
- symfony/console: ^3.2
- symfony/dependency-injection: ^3.2
- symfony/finder: ^3.2
- symfony/http-kernel: ^3.2
- symfony/yaml: ^3.2
- twig/twig: ^1.33|^2.0
Requires (Dev)
- phpunit/phpunit: ^5.7
README
this library extend the behat library with an json formatter. this formatter generate for every suite an json format the executed features,scenarios and steps. the library also saved the executed environment (firefox,IE,...) result. Every browserless environment will be saved as "unknown"
this library provides also different commands to validate and merge multiple generated json files.
Installation
execute the following command as below
$ composer require seretos/BehatJsonFormatter
Usage
add the following lines to your behat config yml
... extensions: seretos\BehatJsonFormatter\BehatJsonFormatterExtension: output_path: '%paths.base%/build/behat' #step_screenshots: true #save a screenshot for every selenium step
now your execution generates for every suite an json file into the output-path. if you run multiple tests on different machines, you can use the following commands to manage your json results:
$ php vendor/bin/behat-json behat:double:result:check --jsonDir=./artifacts1 \
--jsonDir=./artifacts2 \
--pattern="/[\w]*php71/"
this command search in the given directories and with pattern for json files and check, that every test only executed one time per environment
php vendor/bin/behat-json behat:merge:result --jsonDir=./artifacts1 \
--jsonDir=./artifacts2 \
--pattern="/[\w]*php71/" \
--output=result.json
php vendor/bin/behat-json behat:validate:result --json=./result.json \ --featureDir=./features