1
votes

Is it actually possible to run a ScenarioOutline set, or an individual row from a ScenarioOutline set, from Visual Studio?

The SpecFlow documentation briefly mentions that it is possible to run a ScenarioOutline from the Visual Studio context menu as you would a standard Scenario. I have tried to execute the tests by clicking in various areas of the Feature file, but to no avail. The only way I am able to run the ScenarioOutline tests is by running the entire Feature.

I'm using Visual Studio 2013 Professional with the SpecFlow extension and NuGet package and SpecRun as the test runner.

1

1 Answers

0
votes

I have a feeling that this is due to a bug in the current version which doesn't correctly map the line numbers from the test back to the feature file.

I have fixed this in the v2 release, of which there is a beta build available here.

It will also be dependent on which test framework you are using, as it will only ever work if specflow is configured not to generate row tests, due to the way that mappings between the rows and the feature for work. Row tests are the default for all testing frameworks except MSTest (which doesn't support then) so in addition to using the beta version you'll also have to configure specflow not to generate row tests.

You can read about the config here and as you can see you need to add this to your config:

<specFlow>
  <generator allowRowTests="false"/>
</specFlow>

Once this is done then I believe you should be able to click on the example row and run a single test, but I don't use specrun, or run with the visual studio integration usually, so can't be sure. I generally use ncrunch and it allows me to do this, and also correctly identifies the example as the starting line for the tests.