Behat feature hooks

Profile picture for user devraj

Feature hooks are triggered before or after each feature runs. Feature hooks should also be defined as public static methods.

/**
 * @BeforeFeature
*/
public static function setupFeature()
{
    echo "Before Feature Executed";
}

/**
* @AfterFeature
*/
public static function teardownfeature()
{
    echo "After Feature Executed";
}

@BeforeFeature: gets executed before every feature in the suite.
@AfterFeature: gets executed after every feature in the suite.

BeforeFeature will execute after BeforeSuite and AfterFeature will execute before AfterSuite.

Tags