3
votes

I'm trying to generate a nice HTML output for my specflow features from Visual Studio. I have resharper installed and I can run my feature tests but I would like to get an html output of the final results.

I have tried several sites which say we can create an External Tools. Here are my settings:

Title: SpecFlow Test Result

Command:C:\TFS\Test_Automation\a.1_Main\Test\AutoUpdateTests\AutoUpdateTests\packages\SpecFlow.1.9.0\tools\specflow.exe

Arguments: nunitexecutionreport AutoUpdateTests.csproj /xmlTestResult:bin\debug\TestResult.xml

Initial directory: $(ProjectDir)

so then I execute my tests and then select Tools -> SpecFlow Test Result

I see a cmd window open briefly but no TestResult.xml file appears.

Any ideas? I also have referenced nunit.framework in my project not sure that matters.

Thanks

2

2 Answers

1
votes

I've written a blog post that describes how this is accomplished, yes it's about MsTest but the general idea is the same

Also - in the last 2 minutes of this video Rob Conery hooks Visual Studio up with the SpecFlow test runner, if you rather watch than read.

0
votes

If you aren't fussy about the format, then there is another way to achieve this,

  1. Download a free copy of TeamCity (Other CI servers exist)
  2. Add a visual Studio Build step to build your project
  3. Add an nUnit Build step to run your tests
  4. Look in the build log

[x.Tests.dll] x.Tests.ConfirmThatSchedulesStartAndStopFeature.ProvideAFakeDateTime_Now

Given a schedule called Calc

-> done: ScheduleModelTest.GivenAScheduleCalled("Calc") (0.0s)

And my schedule thinks its Monday 8:00

-> done: ScheduleModelTest.GivenMyScheduleThinksIts("Monday", "8:00") (0.0s)

Then my schedule should tell me its Monday 8:00

-> done: ScheduleModelTest.ThenMyScheduleShouldTellMeIts("Monday", "8:00") (0.0s)