it:ad:specflow:howto:defining_hooks

IT:AD:SpecFlow:HowTo:Define Hooks

  • [BeforeTestRun]
  • [AfterTestRun]
  • [BeforeFeature]
  • [AfterFeature]
  • [BeforeScenario]
  • [AfterScenario]
  • [BeforeScenarioBlock]
  • [AfterScenarioBlock]
  • [BeforeStep]
  • [AfterStep]
Note:

t

he above Hooks have to be applied to static methods or the unit tests will fail.

[Binding]
public class StudentSearchServiceSteps
{
    //IMPORTANT: Notice that method is *static*....

    [BeforeTestRun]
    public static void Init()
    {
        MOE.NSI.POC.Application.AppBootstrapper.Initialize();
    }

    ...
}

## Resources ##

  • /home/skysigal/public_html/data/pages/it/ad/specflow/howto/defining_hooks.txt
  • Last modified: 2023/11/04 01:57
  • by 127.0.0.1