Allows some preprocessing tecniques for Gherkin files, such as importing partials and if statements
npm install gherkin-preprocessor
#@include ../../partials/_go_to_cart.feature
``
Installation
Install gherkin-preprocessor as a common node module, either locally or globally:
``
npm install [-g] gherkin-preprocessor
``
or 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
$3
Default: 'features_src'
``
buildGherkin source=mySourceFolder
``
The source folder path (relative or absolute)
$3
Default: 'features'
``
buildGherkin dest=myDestFolder
``
The destination folder path (relative or absolute)
$3
``
buildGherkin w
``
Watch source folder for changes
$3
Default: 'partials'
``
buildGherkin exclude=myPartial
``
The name of the folder to exclude
$3
``
buildGherkin excludeRegExp=partial|otherFolder
``
The regExp pattern to match the folder(s) to exclude
$3
``
buildGherkin env=prod
``
The 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
#@endif
``
The 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.
$3
``
buildGherkin varFile=myVar.json
``
The 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
```