What if we want to execute some piece of code only before certain Scenarios and not before all Scenarios? Consider a situation where we want to invoke the Selenium Webdriver for the Scenarios related to browser automation and the REST
Client code for Scenarios related to REST
Services automation. How do we do this in Cucumber? Let's see this in the next section.
For this recipe, we are going to use update home_page.feature
like this:
Feature: Home Page Background: flow till home page Given user is on Application home page @web Scenario: Home Page Default content on Web Then user gets a GitHub Bootcamp section @rest Scenario: GitHub account REST Service When user sends a GET request