We are happy to announce the release of SpecFlow and SpecFlow+Runner 3.1. This update fixes a lot of smaller issues found by our community members over the last months, but we have also added some bigger features to this release.
1. .NET Core 3.0 Support
With the addition of nullable reference types in C# 8, we needed to make some changes to our binding execution code. These changes have now been implemented, and all our tests for .NET Core 3.0 are successful.
2. Cucumber Messages
The integration of Cucumber messages is a joint effort with the Cucumber community to create a unified protocol for exchanging data between different components of SpecFlow and Cucumber. There will be no longer be a need to implement separate HTML report generators for each Cucumber implementation and SpecFlow. Cucumber messages allow you to use the same HTML report generators for SpecFlow and Cucumber.
SpecFlow 3.1 contains the first set of Cucumber Messages: TestRunStarted, TestCaseStarted, TestCaseFinished and TestRunFinished. We plan on implementing additional messages that allow you to generate different output formats/reports in future releases.
Cucumber messages are currently disabled by default. We plan to enable them by default with SpecFlow 3.2. You can find the current documentation here.
Changes Related to Cucumber Messages
For end users, the introduction of these messages does not bring any changes from previous versions, as we have not changed SpecFlow’s overall behavior.
However, we changed the internal workings of how scenarios are ignored. In the past, we generated the appropriate ignore attribute for the test runner in the code-behind file. But as we now also need to send a cucumber message for skipped scenarios, we no longer generate the ignore attribute and skip the scenario at runtime instead.
3. Docker Support in SpecFlow+Runner
One thing we learned is that just because SpecFlow is compiled and runs with .NET Core, that does not mean it will run on Windows, Linux and Mac OS. Not all aspects of.NET Core are applicable to all 3 operating systems. SpecFlow+Runner 3.1 now uses APIs that also work on Linux and MacOS. All SpecFlow+Runner features should also now work in Docker. If not, please open an issue.
If you want to generate SpecFlow+ Runner reports on non-Windows operating systems, you need to install mono. Details can be found here.
A sample SpecFlow+ Runner project demonstrating support for Docker support can be found here.
4. Gherkin 6 “Rule” Keyword
SpecFlow 3.1 supports the new Gherkin 6 Rule keyword.
However, the Visual Studio Extension does not yet support this keyword. Using it will stop the syntax highlighting from working.
5. Project Template
To make it easier to create new SpecFlow projects, we have created a project template that you can access with dotnet new. You can find more information on installing the template and using it to create new projects here.
Thanks to all our amazing contributors!
Thanks to the following users for their contributions to SpecFlow 3.1: