在以后的方案中重复上一个方案中的步骤

时间:2015-11-12 17:45:31

标签: python-behave

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

我尝试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用于所有步骤中复制的所有方案。

0 个答案:

没有答案