I am using Specflow (http://specflow.org/) to write some integration tests and I would like to run a single Scenario. Is there any way to run a single scenario with Resharper 6? BTW I configured specflow to use MSTest.
My Specflow test looks like:
Feature: Customer management
Scenario: Add a new Customer into system
Given the User has entered the customer with the following data
| name | last_name | birthday |
| Peter | Stein | 12.09.1955 |
When the User has pressed the Save Button
Then the following customer should be stored in the data base
| name | last_name | birthday |
| Peter | Steim | 12.09.1955 |
Scenario: Second scenario.....
Scenario: Third scenario.....
I want to run only the first scenario.
In order to execute your SpecFlow tests, you need to define the tests as Gherkin feature files, bind the steps defined in your feature files to your code, and configure a unit test provider to execute the tests. SpecFlow generates executable unit tests from your Gherkin files.
when right-clicking on a feature file and selecting Run Custom Tool , make sure the SpecFlow extension is enabled. To enable the extension in Visual Studio, select Tools | Extensions and Updates…, select the “SpecFlow for Visual Studio” extension, then select Enable.
Files needed for test SpecFlow tests typically consist of two files, your Feature file and your Step Definitions. Your feature file is where you will be coding out your scenarios, and your step definitions file is where you define how your test behaves.
If you are running with ReSharper as I am I just open the Feature file the right-click anywhere within a Scenario and select "Run Specflow Scenarios" from the pop-up menu. It runs just the one scenario you are in.
Please note, I am using ReSharper to run the tests.
what i do is pop open the generated c# file and find the generated test there and use my keyboard shortcuts i have set up for the resharper test runner to execute the specs (and could use the green/yellow balls with the mouse too). it's less than ideal and i agree it would be awesome if you could just execute from the feature file. i haven't found anything like that out there. would be a worthwhile project to try to figure out a way to make that happen with a plugin. not sure what that would take.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With