Commit bcf3a522 authored by Mikael Salson's avatar Mikael Salson

browser_test: test manual clustering

parent b931441c
......@@ -68,8 +68,56 @@ class TestSimple < BrowserTest
assert ($b.clone_in_graph('0').visible?)
end
def test_05_check_cluster
clustered = $b.clone_info('1')
assert (clustered[:name].text == 'clone2'), "First clone of cluster should be clone2"
assert ($b.clone_in_scatterplot('1').visible?)
assert (not $b.clone_in_scatterplot('2').visible?)
def test_98_select_other
clustered[:cluster].click
assert ($b.clone_in_scatterplot('1').visible?)
assert ($b.clone_in_scatterplot('2').visible?)
first_in_cluster = $b.clone_in_cluster('1', '1')
second_in_cluster = $b.clone_in_cluster('1', '2')
assert (first_in_cluster[:name].text == 'clone2')
assert (second_in_cluster[:name].text == 'clone3')
# Close the cluster
clustered[:cluster].click
end
def test_06_remove_cluster
clustered = $b.clone_info('1')
clustered[:cluster].click
$b.clone_in_cluster('1', '2')[:delete].click
assert (not $b.clone_cluster('1').visible?)
assert ($b.clone_in_scatterplot('1').visible?)
assert ($b.clone_in_scatterplot('2').visible?)
clone3 = $b.clone_info('2')
assert (clone3[:name].text == "clone3")
assert (clone3[:system].text == "G")
end
def test_07_create_cluster
$b.clone_in_scatterplot('1').click
$b.clone_in_scatterplot('2').click(:control)
$b.merge.click
clustered = $b.clone_info('1')
assert (clustered[:name].text == 'clone2')
clustered[:cluster].click # Close the cluster
assert ($b.clone_in_scatterplot('1').visible?)
assert (not $b.clone_in_scatterplot('2').visible?)
end
def test_90_select_other
# Click on first point
$b.graph_x_legend('1').click
assert ($b.graph_x_legend('1', :class => 'graph_time2').exists?)
......
......@@ -27,7 +27,21 @@ class VidjilBrowser < Watir::Browser
name: clone.element(:class => 'nameBox'), info: clone.element(:class => 'infoBox'),
star: clone.element(:class => 'starBox'), size: clone.element(:class => 'sizeBox')}
end
# Return the clone cluster for clone ID
def clone_cluster(id, extra = {})
return clone_in_list(id, extra).element(:id => 'cluster'+id)
end
# Return the n-th clone in a cluster for clone ID
# n: a str (starting at 1)
def clone_in_cluster(id, n, extra = {})
cluster = clone_cluster(id, extra).element(:id => '_'+n)
return {object: cluster,
name: cluster.element(:class => 'nameBox'), size: cluster.element(:class => 'sizeBox'),
info: cluster.element(:class => 'infoBox'), delete: cluster.element(:class => 'delBox')}
end
# Return a hash with information on the sequence in the segmenter
# A hash with keys name, star and size defined with
# the corresponding elements in the segmenter.
......
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