This Reqnroll.Action is used to read configuration values out of the reqnroll.actions.json
file. You can also provide configurations for multiple targets, to run your scenarios with different configurations.
This Reqnroll.Action is used by every Reqnroll.Action that has a configuration.
- Reading configuration values from
reqnroll.actions.json
- Supports targets via
reqnroll.actions.%TARGET_NAME%.json
files. - helper classes to read out the configuration values.
You can configure this plugin via the reqnroll.actions.json
.
Example:
{
"your_configuration": "value of the property"
}
This plugin supports tagreting of multiple configurations at runtime. For each configuration you provide, a class will be generated in your feature's code behind file when you build the project. This means that for any given test, the test will be executed against each target.
Example:
reqnroll.actions.json
{
"your_configuration": "value of the property",
"another_configuration": "another value"
}
reqnroll.actions.TARGET_1.json
{
"your_configuration": "TARGET 1 overrides this value"
}
reqnroll.actions.TARGET_2.json
{
"your_configuration": "TARGET 2 overrides this value"
}
[Binding]
public class A_Binding_Class
{
private readonly IReqnrollActionsConfiguration _reqnrollActionsConfiguration;
public A_Binding_Class(IReqnrollActionsConfiguration reqnrollActionsConfiguration)
{
_reqnrollActionsConfiguration = reqnrollActionsConfiguration;
}
public string GetConfigurationValue()
{
return _reqnrollActionsConfiguration.Get("your_configuration", string.Empty);
}
}
With this configuration, you are getting every scenario twice in your test explorer.
The result of the GetConfigurationValue
is the following:
Target Name | your_configuration | another_configuration |
---|---|---|
Target_1 | TARGET 1 overrides this value | another value |
Target_2 | TARGET 2 overrides this value | another value |
Get your configuration value as string. Throws an error if the configuration value doesn't exist.
Get your configuration value as string. If configuration value can't be found, the defaultValue
is returned
Get your configuration value as double
.
Get your configuration value as a string[]
. This is used to get a list from your configuration json file.
Get the child elements of a node in your configuration json file.
Add the latest version of the Reqnroll.Actions.Configuration
NuGet Package to your project.