Futile.SpecFlow.Actions.Configuration
0.1.350.6
See the version list below for details.
dotnet add package Futile.SpecFlow.Actions.Configuration --version 0.1.350.6
NuGet\Install-Package Futile.SpecFlow.Actions.Configuration -Version 0.1.350.6
<PackageReference Include="Futile.SpecFlow.Actions.Configuration" Version="0.1.350.6" />
paket add Futile.SpecFlow.Actions.Configuration --version 0.1.350.6
#r "nuget: Futile.SpecFlow.Actions.Configuration, 0.1.350.6"
// Install Futile.SpecFlow.Actions.Configuration as a Cake Addin #addin nuget:?package=Futile.SpecFlow.Actions.Configuration&version=0.1.350.6 // Install Futile.SpecFlow.Actions.Configuration as a Cake Tool #tool nuget:?package=Futile.SpecFlow.Actions.Configuration&version=0.1.350.6
Futile.SpecFlow.Actions.Configuration
This SpecFlow.Action is used to read configuration values out of the specflow.actions.json
file. You can also provide configurations for multiple targets, to run your scenarios with different configurations.
This SpecFlow.Action is used by every SpecFlow.Action that has a configuration.
Futile?
Work on Specflow has been discontinued and the successor is reqnroll (status May 2024). This nuget package comes from a fork that:
- Includes some bug fixes
- Uses
net48
andnet8.0
Updated examples can be found here (Selenium and Playwright support multiple targets): Futile.SpecFlow-Examples.
Included Features
- Reading configuration values from
specflow.actions.json
- Supports targets via
specflow.actions.%TARGET_NAME%.json
files. - helper classes to read out the configuration values.
Configuration
You can configure this plugin via the specflow.actions.json
.
Example:
{
"your_configuration": "value of the property"
}
Multiple target configurations
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:
specflow.actions.json
{
"your_configuration": "value of the property",
"another_configuration": "another value"
}
specflow.actions.TARGET_1.json
{
"your_configuration": "TARGET 1 overrides this value"
}
specflow.actions.TARGET_2.json
{
"your_configuration": "TARGET 2 overrides this value"
}
[Binding]
public class A_Binding_Class
{
private readonly ISpecFlowActionsConfiguration _specFlowActionsConfiguration;
public A_Binding_Class(ISpecFlowActionsConfiguration specFlowActionsConfiguration)
{
_specFlowActionsConfiguration = specFlowActionsConfiguration;
}
public string GetConfigurationValue()
{
return _specFlowActionsConfiguration.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 |
APIs
ISpecFlowActionsConfiguration
string Get(string path);
Get your configuration value as string. Throws an error if the configuration value doesn't exist.
string Get(string path, string defaultValue);
Get your configuration value as string. If configuration value can't be found, the defaultValue
is returned
double? GetDouble(string path);
Get your configuration value as double
.
string[] GetArray(string path);
Get your configuration value as a string[]
. This is used to get a list from your configuration json file.
Dictionary<string, string> GetDictionary(string path);
Get the child elements of a node in your configuration json file.
How to get it
Add the latest version of the SpecFlow.Actions.Configuration
NuGet Package to your project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- SpecFlow (>= 3.9.74)
-
net8.0
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- SpecFlow (>= 3.9.74)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Futile.SpecFlow.Actions.Configuration:
Package | Downloads |
---|---|
Futile.SpecFlow.Actions.WindowsAppDriver
Fork of SpecFlow.Actions.WindowsAppDriver |
|
Futile.SpecFlow.Actions.Playwright
Fork of SpecFlow.Actions.Playwright |
|
Futile.SpecFlow.Actions.Selenium
Fork of SpecFlow.Actions.Selenium |
|
Futile.Specflow.Actions.FlaUI
SpecFlow plugin for FlaUI |
GitHub repositories
This package is not used by any popular GitHub repositories.