SpecFlow & SpecFlow+Runner 3.1 Are Here!

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.

What’s new?

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

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:

Detailed Changelogs

Changelog for SpecFlow

Features:

  • Support for .NET Core 3.0
  • Cucumber messages:
    • First set of cucumber messages are implemented:
      • TestRunStarted
      • TestCaseStarted
      • TestCaseFinished
      • TestRunFinished
    • Documentation: https://specflow.org/documentation/Cucumber-Messages/
    • Cucumber messages can be enabled via specflow.json and app.config
    • File sinks for Cucumber messages can be configured
  • Support for Gherkin v6 “Rule” keyword
  • Support for discovering step definitions from attributes that are derived from Given, When, Then or StepDefinition attributes (related to Issue 1745)

Fixes:

  • AfterTestRun hook can take longer than 100ms on .NET Core (Issue 1348)
  • Adjust parameter names generation in scenario outlines (Issue 1694)
  • specflow.json can be used in SpecFlow+Runner with Process test thread isolation (Issue 1761)
  • specflow.json is copied to output directory automatically (Issue 315)
  • Step definition method with “object” parameter type might not match

Changelog for SpecFlow+Runner

Features:

  • Support for .NET Core 3.0
  • Support for SpecFlow 3.1

Fixes:

  • Test execution in Docker works
  • Improved performance when executing projects with a lot of scenarios (> 10,000)

Changes:

  • Changed the communication between main process and child processes from named pipes to TCP/IP