In a BDD Cucumber framework, hooks are blocks of code that run before or after each scenario, step, or tagged scenario during test execution. They help with setup and teardown processes, like launching a browser, initializing test data, or cleaning up after tests.
✅ Commonly Used Hooks in Cucumber:
1. @Before
Runs before each scenario.
Used for setup actions (e.g., launching browser, DB connection