Hello,
Is there any Hook Or annotation Or feature available in Cucumber that is equivalent to TestNG's @BeforeMethod annotation. I need to run a Check before each method(step definition) with any annotation like-(@Given,@When,@Then,@And etc..)
But '@Before' (cucumber.api.java.Before) hook is not fulfilling my this requirement as it runs only once for the scenario.
For example -
feature file-
Feature: Feature1 test
Scenario: Feature1 scenario1 (@Before will be executed)
Given Step for given (@Before will not be executed) Here i want to add a check before starting this step
When Step for when (@Before will not be executed) Here i want to add a check before starting this step
Then Step for then (@Before will not be executed) Here i want to add a check before starting this step