SpecFlow - repeated failed tests

Is there a way to implement a binding AfterScenarioto restart the current test in case of failure?

Something like that:

[AfterScenario("retry")]
public void Retry()
{
    if (ScenarioContext.Current.TestError != null)
    {
     // ?     
    }
}

Note . Tests in my project are combined in ordered tests and run through MsTest .

+5
source share
2 answers

The goal of Specflow scripts is to claim that the system behaves as expected.

- , " " ! , . , .

, , , , :

: ... . .

. , .

- , , - . , ( , , ), . WebDriverWait , DOM.

+2

. https://github.com/arrty/specflow-retry. Nunit MS-Test

:

@retry:2
Scenario: Tag on scenario is preferred
Then scenario should be run 3 times
+5

All Articles