【发布时间】:2017-06-20 18:45:57
【问题描述】:
在一个步骤定义中,我创建了一个名为“someFunction”的函数,该函数接受一个数据表,该数据表已在我的功能文件 Feature1.1 中定义。
Feature1.feature
Given: User enters the following data
Varibale1|Variable2|Variable3
Value1|Value2|Value3
StpeDef.java
@Given(“^User enters the following data$”)
public void someFunction(DataTable input){
}
现在在另一个功能文件“Feature2.feature”中,我的一个场景需要使用相同的步骤,即调用 someFunction。我知道我可以使用相同的步骤定义,但这是否意味着我必须在 Feature2 文件中重新定义相同的 DataTable 输入。 如果没有,我该怎么做? 请注意,我了解 Backgound 关键字及其用法,但如果我说我需要将这些场景保存在不同的功能文件中,应该如何做呢?
【问题讨论】:
标签: cucumber bdd cucumber-jvm gherkin