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

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 ...@@ -107,9 +107,9 @@ end
def test_06_remove_cluster def test_06_remove_cluster
clustered = $b.clone_info('1') clustered = $b.clone_info('1')
clustered[:cluster].click 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 $b.clone_in_cluster('1', '2')[:delete].click
assert (not $b.clone_cluster('1').present?) assert (not $b.clone_cluster('1').present?)
assert ($b.clone_in_scatterplot('1').present?) assert ($b.clone_in_scatterplot('1').present?)
...@@ -337,6 +337,12 @@ class VidjilBrowser < Watir::Browser ...@@ -337,6 +337,12 @@ class VidjilBrowser < Watir::Browser
return div(:id => 'list_clones') return div(:id => 'list_clones')
end end
def until(extra = {})
default = {timeout: 3}
Watir::Wait.until(default) { yield }
protected protected
def scatterplot_id(number=1) 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