【发布时间】:2017-11-21 00:27:16
【问题描述】:
我从here 知道 scenario 和 scenario outline 之间的区别。
Scenario states 以更抽象的方式进行测试的一般点。同时,
scenario outline 提供了几个示例来帮助执行场景。
所以,我们通常写一个feature file 如下。它以scenario 开头,然后以scenario outline 完成。
功能:您的功能的标题 我想将此模板用于我的功能文件
Scenario: Eating
Given I have "N" cucumbers
When I eat "K" ones of them
Then I will have "N-K" ones
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
但这对我来说意义不大。我相信Scenario outline比较容易理解,所以没有必要用scenario来表达测试的大致观点。
你同意我的观点吗?
我的意思是,场景做什么,哪个场景大纲不能做什么?
我建议选择更简单的
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
我知道这会导致错误,但我认为如果黄瓜团队完全去除场景的概念,而是更多地支持场景大纲会更好。
【问题讨论】:
标签: cucumber