I want to be able to execute given SpecFlow (Gherkin) .feature file locally without doing compilation.
So workflow would be (as a Business Analyst or a QA engineer):
1. modify .feature file (using predefined vocabulary of steps)
2. run
SpecFlowSuperTool.exe
/feature:.\FoobarprojectSpecs.feature
/assembly:Foobarproject.dll,Foobarproject.Core.dll
Goal is to be able to execute feature on-demand without having to recompile the code if only features have changed.
It feels like it should be a pretty straight-forward task to implement such a tool since Gherkin steps binding happens at run-time (judging by the NUnit code generated by SpecFlow).
I do understand that generate->compile->run scenario is supported already, but compile step seems unnecessary in some cases.
UPDATE I ended up coding the tool myself. SpecFlow API is very simple, it was pretty easy to build a specflowrunner.exe that would take a directory or a file + configuration file, and execute .feature files directly, without creating a unit tests first.
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.
The only way to regenerate it is to right-click on the project containing specs and choose "Regenerate Feature Files". This action regenerates all feature files, which becomes slow when a project has many feature files.
Just like with normal unit tests, you can also ignore SpecFlow tests. To do so, tag the feature or scenario with the @ignore tag.
You're talking about SpecFlow.exe ;)
Actually there's a few steps involved and I blogged about it using MsTest about a year ago.
The basic steps are:
You are more than welcome to use my batfiles if you want
Good luck
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