[BeforeFeature()]
public static void Hook()
{
// perform setup
}
Similar there is [BeforeTestRun()], [BeforeScenario()] and the
according [After-] attributes.
Hooks can also be tagged:
@needs_extensive_setup
Feature: My feature
In order to run a feature requiring a complex setup
As a stakeholder
I want to signal the required setup with a tag
@needs_special_setup
Scenario: Relying of a common feature setup
Given bla bla
When bli bli bli
Then blu blu blu
Then in the step-definitions you can implement hooks that execute the
required setup only if the tag is present:
[BeforeFeature("needs_extensive_setup")]
public static void Hook()
{
int test = 42;
}
[BeforeScenario("needs_special_setup")]
public void Hook2()
{
int test = 42;
}
--
mail: jonas...@gmail.com
web: www.jonasbandi.net
blog: blog.jonasbandi.net
twitter: twitter.com/jbandi