Calabash-iOS:每次断言失败时都会遇到堆栈级别太深(SystemStackError)错误

Calabash-iOS : stack level too deep (SystemStackError) error is encountered each time an assertion is failing

每次断言失败时我都会遇到 "stack level too deep (SystemStackError) " 错误,无论实际情况如何:timeout_message

以下代码示例只是每次断言失败时出现上述错误的众多代码示例中的两个:

 def wait_and_touch(element)
    when_element_exists(element, :timeout => 10, :timeout_message => "[#{element}] element was not identified")
  end

  def check_user_message(usr)
    usr_array = usr.gsub(",", " ").split
    usr_array.each do |item|
      f_name = @test_data.get_first_name(item)
      wait_for(:timeout => 5, :timeout_message => "[FAIL] The message from #{f_name} should be displayed as unread!") {
        query(panel_1_msg_cell + " descendant view {text CONTAINS '#{f_name}'}", :font).first.include? 'Roboto-Black' }
    end
  end

我目前正在使用 calabash -v 0.20.0 版本 ruby-2.3.1 [ x86_64 ], OS X El Capitan, -v 10.11.6

知道为什么会这样吗?

谢谢

我相信你在某处打电话给 include Calabash::Cucumber::Operations。您不需要在代码中的任何地方 include 操作。