Colonel Panic
Colonel Panic

Reputation: 137574

SpecFlow documentation

Where can I read the SpecFlow documentation that tells me about the [BeforeScenario] and [BeforeTestRun] attributes and when they all run?

Upvotes: 1

Views: 1801

Answers (4)

NidhinSPradeep
NidhinSPradeep

Reputation: 1304

Below is the spec flow getting started link. https://specflow.org/getting-started/

Upvotes: 0

Sonja
Sonja

Reputation: 595

There is also nice training on pluralsight SpecFlow Tips and Tricks

Upvotes: 0

Adrian M
Adrian M

Reputation: 103

  • [BeforeTestRun] and [AfterTestRun] represents the code that will be executed before and after all tests
  • [BeforeFeature] and [AfterFeature] represents the code that will be executed before and after every feature
  • [BeforeScenario] and [AfterScenarion] represents the code that will be executed before and after every scenario inside a feature
  • [BeforeScenarioBlock] and [AfterScenarioBlock] represents the code that will be executed before and after every scenario block

Below you can see an example of a scenario with 3 blocks. The test will be executed before and after Given/When/Then blocks :

Scenario Blocks

  • [BeforeScenarioStep] and [AfterScenarioStep] represents the code that will be executed before and after every scenario step

Further information regarding using and setting up hooks in SpecFlow you can find below:

SpecFlow - Using Hooks in your Tests

Upvotes: 4

Void Ray
Void Ray

Reputation: 10209

There is some basic info here: http://www.specflow.org/documentation/Hooks/

Upvotes: 8

Related Questions