gherkin-preprocessor v1.2.0
Gherkin preprocessor
Allows some preprocess tecniques for Gherkin files, such as including partials or evaluating if statements.
Directive syntax
This module leverage on the preprocess module, so check its documentation for directive's syntax. Just make sure to place them in a Gherkin comment:
#@include ../../partials/_go_to_cart.featureInstallation
Install gherkin-preprocessor as a common node module, either locally or globally:
npm install [-g] gherkin-preprocessoror clone the repo
https://github.com/fbedussi/gpp
and install it as a module with npm link.
Usage
buildGherkin [optionName=option] [optionName=option] [optionName=option]Options
source
Default: 'features_src'
buildGherkin source=mySourceFolderThe source folder path (relative or absolute)
dest
Default: 'features'
buildGherkin dest=myDestFolderThe destination folder path (relative or absolute)
w
buildGherkin wWatch source folder for changes
exclude
Default: 'partials'
buildGherkin exclude=myPartialThe name of the folder to exclude
excludeRegExp
buildGherkin excludeRegExp=partial|otherFolderThe regExp pattern to match the folder(s) to exclude
env
buildGherkin env=prodThe name of the environment in which the Gherkin is intended to run, e.g. "prod", "dev", ecc. This variable could be used in if statements:
#@if env='prod'
@prod
#@endif
#@if env='dev'
@dev
#@endifThe code above will render the @prod tag in the compiled Gherkin if env is set to prod, or the tag @dev if it's set to dev.
varFile
buildGherkin varFile=myVar.jsonThe path to a json file containing the variables to be used by the preprocessor in if statements.
Examples
buildGherkin source=mySourceFolder dest=myDestFolder exclude=myPartial