JoshKeegan / xRetry

Retry running tests via Xunit and Specflow
MIT License
46 stars 15 forks source link

Retry features #115

Closed JoshKeegan closed 2 years ago

JoshKeegan commented 2 years ago

Allows for an entire feature to opt-in to having retries apply to the scenarios within it simply by adding a @retry tag at the feature level.

Has required a copy of XUnit2TestGeneratorProvider to be made from SpecFlow so that it can be modified to make SetTestMethod virtual. PR is raised to get this change into the origin: https://github.com/SpecFlowOSS/SpecFlow/pull/2555 Until the next release though we should be able to use the modified version in the xRetry codebase.

JoshKeegan commented 2 years ago

Could consider refactoring to use ITestMethodDecorator and possibly ITestMethodTagDecorator to decouple some of the tagging logic from the xunit generator.

Having said that, I'm not sure if it would offer any real benefit though because there's no common API for offering retry logic between different test frameworks (unless I built one). So however decoupled the xRetry.Specflow code became, we'd still depend on xRetry and therefore xunit...

JoshKeegan commented 2 years ago

SpecFlow 3.9.50 is out with my PR for the virtual method, so I've changed this to use the built in provider again, just with the newer version of specflow that has the change.