Roger Lipscombe
Roger Lipscombe

Reputation: 91825

Can I get SpecFlow to generate a list of missing step definitions without running the tests?

I'm in the process of refactoring our SpecFlow-implemented BDD tests. As part of this work, I've commented out most of the step definitions.

As I run the tests, I'm presented with the "No matching step definition found for one or more steps." message.

However, I'd prefer not to wait until the tests are actually run. Is there a way to get SpecFlow to check for missing step definitions without running the tests?

Upvotes: 4

Views: 1619

Answers (1)

Roger Lipscombe
Roger Lipscombe

Reputation: 91825

You can use the stepdefinitionreport parameter to SpecFlow.exe, as follows:

specflow.exe stepdefinitionreport MyTests.csproj

But be aware:

  1. If your assembly uses the .NET 4.0 runtime, you'll need to add a specflow.exe.config file with a <supportedRuntime> element.
  2. It uses some functionality that's 32-bit only. So if you're on 64-bit Windows, you'll need to use CORFLAGS /32BIT+ to edit the Specflow.exe file.
  3. By default, it looks in the bin\Debug folder.

Upvotes: 6

Related Questions