Commit 64efe102 authored by Mikaël Salson's avatar Mikaël Salson

browser/tests/functional: Use until to wait for element to arrive

In Chrome we have some cases where the element is not ready yet as we test it.
Thus we prefer using the until function to make sure the element is as expected within
a short amount of time
parent 9eadfc46
......@@ -148,7 +148,7 @@ end
assert ($b.clone_in_scatterplot('1', :class => "circle_select").exists?)
assert ($b.clone_in_graph('1', :class=> "graph_select").exists?)
assert ($b.clone_in_segmenter('1').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
assert ( $b.clone_in_scatterplot('2', :class => "circle_select").exists?)
$b.until { $b.clone_in_scatterplot('2', :class => "circle_select").exists? }
assert ( $b.clone_in_graph('2', :class=> "graph_select").exists?)
assert ( $b.clone_in_segmenter('2').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
......
......@@ -197,7 +197,7 @@ class TestMultilocus < BrowserTest
name.click
name.wait_while(&:present?)
assert ($b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , ">> fail tag : clone color hasn't changed"
$b.until {$b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' }
end
end
......@@ -291,7 +291,7 @@ class TestMultilocus < BrowserTest
$b.clone_info('90')[:cluster].click
assert ( $b.clone_in_scatterplot('1', :class => "circle_select").exists?)
$b.until { $b.clone_in_scatterplot('1', :class => "circle_select").exists?}
assert ( $b.clone_in_graph('1', :class=> "graph_select").exists?)
assert ( $b.clone_in_segmenter('1').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
assert ( $b.clone_in_scatterplot('37', :class => "circle_select").exists?)
......@@ -368,7 +368,7 @@ class TestMultilocus < BrowserTest
$b.clone_info('25')[:star].click
$b.element(:id => 'tagElem_0').click
assert ($b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , "clone 25 have changed color"
$b.until {$b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' } # clone 25 should have changed color
assert ( not $b.clone_info('88')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , "clone 88 (second of the selection) haven't chaged color "
......
......@@ -44,8 +44,7 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
$b.tag_item('3')[:name].click
$b.clone_in_segmenter('1').hover # Change clone to hover: on hover color doesn't change
sleep(1)
assert ($b.clone_info_segmenter('0')[:name].style('color') == tagColor), "Clone has not changed color in segmenter"
$b.until { $b.clone_info_segmenter('0')[:name].style('color') == tagColor }
# Must remove rgb from the start of the fill style, and the closing parentheses at the end,
# as tagColor is a rgba color with four components, and not just a rgb as the fill color.
......
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