Skip to content

Seretos/BehatJsonFormatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BehatJsonFormatter

Build Status

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

About

a json result generator for behat tests

Resources

Stars

Watchers

Forks

Packages

No packages published