Ruby 为什么我会得到';未定义的动态步长';黄瓜?
我有以下步骤定义(只是为了说明我的问题): 在我的功能文件中,当我调用时:Ruby 为什么我会得到';未定义的动态步长';黄瓜?,ruby,cucumber,automated-tests,Ruby,Cucumber,Automated Tests,我有以下步骤定义(只是为了说明我的问题): 在我的功能文件中,当我调用时: When the calculator is run 我收到了错误消息: Undefined dynamic step: "When xxx the calculator is run xxx" (Cucumber::UndefinedDynamicStep) ./features/step_definitions/calculator_steps_when.rb:2:in `/^the calculator is r
When the calculator is run
我收到了错误消息:
Undefined dynamic step: "When xxx the calculator is run xxx" (Cucumber::UndefinedDynamicStep)
./features/step_definitions/calculator_steps_when.rb:2:in `/^the calculator is run$/'
features/adding.feature:11:in `When the calculator is run'
features/adding.feature:6:in `When the calculator is run'
根据文件,这应该是可行的。起初我在不同的文件中有步骤,我想可能我必须提供一些include指令,但现在即使步骤在同一个文件中也会发生。我错过了什么
感谢您在这一行:
step %{When xxx the calculator is run xxx}
移除“何时”按钮,它应该可以正常工作
你可以在网上查一下。他们给出的
步骤
示例中没有“When”一词。是的,它很有效,谢谢。我还注意到,如果我将“步骤”改为“步骤”,也会起作用。因此,步骤%{xxx计算器运行xxx}或步骤“xxx计算器运行xxx”或步骤%{xxx计算器运行xxx}都可以,但我使用的一个没有。谢谢-我发现,如果您使用步骤
进行动态表步骤,您也恰好需要When/And/Then
前缀。
step %{When xxx the calculator is run xxx}