【发布时间】:2013-03-15 20:36:22
【问题描述】:
当一个功能需要一些给定的步骤时,您需要为每个场景指定“鉴于我已经做了一些事情和其他事情以及最后一件事......”。为每个场景执行所有这些步骤可能很乏味。
一种解决方案可能是在一个给定的步骤中指定所有这些(假设我已准备好测试功能 X)。但是,在阅读功能步骤时,它并不是很精确。
这就是为什么我想知道步骤定义是否可以在功能范围内使用。我会使用这样的东西:
特征:我的特征
Obvious feature description here. Given I have done something And something else And the last thing场景:Y 验证
When I type X Then I should see Y场景:Z 验证
When I type X Then I should see Z
关于这个:
特征:我的特征
Obvious feature description here.场景:Y 验证
Given I have done something And something else And the last thing When I type X Then I should see Y场景:Z 验证
Given I have done something And something else And the last thing When I type X Then I should see Z
欢迎任何解决方案,但我希望在阅读 .feature 文件时可以理解一些内容,而不必深入研究代码。
谢谢
【问题讨论】:
标签: specflow