Specflow + NUnit runner (retry failed tests)
Hi, according to this reference in Specflow, it seems like it is possible to retry failed tests with the NUnit runner out of the box, but the only solutions I have been able to find are based on abandoned external plugins like this https://github.com/arrty/specflow-retry or this https://github.com/DamirAinullin/specflow-retry am I missing something?
Thanks in advance, Dmitry
Hi Andreas, none of the above packages are not working with the recent SpecFlow. Is there any plans to support retry functionality for nUnit as it does in xRetry.SpecFlow?0
No, no plans to do it by ourselves.
In the meantime a community member created https://github.com/farum12/NUnitRetry.SpecFlowPlugin0
I couldn't get the retry working with this NUnitRetry.SpecFlowPlugin package either. Any help would be much appreciated0
As far as I know there is no good implementation of retry functionality for nUnit. I've found that the only one package that is still working is NUnitRetry.SpecFlowPlugin. It brings retry functionality to tests but they will retry only on assertion fail but not when an unhandled exception happens. This is nUnit limitation, there is nothing to do with this.
You can switch to xUnit and use xRetry.SpecFlow. It is working perfectly. Of course this won't be possible if you are using Playwright as you will have issues with parallel test execution.0
I have a specflow+nunit project, but because of the lack of retry mechanisms for nunit, I'm also thinking of migrating to xunit. Have you tried it with specflow livingdoc?
For example, if a test is retried (because of failure) and it passes, it appears in livingdoc as just 1 test (passed) or as 2 tests (1 passed and 1 failed)?
We do not use SpecFlow LivingDoc's so I can’t tell you exactly how it will work. But on Azure DevOps and TeamCity you will have only one mention of the test even if it will be retried. So if one test failed during the first execution but passed on retry in the report you will have just one green test.
Please sign in to leave a comment.