Run Nbehave test using NBehave.MSBuild.dll doesn't return corrrect Scenarios count

May 23, 2009 at 8:56 PM
Edited May 23, 2009 at 9:05 PM

I have created a msbuild file to run my NBehave stories (which consists of Themes, Stories, and Scenarios). Here is an excerpt of my msbuild file:

<Import Project=".\lib\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<UsingTask TaskName="NBehave.MSBuild.NBehaveTask" AssemblyFile="$(lib_dir)\NBehave.MSBuild.dll" />

Then I ran the msbuild file from the VS 2008 Command Prompt. From the command prompt, I've received correct Scenraios run result.

         NBehave version
         Copyright c NBehave 2007-2008
         All Rights Reserved.

         Runtime Environment -
            OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
           CLR Version: 2.0.50727.3082

         Scenarios run: 78, Failures: 2, Pending: 0

However, when I look at the testOutput.xml, the scenarios count are different and incorrect.

- <results name="NBehave.Narrator.Framework" version="Version=" date="5/23/2009" time="2:32 PM" themes="4" stories="18" scenarios="213" scenariosFailed="6" scenariosPending="0">
   - <theme name="Save Quote Tests" time="108.8388738" stories="4" scenarios="19" scenariosFailed="0" scenariosPending="0">
      + <story name="12.1 Capture Install Fees" time="43.5605484" scenarios="2" scenariosFailed="0" scenariosPending="0">
      + <story name="27.2 Create Prospect" time="2.7811254" scenarios="3" scenariosFailed="0" scenariosPending="0">

Both the top summary line and theme line results has total scenarios and scenarioFailed counts incorrectly, looks like it was counting the  number of assertions instead of scenarios.

However, the Story line has the results count correct. I was thinking should the scenarios count in the Top result summary and Theme summary just the sum of the scenarios count in individual story lines?

Also, how come the results in the xml output doesn't align with the result from the command prompt?

Is there a way to capture the results in the command prompt to an xml or txt file? I've tried to run the tests using NBehave-console, the output text file does not contain any test run results (i.e. total scenario runs, pass and fail). The results are only display on the command prompt.

Any help is appreciated!!!!