我的故事中有以下内容,我正在尝试匹配
!-- Block 1
When I "action" of document "document" to "status" and nextAction
When I "action" for document "document" to "status" and nextAction
When I "action" document "document" to "status" and nextAction
!-- Block 2
When I "action" of document "document" and nextAction
When I "action" for document "document" and nextAction
When I "action" document "document" and nextAction
!-- Block 3
When I "action" of document "document" to "status"
When I "action" for document "document" to "status"
When I "action" document "document" to "status"
!-- Block 4
When I "action" of document "document"
When I "action" for document "document"
When I "action" document "document"
在"action"和document之间可能有of , for或空 到 "status"是可选的 并且 nextAction是可选的
在步骤文件中,我有以下内容
@When ("I \"$action\"{| of| for} document \"$document\"{ to \"$status\"|}{ and $nextAction|}")
这是匹配故事文件中的块 1 和 2,但不匹配块 3 和 4。
你能给我一些关于我需要如何修改步骤文件以匹配所有 4 个块的指示吗?
我尝试添加具有 to 状态的别名,并删除了下一步操作,但是 JBehave 错误并带有重复的候选步骤错误。
谢谢