Posts

Showing posts from February, 2022

Cucumber Framework

 Choose Maven FW: Step 1 - Create a new maven project Step 2 - Add maven dependencies   Cucumber Java | Cucumber JUnit | JUnit | Selenium Java Step 3 - Create a folder Features under src/test/resources Step 4 - Under features folder create a new feature file login.feature Step 5 - Download cucumber plugin from Eclipse Marketplace Step 6 - Create feature file and add contents Feature Scenario Steps Scenario Outline Example Tags Comments Step 7 - Try to run the feature file Step 8 - Add Step Definitions / Glue Code under src/test/java package Step 9 - Create a Runner class Step 10 - Create Add Cucumber Options for generating reports    HTML | JSON | JUNIT/XML    Step 11 - Run and verify results HOOKS: Cucumber supports hooks, which are blocks of code that run before or after each scenario.: @Before and @After package utilities; import cucumber . api . java . After; import cucumber . api . java . Before; public class Hooks { @Before public void beforeScenario (){ System . out . pr