Search code examples
javaspringcucumber

Cucumber specify examples for different sites


I'm writing test automation for 2 web sites and i want to use same scenarious but with different data, what is the way of doing that?

   Feature: Search

  @smoke @search
  Scenario Outline: I want to search for products
     Given I enter "<keyword>" as a keyword to a search field
     Then I should see search results page
     Then I should see at least <count> results containing "<keyword>"

for hotels.com

Examples:
| keyword     | count       |
| hotel       | 3           |

for cars.com

Examples:
| keyword     | count       |
| cars        | 3           |

i'm using spring boot with java


Solution

  • Use (hotel or car) tag on top of the examples keyword. hotel tag for hotels data etc etc – Grasshopper