Commit 9eadfc46 authored by Mikaël Salson's avatar Mikaël Salson

browser/tests/functional: Avoid wait_until warning

There was a deprecated warning because we tested the wait_until on
a variable that may change over time. The code has now be changed so that
the element is retrieved each time we test it.
Moreove the until() function may be useful elsewhere
parent 3f9bec2e
......@@ -107,9 +107,9 @@ end
def test_06_remove_cluster
clustered = $b.clone_info('1')
clustered[:cluster].click
$b.clone_in_cluster('1', '2')[:delete].wait_until(&:present?)
$b.until { $b.clone_in_cluster('1', '2')[:delete].present? }
$b.clone_in_cluster('1', '2')[:delete].click
assert (not $b.clone_cluster('1').present?)
assert ($b.clone_in_scatterplot('1').present?)
......
......@@ -337,6 +337,12 @@ class VidjilBrowser < Watir::Browser
return div(:id => 'list_clones')
end
def until(extra = {})
default = {timeout: 3}
default.merge(extra)
Watir::Wait.until(default) { yield }
end
protected
def scatterplot_id(number=1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment