NuGet Gallery Feed for SpecFlow.DSLAn 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
- Calculations are currently NOT supportedhttps://www.nuget.org/packages/SpecFlow.DSL/2021-08-18T02:11:59Zhttps://www.nuget.org/packages/SpecFlow.DSL/3.0.1SpecFlow.DSL 3.0.12021-08-18T02:09:59Z2021-08-18T02:11:59Zwenyuansonghttps://www.nuget.org/profiles/wenyuansongAn 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
- Calculations are currently NOT supportedhttps://www.nuget.org/packages/SpecFlow.DSL/3.0.0SpecFlow.DSL 3.0.02021-08-16T04:13:25Z2021-08-16T04:14:58Zwenyuansonghttps://www.nuget.org/profiles/wenyuansongAn 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
- Calculations are currently NOT supportedhttps://www.nuget.org/packages/SpecFlow.DSL/0.0.4SpecFlow.DSL 0.0.42017-04-12T05:30:47Z2018-12-13T20:50:29Zwenyuansonghttps://www.nuget.org/profiles/wenyuansongAn 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 customerisationhttps://www.nuget.org/packages/SpecFlow.DSL/0.0.3SpecFlow.DSL 0.0.32017-04-11T05:14:40Z2018-12-13T20:50:29Zwenyuansonghttps://www.nuget.org/profiles/wenyuansongAn 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
- Calculations are currently NOT supported