葫芦ios触摸/点击问题

葫芦ios触摸/点击问题,ios,calabash-ios,Ios,Calabash Ios,我的应用程序有多个“向上投票”标签,按下后会变成“向上投票”,尽管所有的标签都有不同的“id”。 现在我想点击特定的“向上投票”按钮,并想检查它的文本是否更改为“向上投票”。 那么我的*.feature和*.rb步骤是什么呢? 我尝试了很多次不同的选择,但都没有成功 这就是我的sample.feture文件的工作方式 Scenario: Sample Scenario Given the app has launched Then I touch “UPVOTE” text Then I sh

我的应用程序有多个“向上投票”标签,按下后会变成“向上投票”,尽管所有的标签都有不同的“id”。

现在我想点击特定的“向上投票”按钮,并想检查它的文本是否更改为“向上投票”。 那么我的*.feature和*.rb步骤是什么呢? 我尝试了很多次不同的选择,但都没有成功

这就是我的sample.feture文件的工作方式

Scenario: Sample Scenario
Given the app has launched
Then I touch “UPVOTE” text
Then I should see UPVOTED
Then I wait for 10 seconds
我的示例_feature.rb文件是

Then /^I touch "([^\"]*)" text$/ do |arg1|
element = “UILabel marked:’#{arg1}’”
touch(element)
end
当前正在运行的代码向我显示

在遵循它之后,我更改了sample_feature.rb文件

Then /^I touch “UPVOTE” text$/ do
element = query(UILabel marked:’UPVOTE’)
touch(element)
end
它给了我错误

  Scenario: Sample Scenario    # features/sample.feature:3
  Given the app has launched # features/steps/sample_steps.rb:1
  Then I touch “UPVOTE” text # features/steps/sample_steps.rb:7
  undefined local variable or method `’UPVOTE’' for #       <Object:0x007fd514508b60> (NameError)
  ./features/steps/sample_steps.rb:23:in `/^I touch “UPVOTE” text$/'
  features/sample.feature:5:in `Then I touch “UPVOTE” text'
Then I should see UPVOTED  # features/steps/sample_steps.rb:34
Then I wait for 10 seconds # calabash-cucumber-0.19.1/features/step_definitions/calabash_steps.rb:202

  Failing Scenarios:
  cucumber features/sample.feature:3 # Scenario: Sample Scenario

  1 scenario (1 failed)
  4 steps (1 failed, 2 skipped, 1 passed)
  0m33.249s
场景:示例场景#功能/示例。功能:3
鉴于该应用程序已启动#功能/步骤/示例步骤。rb:1
然后我触摸“UPVOTE”文本#features/steps/sample_steps.rb:7
#的未定义局部变量或方法“UPVOTE”(NameError)
./features/steps/sample_steps.rb:23:in`/^I触摸“UPVOTE”文本$/'
功能/示例。功能:5:在`然后我触摸“向上投票”文本'
然后我应该看到向上投票的#features/steps/sample#u steps.rb:34
然后我等待10秒钟#calabash-cucumber-0.19.1/features/step_definitions/calabash_steps.rb:202
失败场景:
黄瓜特性/示例。特性:3#场景:示例场景
1个场景(1个失败)
4个步骤(1个失败,2个跳过,1个通过)
0m33.249s
我再次相应地修改了代码,等等。 这些并不是我做的唯一尝试,我已经完成了github预定义步骤、材料以及堆栈上的所有相关问题。 请帮忙。
提前感谢。

您的报价是另一个字符。“不同于”