我可以对多个方案大纲使用一个示例吗?

时间:2018-08-22 10:52:26

标签: cucumber feature-extraction python-behave

这是我正在使用的代码:

Scenario Outline: Fill <answers> for Shares
  When Select one of "<answers>" from Shares
  Then One of the Shares dropdown "<answers>" will be visible

 Scenario Outline: Fill <answers> for Forex
  When Select one of "<answers>" from Forex
  Then One of the Forex dropdown "<answers>" will be visible

Examples:
  | answers    |
  | Frequently |
  | Sometimes  |
  | No         |

但是我收到一个错误,即第一个方案大纲没有示例。 关键是:这个示例是重复的,所以我问我可以将一个示例表用于多个方案大纲吗?

1 个答案:

答案 0 :(得分:0)

场景大纲必须有示例。 您可以在下面的单个方案大纲中使用所有选项。

Scenario Outline: Fill <answers> for Forex
  When Select one of "<answers>" from <type>
  Then One of the Forex dropdown "<answers>" will be visible
Examples:
  |type   | answers    |
  |forex  | Frequently |
  |forex  | Sometimes  |
  |forex  | No         |
  |shares | Frequently |
  |shares | Sometimes  |
  |shares | No         |