0

所以我有一个场景大纲,我需要在此功能的其他场景中重复这些步骤,并且我不想在功能文件中手动复制这些步骤。

我试过Background但还没有成功。

这是场景:

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|

第二种情况:

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|

我不想使用execute_steps在所有步骤中重复的所有场景。

4

0 回答 0