Type object
File match .gherking.json .gherkingrc gherking.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/gherking/latest.json
Source https://raw.githubusercontent.com/gherking/gherking/master/schema/gherking.schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

compilers gpcCustom | gpcFilter | gpcForLoop | gpcLicense | gpcMacro | gpcRemoveComments | gpcRemoveDuplicates | gpcReplacer | gpcScenarioNumbering | gpcScenarioOutlineExpander | gpcScenarioOutlineNumbering | gpcStepGroups | gpcTestData[] required

The precompilers to use and their configuration.

minItems=1
$schema string

The explicit schema set. It is optional, as GherKing is supported by schemastore.org, thus most IDE.

source string

The source folder or glob pattern of the input feature files.

minLength=1
base string

The base folder of the input feature files.

minLength=1
destination string

The destination folder to put the output feature files.

minLength=1
clean boolean

Whether the destination directory should be clean in advance.

Default: false
verbose boolean

Whether some information should be displayed on the screen.

Default: false
install boolean

Whether the missing precompilers (gpc-* packages) should be installed and save to the package.json. Packages will be installed in the current folder, and package.json created if it is not there yet.

Default: false
parseConfig object

Options to pass to gherkin-ast, on how to parse the input feature files.

1 nested properties
tagFormat enum

The parametrized tag format.

Default: "FUNCTIONAL"
Values: "FUNCTIONAL" "ASSIGNMENT" "UNDERSCORE" "PARAMETERLESS"
formatOptions object

Options to pass to gherkin-formatter, on how to format the output feature files.

6 nested properties
oneTagPerLine boolean

Should the tags be rendered separately, one by line?

Default: false
separateStepGroups boolean

Should step groups (when-then) be separated?

Default: false
compact boolean

Should empty lines be skipped, removed from the result?

Default: false
lineBreak string | null

The line break character(s).

Default: null
indentation string

The indentation character(s).

Default: " "
tagFormat enum

The parametrized tag format.

Default: "FUNCTIONAL"
Values: "FUNCTIONAL" "ASSIGNMENT" "UNDERSCORE" "PARAMETERLESS"

Definitions

gpcCustom object

A custom precompiler configuration, implemented either as an object or a PreCompiler class.

path string required

Either the NPM package name to use, or the path to a JS file containing a PreCompiler.

minLength=1
configuration object

The configuration object, if necessary, to be passed to the custom precompiler class.

gpcReplacer object

This GherKing Precompiler is responsible to replace keys in feature files with given values.

path const: "gpc-replacer" required
Constant: "gpc-replacer"
configuration object required

The key-value pairs to replace in the feature files.

gpcFilter object

The Filter precompiler is responsible for including or excluding the elements of a feature file in the result, which match a cucumber-tag-expression (e.g., has a given tag, does not have a given tag).

path const: "gpc-filter" required
Constant: "gpc-filter"
configuration string

Cucumber-tag-expression the filtering is based on

Default: "not @wip"
minLength=1pattern=^.*@[^ ]+.*$
gpcForLoop object

A precompiler of GherKing to loop scenarios and scenario outlines to repeat them.

path const: "gpc-for-loop" required
Constant: "gpc-for-loop"
configuration object
7 nested properties
maxValue integer

Maximum value of iteration.

Default: 10
min=0
startIndex integer

Starting index of the iteration

Default: 1
min=0
tagName string

Tag used to mark scenarios or outlines to be repeated.

Default: "loop"
minLength=1pattern=^[^ ]+$
format string

Format of the scenario or outline name after repeating. These tokens must be used: ${name}, ${i}.

Default: "${name} (${i})"
minLength=11
All of: variant, variant
limitToMaxValue boolean

Whether higher iteration values than the max should be limited to the max or error should be thrown (false).

Default: true
keepTag boolean

Whether the loop tags should be kept or removed (default).

Default: false
iterations object

An object of iteration name and values (named repeat values),

gpcMacro object

This precompiler is responsible for defining macros in feature files and then executing them.

path const: "gpc-macro" required
Constant: "gpc-macro"
gpcRemoveComments object

This precompiler removes all or particular type of semantic comments from the feature file.

path const: "gpc-remove-comments" required
Constant: "gpc-remove-comments"
configuration object
1 nested properties
keep string[]

To set which comment types should be kept, not removed.

minItems=1
gpcRemoveDuplicates object

The RemoveDuplicates precompiler is responsible for having only a reasonable amount of tags and/or rows in each feature file.

