Open MilkyWayJoe opened 9 years ago
@MilkyWayJoe I was having this issue as well and I found a fix that worked for me. This error was only happening when I was trying to run the feature files from projects other than the initial project I created (with the feature files / steps classes). When I added the SpecFlow package / SpecFlow config to the project that runs the feature files, everything works fine.
Example config:
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<unitTestProvider name="NUnit" />
<stepAssemblies>
<stepAssembly assembly="SpecResults" />
</stepAssemblies>
</specFlow>
Just reporting as I don't have a PR ready for this.
I have found this piece of code that doesn't seem to be doing anything in particular, and also being discarded on the next line:
This is the same line that causes most of the reported
object reference is not set to an instance of an object
issues. Removing this will solve this issue, however, it will introduce other issues: The reports take internal TearDown as part of the test and tries to execute reporting on clean up.During TearDown, reporter won't have a CurrentStep and stepContainer will be null and crashing the test execution. I don't know if this is because of my setup as I have the BeforeTestRun in an abstract class (BaseStep) which inherits from ReportingStepDefinitions and all my steps inherit from the BaseStep abstract class.