SpecFlow.DSL
0.0.4
See the version list below for details.
dotnet add package SpecFlow.DSL --version 0.0.4
NuGet\Install-Package SpecFlow.DSL -Version 0.0.4
<PackageReference Include="SpecFlow.DSL" Version="0.0.4" />
paket add SpecFlow.DSL --version 0.0.4
#r "nuget: SpecFlow.DSL, 0.0.4"
// Install SpecFlow.DSL as a Cake Addin #addin nuget:?package=SpecFlow.DSL&version=0.0.4 // Install SpecFlow.DSL as a Cake Tool #tool nuget:?package=SpecFlow.DSL&version=0.0.4
An enhancement to Specflow DSL to be able to use dynamic test data in specflow steps by bringing in variables, regular expressions and simple calculations.
**Examples**:
- Create dynamic test data and refer it in another step
When enter [[var=50]] //assign 50 to a variable named "var"
Then [[var]] equals 50 // now get variable "var" value
- Create dynamic test data using regular expression
When enter [[var=RegEx([0-9]{3})]] //assign var with 3 digit random number
Then [[var]] is a 3 digits number // now get variable "var" value
- Same applies to SpecFlow tables:
When create new user with the following details:
|Field | Value |
|UserName| [[name=RegEx([a-z]{5,8})]] |
|Password| [[pwd=RegEx([a-z]{3}[0-9]{3})]] |
Then verify can login with username="[[name]]" and password="[[pwd]]"
- Support customerise transformation
for example, you want to map Today to YYYY:MM:dd, add the following code in one of your Specflow steps
or put it in BeforeScenario step.
((IParameterTransform)
(ScenarioContext.Current.GetBindingInstance(typeof(IParameterTransform))))
.addTransformer(s => s.ToLower() == today ? DateTime.Now.ToString("yyyy/MM/dd") : s);
Now in Specflow feature files, you can write:
When entered "[[timeVar=Today]]" //timeVar will be assigned to yyyy/MM/dd, e.g 2017/12/04
- Calculations are currently NOT supported but can be supported by customerisation
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See GitHub project page, https://github.com/wenyuansong/SpecFlow.DSL#release-history