2
我想写如下的jBehave步骤;写jBehave示例步骤
@When("I perform <someAction> on $panel")
所以我可以有步骤,像
i. When I perform Action1 on Panel1
ii. When I perform Action2 on Panel2
现在你可以看到,这一步有占位
1. someAction which actually comes via meta
2. $panel which is taken from the step text in the story
的混合但这不是由我的工作和我空指针异常
它的工作原理如果我写
@When("I perform <someAction> on Panel1")
即我不能在同一步骤中使用2个占位符。
但由于这是一个通用步骤,我不想硬编码任何值。
其实我需要2个参数的方法; panelId和someAction – testndtv
@Named参数没有限制,请检查http://jbehave.org/reference/stable/parameter-injection.html – RamonBoza