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
- get a report
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.
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:
- Use SpecFlow.exe (with switch generateall) to generate tests from the .feature files.
- Run tests and create a report. In my example i'm using MsTest but NUnit will work just fine.
- Use SpecFlow.exe again (with switch mstestexecutionreport in my case) to generate the report.
You are more than welcome to use my batfiles if you want
Good luck
来源:https://stackoverflow.com/questions/8506378/execute-specflow-specs-feature-files-without-compilation