path const: "gpc-remove-duplicates" required
Constant: "gpc-remove-duplicates"
configuration object
2 nested properties
processTags boolean

Should tags on the same level and from parent be de-duplicated.

Default: true
processRows boolean

Should table rows be de-duplicated.

Default: false
gpcScenarioNumbering object

The ScenarioNumbering precompiler is responsible for adding an index to all scenarios and scenario outlines.

path const: "gpc-scenario-numbering" required
Constant: "gpc-scenario-numbering"
configuration object
1 nested properties
format string

The format, how index should be added to the name of the scenario/scenairo outline. Possible tokens: ${name} the original name, ${i} the index

Default: "${i}. ${name}"
minLength=11
All of: variant, variant
gpcScenarioOutlineExpander object

This precompiler is responsible for converting Scenario Outlines to single Scenarios as Cucumber would do and adds the first column as a tag.

path const: "gpc-scenario-outline-expander" required
Constant: "gpc-scenario-outline-expander"
configuration object
1 nested properties
ignoreTag string

Tag used to mark scenarios to be ignored during expanding Scenario Outlines.

Default: "@notExpand"
minLength=2pattern=^@[^ ]+$
gpcScenarioOutlineNumbering object

This precompiler can add numbering column to Examples tables, and apply formatting to the name of the Scenario Outline.

path const: "gpc-scenario-outline-numbering" required
Constant: "gpc-scenario-outline-numbering"
configuration object
6 nested properties
addParameters boolean

Should the example parameters be added to the name of the Scenario Outline.

Default: false
parameterDelimiter string

The delimiter to use when adding the parameters to the name of the Scenario Outline.

Default: ","
minLength=1
parameterFormat string

The format how the output Scenario Outline name should look with the parameters. Tokens to use: ${name}, ${parameters}

Default: "${name} - ${parameters}"
minLength=20
All of: variant, variant
addNumbering boolean

Should an index be added to the name of the Scenario Outline.

Default: true
numberingFormat string

The format how the output Scenario Outline name should look with the index. Tokens to use: ${name}, ${i}

Default: "${i} - ${name}"
minLength=11
All of: variant, variant
strictNaming boolean

Should the existing numbering field (num) block execution (true) or be used for numbering (false).

Default: false
gpcStepGroups object

The StepGroups precompiler is responsible for correcting the gherkin keywords of steps to make the tests more readable.

path const: "gpc-step-groups" required
Constant: "gpc-step-groups"
gpcTestData object

This precompiler can load external data (JSON, CSV, or XLS/XLSX) into exmaples table.

path const: "gpc-test-data" required
Constant: "gpc-test-data"
configuration object
4 nested properties
keepTag boolean

Whether the load-tags should be kept or removed.

Default: false
defaultValue string | number

The default value to be added to the table if a column/value is not found.

Default: ""
appendData boolean

Whether the loaded data should be appended to the existing rows of the examples table or overwritten.

Default: true
ignoreKeyCase boolean

Whether the casing of the example columns and data columns should be ignored.

Default: true
gpcLicense object

This precompiler can be used to inject License statement into the feature files.

path const: "gpc-license" required
Constant: "gpc-license"
configuration object required
Any of: variant, variant
3 nested properties
licenseFile string

The file's path where the license is stored.

minLength=1
licenseText string

The exact license text. It can contain the ${LICENSE} token to set the content of the license file.

minLength=1
placement string

The place to inject the license text, either in start or end comment.

Values: "start" "end"
parseConfig object

Options to pass to gherkin-ast, on how to parse the input feature files.

tagFormat enum

The parametrized tag format.

Default: "FUNCTIONAL"
Values: "FUNCTIONAL" "ASSIGNMENT" "UNDERSCORE" "PARAMETERLESS"
formatOptions object

Options to pass to gherkin-formatter, on how to format the output feature files.

oneTagPerLine boolean

Should the tags be rendered separately, one by line?

Default: false
separateStepGroups boolean

Should step groups (when-then) be separated?

Default: false
compact boolean

Should empty lines be skipped, removed from the result?

Default: false
lineBreak string | null

The line break character(s).

Default: null
indentation string

The indentation character(s).

Default: " "
tagFormat enum

The parametrized tag format.

Default: "FUNCTIONAL"
Values: "FUNCTIONAL" "ASSIGNMENT" "UNDERSCORE" "PARAMETERLESS"