Skip to content
Henrik edited this page Aug 21, 2014 · 1 revision

Run the SpecFlow test runner.

specflow :test_report => [:test] do |cmd|
  cmd.command = "path/to/specflow"
  cmd.report = :nunitexecutionreport
  cmd.project = "path/to/proj"
end

Required Parameters

Command

The path to the specflow console runner.

command = "path/to/specflow"

Report

The SpecFlow report to run: :nunitexecutionreport, :mstestexecutionreport, & :stepdefinitionreport. Oh, all right, you could use this to run :generateall if you really need to, as well.

report = :nunitexecutionreport

Project

The project file containing the feature files.

project = "path/to/proj"

Optional Parameters

(none)

Guidance

Multiple Projects

If you want to run the same SpecFlow report for multiple projects, there's an easy way. We didn't mess with this one, like the XUnit test runner, which also only supports one assembly per command line invocation (internally, we loop over the assemblies and run a shell command per).

Define a separate task for each of your acceptance test projects and you can use the Rake FileList to make the matching easy.

acceptance_tests = FileList["source/**/*.AcceptanceTests.csproj"]
acceptance_tests.each do |proj|
  specflow proj => [:test] do |cmd|
    cmd.command = "tools/specflow/specflow.exe"
    cmd.report = :nunitexecutionreport
    cmd.project = proj
  end
end

This way, you can also depend on the whole set of acceptance test reporting tasks easily

output :out => acceptance_tests do |out|
  # ...
end
Clone this wiki locally