calabash-ios“未定义的步骤”,即使它存在

时间:2013-12-05 09:16:07

标签: cucumber

新手到calabash-ios Calabash-ios说“Undefined Step”即使它存在

我已将此代码写入 my_first.feature

  Then I set “Name“ into “Yaseen“

之后我将步骤定义为 my_first_steps.rb

  Then(/^I set "([^\"]*)" into "([^\"]*)" $/) do |placeholder,input|
  set_text("textField placeholder:'#{placeholder}'",'#{input}')
  end

显示步骤未定义

 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

抱歉我的英文

2 个答案:

答案 0 :(得分:1)

在$ / in步骤定义之前不应该有任何空格。试试这个

 Then(/^I set "([^\"]*)" into "([^\"]*)"$/) do |placeholder,input|
      set_text("textField placeholder:'#{placeholder}'",'#{input}')
      end

答案 1 :(得分:1)

在你的步骤中,你有'聪明'的引号与直引号。

Then I set “Name“ into “Yaseen“

将它们更改为直引号。

Then I set "Name" into "Yaseen"