Cucumber Frank Cumber测试用例在使用“时挂起”;“当我等待时”;试验

Cucumber Frank Cumber测试用例在使用“时挂起”;“当我等待时”;试验,cucumber,frank,Cucumber,Frank,我正在使用frank cucumber测试我的iOS应用程序,当我的测试采用以下形式时遇到了一些问题 When I wait to see "OpenButton" 如果具有可访问性标签“OpenButton”的UIView从未出现,则cucumber将挂起,而不是在达到等待超时后超时并在测试中报告错误 由于我甚至没有看到在core\u frank\u steps.rb中使用WAIT\u TIMEOUT,我想知道这是否就是任何形式为“When I WAIT…”的测试用例将挂起的原因 注:可以找

我正在使用frank cucumber测试我的iOS应用程序,当我的测试采用以下形式时遇到了一些问题

When I wait to see "OpenButton"
如果具有可访问性标签“OpenButton”的UIView从未出现,则cucumber将挂起,而不是在达到等待超时后超时并在测试中报告错误

由于我甚至没有看到在core\u frank\u steps.rb中使用WAIT\u TIMEOUT,我想知道这是否就是任何形式为“When I WAIT…”的测试用例将挂起的原因

注:可以找到core_frank_steps.rb

上述功能帮助我们避开了一些等待场景

# Polls every 0.1s , returns true when element is present
# @param selector [String] Frankly selector e.g. view marked:''
# @param timeout [Int] seconds to wait
def wait_for_element(selector, timeout=10)

  #the return value of the yield expression isn't working, so we use a closure
  res = nil
  wait_until(:timeout => timeout, :message => "Waited for element #{selector} to exist") {
    res = element_exists(selector)
  }
  res
end