1

uiview我想在检查某些东西之前“等待”两个s 中的任何一个出现,
如果我想等待一个特定元素,我可以使用 Frank 示例中提供的示例步骤之一:

Then /^I should wait to see "([^"]*)"$/ do |expected_mark|
  wait_for_element_to_exist("view marked:'#{expected_mark}'")
end

但我想要类似的东西:

Then /^I should wait to see either "([^"]*)" or "([^"]*)" $/ do |expected_mark, other_mark|  

我怎样才能做到这一点?

4

1 回答 1

1

您可以使用 wait_until 函数:

Then /^I should wait to see either "([^"]*)" or "([^"]*)" $/ do |expected_mark, other_mark|  
  browser.wait_until() {
    expected_mark.exists? or other_mark.exists?
  }
end
于 2012-12-17T07:08:11.923 回答