2
votes

Good Morning;

I recently upgraded to VS2013 from 2010. We use Specflow and are at the latest version. In VS2010 I was able to right click within a scenario, select Debug SpecFlow Scenarios and it would debug that specific scenario. Since the upgrade to 2013, selecting that option now debugs all scenarios within the feature file.

I have tried using both Auto and VisualStudio2012 as the Test Runner Tool, but both give the same results with all scenarios being debugged.

Has anyone run into this and is there a fix for it?

3
I'm running into the same issue after just upgrading from VS2010. I had created a Unit Test project using MSTest as the test runner for SpecFlow under Visual Studio 2010. I opened an issue with SpecFlow: Right-click, "Run SpecFlow Scenarios" runs all tests in the solution rather than a single scenario in Visual Studio 2013. I think I might try creating a brand new Unit Test project using SpecFlow in VS2013. Maybe it's a wonky issue with converting the project from VS2010 to 2013?Greg Burghardt
I just found something interesting. If you look in the code-behind file for a Feature, the test methods have a bunch of #line N directives. When I removed these directives, I was able to right-click on a test method in the code-behind, and clicking "Run Tests" just ran that one scenario.Greg Burghardt
In fact, the mere existence of #line 1 "SpecFlow.feature" anywhere inside any MS Test unit test class prevents the right-click -> "Run Tests" feature from running a single MS Test method. I don't think this has anything to do with SpecFlow, and is a bug in Visual Studio 2013. I'm currently searching their open bug reports to see if one is already open.Greg Burghardt

3 Answers

2
votes

I struggled for a while with the same problem (damned muscle memory from using VS2010 was making me do the same thing as you) - I found that the only way to overcome this behaviour (and this is not a proper answer, I just dont have the reputation for a comment) is to use the VS test explorer. You can right click on the test name and select run/debug selected tests.

The context-sensitive menu provided by the specflow extension for feature files currently (26/03/14) does not seem to work.

1
votes

I have a workaround trick for this problem.

When I just want to run or debug some scenarios, I will add a special tag for these scenarios(or single scenario).

Then rebuild your test project and switch the group rule of test explorer to "Traits". You will see the group of tag you added, then selected your scenario for run or debug.

example: http://i.stack.imgur.com/Egbpb.jpg

0
votes

The latest SpecFlow version: 2015.1.2 now runs a single scenario from the feature context menu