我已经过滤了列出所有任务的下拉列表。当我在搜索框中输入字母时,我会看到一个以这些字母开头的任务列表。
我的 Serenity-JS / Cucumber 测试输入了“Given”中的前两个字符,请参见下面的黄瓜。但我正在尝试使用 Serenity 从选项列表中选择一个项目。
Given James has entered 'Ta' into the tasks box
When he selects 'Take out the Trash' from the task list options
Then he sees 'Take Out the Trash' in the heading
我用来查找任务的代码是这样的:
static List_Of_All_Tasks = Target.the('List of all tasks').located(by.className('task'));
这将返回“任务”列表
我的问题是使用普通的 Serenity-js 模式。如何选择列表中的项目?
需要一个目标,Click.on()
但我如何指定类似的东西List_Of_All_Tasks.located(by.id='Take_Out_The_Trash')