DSL.Reqnroll
1.0.0
dotnet add package DSL.Reqnroll --version 1.0.0
NuGet\Install-Package DSL.Reqnroll -Version 1.0.0
<PackageReference Include="DSL.Reqnroll" Version="1.0.0" />
paket add DSL.Reqnroll --version 1.0.0
#r "nuget: DSL.Reqnroll, 1.0.0"
// Install DSL.Reqnroll as a Cake Addin #addin nuget:?package=DSL.Reqnroll&version=1.0.0 // Install DSL.Reqnroll as a Cake Tool #tool nuget:?package=DSL.Reqnroll&version=1.0.0
DSL.Reqnroll
DSL.Reqnroll is Reqnroll plugin that enables use of dynamic test data in Reqnroll steps by bringing in variables, regular expressions and bespoke transformations.
It's re-write of SpecFlow.DSL library, written originally by Wenyuan(Ryan) and Liam Flanagan, to align it with Reqnroll.
Background
In December 2024, Tricentis announced the end-of-life of the SpecFlow open source project. According to the announcement, SpecFlow reached its end-of-life on December 31, 2024. As of 1st January 2025, the SpecFlow GitHub projects have been deleted and the support section of the specflow.org website is disabled.
Syntax
[[ ]] //double bracket in any text will trigger pattern matching
[[varName=value]] //will create a variable named "varName" with value "value"
[[varName]] //will get value of "varName", throw an error if "varName" is not defined
[[varName=RegEx(patternText)]] //RegEx() is a keyword that value is generated from patternText
How it works: It actually creates key/value pairs in current ScenarioContext. So be careful not to conflict with your own context variables.
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 Reqnroll 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 bespoke transformation
for example, you want to map Today to YYYY:MM:dd, add the following code in one of your Reqnroll steps
or put it in BeforeScenario step.
((IParameterTransform)
(_scenarioContext.GetBindingInstance(typeof(IParameterTransform))))
.addTransformer(s => s.ToLower() == today ? DateTime.Now.ToString("yyyy/MM/dd") : s);
Now in Reqnroll 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 it can be done by customerisation as shown in project Examples
Dependencies
- .NetFramework 4.6.2+ or .NetCore 2.0+
- Reqnroll v2.2.1 +
- Fare 2.1.2 +
License: MIT (https://github.com/nowakpi/DSL.Reqnroll/blob/master/LICENSE)
NuGet: https://www.nuget.org/packages/DSL.Reqnroll
Installation
Install plugin from NuGet into your Reqnroll project.
PM> Install-Package DSL.Reqnroll
In case you use App.config file, ensure the following lines have been added to enable plugin:
<plugins>
<add name="DSL" type="Runtime"/>
</plugins>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Fare (>= 2.2.1)
- Reqnroll.CustomPlugin (>= 2.2.1)
-
.NETStandard 2.0
- Fare (>= 2.2.1)
- Reqnroll.CustomPlugin (>= 2.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 74 | 2/9/2025 |
v1.0.0: Introducing DSL.Reqnroll plugin