Build/Test Issues

SpecFlow integration - Failed Marker at invalid position

Started by tomitrescak on 2,799 views

Hi

Thanks for the AMAZING product!
We are currently evaluating NCrunch and so far we are loving it!

The one issue that we have is that our BDD tests in Gherkin show Failed marker at an invalid step. For some reason, the marker is always at the end of the steps, not where the test fails. It is a bit confusing. Please see the image. The failed marker is on the last step, while it should be on the second line, where the test is failing.

Any advice how can this be resolved?

[img=https://snag.gy/B0c8Er.jpg]Incorrect Marker[/img]

I can see in the console that the test execution continues, but I would like to break it no "skip"


Given That institution 'InstitutionStart' is launched
-> error: Value cannot be null.
Parameter name: source
When Agent 'user' connects to organisation 'main'
-> skipped because of previous errors
Then Agent 'user' plays role 'King' and belong to the started institution
-> skipped because of previous errors
And Agent 'user' has parameter 'childParameter'
-> skipped because of previous errors
And Agent 'user' has parameter 'parentParameter'
-> skipped because of previous errors
And Agent 'user' has parameter 'orgChildParameter'
-> skipped because of previous errors
And Agent 'user' has parameter 'orgParentParameter'
-> skipped because of previous errors

Edited

Hi thanks for posting and evaluating the product!

This is a feature of SpecFlow. It can be disabled by editing the app.config. If you add stopAtFirstError="true" you will get an exception cross at the Given.


  <specFlow>
    <unitTestProvider name="NUnit" />
    <runtime
      stopAtFirstError="true"
      missingOrPendingStepsOutcome="Inconclusive" />
  </specFlow>


SpecFlow by default runs through all the steps and then rethrows the exception at the end of the scenario, hence the stack trace at the end of the scenario. If you place a breakpoint on the code where the exception happens you will already see the correct stack trace.

I hope this helps!

Michael

Post a reply

Log in to reply.