i am having a problem with a feature file that i am currently working on, i
want to pass two arguments from one line of the feature file (from table)
to my step definition - is this possible? any of the examples i have looked
at in The Cucumber Book seem to have one argument per line.
Feature file:
When I add credits to users account "<credit_amount>" "<expiry_date>"
|credit_amount|expiry_date|
|100 |31/07/2012 |
|100 |01/01/2020 |
Then I should see amount and expiry date displayed
Step definition:
def add_credits (credit_amount, expiry_date)
@browser.link(:text => "Add Credit").click
@browser.frame(:id => "credit-add").input(:id => "amount").send_keys
credit_amount
@browser.frame(:id => "credit-add").input(:id => "expiry").send_keys
expiry_date
@browser.frame(:id => "credit-add").input(:id => "comment").send_keys
"test"
end
Error:
Your block takes 2 arguments, but the Regexp matched 3 arguments.
(Cucumber::ArityMismatchError)
Any help would be appreciated, thanks!
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]