I've started using SpecFlow rather recently in a WPF C# application, for UI testing. I have a feature that runs a series of chained scenarios, and I'd like to know if there is a way of stopping the execution of the feature if one scenario fails. I'm aware that the execution can be stopped if debugging, but I'm wondering if I can stop it while running. I've been thinking of trying to stop it in the [AfterScenario()] method. Can this be done?
[AfterScenario()]
public static void After()
{
if (TestContext.CurrentContext.Result.State != TestState.Success)
{
//stop feature from going to the next scenario
}
}