我想"等待"两个uiview
中的任何一个出现,然后再检查某些东西,
如果我想等待一个特定的元素,我可以使用 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|
我该怎么做?
您可以使用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