Reputation: 1696
Newbie to calabash-ios Calabash-ios says "Undefined Step" even though it exists
I've wrote this code into my_first.feature
Then I set “Name“ into “Yaseen“
After that I defined that step into my_first_steps.rb
Then(/^I set "([^\"]*)" into "([^\"]*)" $/) do |placeholder,input|
set_text("textField placeholder:'#{placeholder}'",'#{input}')
end
It shows the step is undefined
You can implement step definitions for undefined steps with these snippets:
Then(/^I set “Name“ into “Yaseen“$/) do
pending # express the regexp above with the code you wish you had
end
Sorry for my english
Upvotes: 0
Views: 644
Reputation: 2480
In your step you have 'smart' quotes vs. straight quotes.
Then I set “Name“ into “Yaseen“
Change them to straight quotes.
Then I set "Name" into "Yaseen"
Upvotes: 1
Reputation: 265
There should not be any space before $/ in step definition. Try this
Then(/^I set "([^\"]*)" into "([^\"]*)"$/) do |placeholder,input|
set_text("textField placeholder:'#{placeholder}'",'#{input}')
end
Upvotes: 1