So I have a scenario outline where I need to repeat those steps in the other scenarios of this feature and I don't want to duplicate the steps manually in feature file.
I tried Background
but without success yet.
Here is the scenario:
Scenario Outline: Adding an item to shopping cart
Given I am on home page
When i browse to category
And i click on the product
And I add <x> product to the bag
Then I should see the <x> in my mini-bag
And I click on the basket to verify if I have <x> items
Examples:
|x|
|1|
Second scenario:
Scenario Outline: ...
[I want the steps in the scenario above until
"Then I should see the <x> in my mini-bag" to be executed here.]
Given I am on the basket
When I edit the quantity to <y>
And I click the apply button
Then I should the quantity <y>
Examples:
|x|
|1|
I don't want to use execute_steps
for all the scenario's which is duplicating in all the steps.