SpecFlow.DSL 0.0.4

SpecFlow Additional DSL plugin

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.

- 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.
           .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

Install-Package SpecFlow.DSL -Version 0.0.4
dotnet add package SpecFlow.DSL --version 0.0.4
paket add SpecFlow.DSL --version 0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

See GitHub project page, https://github.com/wenyuansong/SpecFlow.DSL#release-history

Version History

Version Downloads Last updated
0.0.4 362 4/12/2017
0.0.3 139 4/11/2017