我阅读了很多文档,但我可以弄清楚如何使用参数创建功能。 我有一个带有一些文本框的表单,唯一重要的是“名称”输入。我想创建一个函数/功能来填充这些输入并通过参数传递“名称”的值
类似:
function textInputName(String name) {
name_locator = name
}
然后打电话
textInputName("Peter")
我试过这个:
功能:创建表单
Scenario:
And input(formNameTextBoxLocator, { title: '#(name)'})
然后这样称呼它:
call read('classpath:/WEB/Forms/createForm.feature') { name:"Peter" }
自己解决了:)
第一个功能
@ignore
Feature: createForm
* def Title = '#Title'
Scenario:
And input(formNameTextBox, Title)
第二个功能
* def formName = "Test form " + today
* call read('classpath:/WEB/Forms/createForm.feature'){ Title : #(formName)}