Calabash - 无法测试触摸事件

Calabash - can't test touch events

我正在使用 Calabash 通过 UI 自动执行一些测试,但我遇到了一些问题。

我的步骤如下:Then I touch the "login" button.

当我运行cucumber时,控制台抛出这个错误:

Could not parse response ''; the app has probably crashed (RuntimeError)

环境:

重现步骤:

控制台跟踪:

RuntimeError: Could not parse response ''; the app has probably crashed from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:33:in rescue in uia' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:30:in uia' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:454:in uia_handle_command' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:201:in uia_tap_offset' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/actions/instruments_actions.rb:93:in query_action' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/actions/instruments_actions.rb:15:in touch' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/core.rb:1166:in query_action_with_options' from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/core.rb:177:in touch' from (irb):2 from /Users/felipepenariveros/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in <main>'

可能与已在 Github 中关闭的问题有关:https://github.com/calabash/calabash-ios/issues/600

有谁知道我该如何解决这个问题?

我解决了这个问题。

在模拟器中,我选择了重置内容和设置...并且成功了。

感谢您的帮助! (@jmoody 和@Lasse)。

我的项目(Xcode 7.0.1、iOS 9.0.2 在物理设备 (iPod touch)、Calabash 0.14.3 上遇到了类似的问题。

对我有用的是将 :uia_strategy:shared_strategy 更改为 :host。所以现在我在 features/support/01_launch.rb 中的场景块看起来像这样:

Before do |scenario|
  options = {
    :uia_strategy => :host      #used to be shared_strategy - but that failed
  }
  @calabash_launcher = Calabash::Cucumber::Launcher.new
  unless @calabash_launcher.calabash_no_launch?
    @calabash_launcher.relaunch(options)
    @calabash_launcher.calabash_notify(self)
  end
end

希望这对正在为类似问题绞尽脑汁的其他人有所帮助。