Is there a way to implement an AfterScenario
hook to re-run the current test in case of Fail?
Something like this:
[AfterScenario("retry")]
public void Retry()
{
if (ScenarioContext.Current.TestError != null)
{
// ?
}
}
Note: The tests in my project are combined in Ordered tests and executed via MsTest.
This plugin is awesome. https://github.com/arrty/specflow-retry. I got it to work with nunit and his example is using MS-Test
It will allow you to do this:
@retry:2
Scenario: Tag on scenario is preferred
Then scenario should be run 3 times
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With