这一步在我的Ruby功能的文件查找和访问客户记录:黄瓜元数不匹配错误
When I search with the following details: "<recordReference>", "<secondIdentifier>", "<postcode>":
| recordReference | secondIdentifier| postcode |
| REFABCDE12345678| IDcode1234 | PC11 1PC |
它具有这样的步骤定义:
When(/^I search with the following details: "(.*?)", "(.*?)", "(.*?)":$/) do |recordReference, secondIdentifier, postcode|
find(:css, "#dln").native.send_keys recordReference
find(:css, "#nino").native.send_keys secondIdentifier
find(:css, "#postcode").native.send_keys postcode
check 'confirmation'
click_button 'submit'
end
当它运行时,我得到以下错误:
Cucumber::ArityMismatchError: Your block takes 3 arguments, but the Regexp matched 4 arguments.
features/step_definitions/refactored_commands.rb:207:in `/^I search with the following details: "(.*?)", "(.*?)", "(.*?)":$/'
我做了什么错,怎么解决?
对于信息 - 我得到同样的错误消息,如果parenthases被取出步骤定义的:
When /^I search with the following details: "(.*?)", "(.*?)", "(.*?)":$/ do |recordReference, secondIdentifier, postcode|