Reputation: 687
Is it possible for testers to be able to write SpecFlow feature files in a text editor and then be able to execute them without the use of Visual Studio?
I have moved over from the world of Java and JBehave to the world of C# and SpecFlow. With Java and JBehave the testers would write the scenarios in plain text files and they were supplied with a user interface to allow them to execute the tests and view nicely formatted results. I would like to be able to do something similar for C# and SpecFlow.
This is my initial thought as to how this could work:
Provide the testers with Specflow, NUnit and the complete test harness project code (yuk!)
Write a user interface for testers where they can select the plain text files. The 'Generate Tests' button would execute the 'specflow.exe generateall' command and the 'View Results' button would execute the 'specflow.exe nunitexecutionreport' command
They would have to use the NUnit console to execute the tests.
Is there a better solution to this?
Upvotes: 1
Views: 618
Reputation: 6961
You missed a step out. You can do it withou VS but you will also need to use msbuild. So the full process is
specflow.exe generateAll
will convert plain text into .cs filesmsbuild yourSolution.sln
will convert .cs into .exe/.dllnunit.console.exe
will test .exe/.dllspecflow.exe nunitExecutionReport
will generate you a nice report.This isn't ideal as you say. This also will fail (with a pending status) as soon as one of the testers tries to perform something outisde of the very limited sets of statements that you have already provided a [Binding]
for.
To be honest this isn't what SpecFlow is designed for. While it is very good practice to involve the testers into the specification writing process, it is normally with the expectation that the scenarios generated are not dynamic, but rather become become part of a library of known circumstances in which the application performs correctly.
This library isn't also expected to be exhaustive but rather to contain enough examples to cover the logical decision points. For example, UK stamp duty has a rate that varies in steps such as at GBP250K and GBP500K, but you aren't going to write 25,000,000 tests to cover every single price that could be in that range, when two (250,000.00 and 499,999.99) will cover it.
Update: You might be better using something like FitNesse or Conccordion
Upvotes: 1