Configuration#

Reqnroll can be setup simply by adding a NuGet package to your project and in the most of the cases there is no additional configuration required.

The default configuration can be altered by adding a reqnroll.json configuration file to your project. An empty configuration file can be added using the Add / New Item… command of Visual Studio 2022 or using the Reqnroll .NET item template. The following example downloads the Reqnroll templates and adds a configuration file to the project.

.NET CLI#
dotnet new install Reqnroll.Templates.DotNet
dotnet new reqnroll-config

You can also start by adding the following empty configuration file to your project.

reqnroll.json#
{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json"
}

Tip

There is a JSON schema file available for reqnroll.json. By specifying the schema reference like in the example above, most IDE (including Visual Studio and Visual Studio Code) provides auto completion and documentation hints for the configuration file.

In this guide we show examples for the most common situations when you need to modify the config file followed by a full configuration reference.

Use bindings from external projects#

In order to use bindings (step definitions, hooks or step argument transformations) from other projects (called external projects) it is not enough to add a project reference to the Reqnroll project, but you need to also configure Reqnroll to search bindings in these projects. See Bindings from External Assemblies for further details.

This can be achieved by listing the assembly name of the external project to the bindingAssemblies section of the configuration file.

The following example registers the project SharedStepDefinitions as an external binding assembly.

reqnroll.json#
{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",

  "bindingAssemblies": [
    { 
      "assembly": "SharedStepDefinitions"
    }
  ]
}

Set the default feature file language#

The keywords in the feature files are available in many many natural languages matching the language your business is using.

In order to use the keywords in a language other than English, you can either use the Gerkin #language directive in every feature file or specify a default language in the Reqnroll configuration.

The following example sets the default feature language to Hungarian:

reqnroll.json#
{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",

  "language": {
    "feature": "hu-HU"
  }
}

Configuration file reference#

The following configuration sections are available for reqnroll.json.

language#

Use this section to define the default language for feature files and other language-related settings. For more details on language settings, see Feature Language.

Setting

Value

Description

feature

culture name (en-US)

The default language of feature files added to the project. We recommend using specific culture names (e.g.: en-US) rather than generic (neutral) cultures (e.g.: en).
Default: en-US

binding

culture name (en-US)

Specifies the culture to be used to execute binding methods and convert step arguments. If not specified, the feature language is used.
Default: not specified

generator#

Use this section to define test generation options.

Setting

Value

Description

allowDebugGeneratedFiles

true/false

By default, the debugger is configured to step through the generated code. This helps you debug your feature files and bindings (see Debugging Tests). Disabled this option by setting this attribute to true.
Default: false

allowRowTests

true/false

Determines whether “row tests” should be generated for scenario outlines. This setting is ignored if the test execution framework does not support row based testing.
Default: true

addNonParallelizableMarkerForTags

List of tags

Defines a set of tags, any of which specify that a feature should be excluded from running in parallel with any other feature. See Parallel Execution.
Default: empty

runtime#

Use this section to specify various test execution options.

Setting

Value

Description

missingOrPendingStepsOutcome

Pending / Inconclusive / Ignore / Error

Determines how Reqnroll behaves if a step binding is not implemented or pending. See Test Results.
Default: Pending

obsoleteBehavior

None / Warn / Pending / Error

Determines how Reqnroll behaves if a step binding is marked with [Obsolete] attribute.
Default: Warn

stopAtFirstError

true/false

Determines whether the execution of the scenario should stop when encountering the first error, or whether it should attempt to try and match subsequent steps (in order to detect missing steps).
Default: false

trace#

Use this section to determine the Reqnroll trace output.

Setting

Value

Description

stepDefinitionSnippetStyle

CucumberExpressionAttribute / RegexAttribute

Specifies the default step definition style.
Default: CucumberExpressionAttribute

coloredOutput

true/false

Determine whether Reqnroll should color the test result output. See Color Test Result Output for more details. You can override this setting to disable color (e.g. on build servers), with the environment variable NO_COLOR=1
Default: false

bindingAssemblies#

This section can be used to configure additional assemblies that contain bindings (step definitions, hooks or step argument transformations). See Bindings from External Assemblies for further details.

The assembly of the Reqnroll project (the project containing the feature files) is automatically included. The binding assemblies must be placed in the output folder (e.g. bin/Debug) of the Reqnroll project, for example by adding a reference to the assembly from the project.

The following example registers an additional binding assembly (SharedStepDefinitions.dll).

reqnroll.json#
{
  "$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",

  "bindingAssemblies": [
    { 
      "assembly": "SharedStepDefinitions"
    }
  ]
}

The bindingAssemblies section can contain multiple JSON objects (one for each assembly), with the following settings.

Setting

Value

Description

assembly

assembly name

The name of the assembly containing bindings (without .dll).