Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 6012db3e authored by Marc Duez's avatar Marc Duez
Browse files

watir : update test

parent b6cea333
......@@ -35,7 +35,7 @@ class Browser < MiniTest::Test
folder_path = Dir.pwd
folder_path.sub! '/browser/test', ''
index_path = 'file://' + folder_path + '/browser/index.html'
data_path = folder_path + '/doc/analysis-example1.vidjil'
data_path = folder_path + '/doc/analysis-example.vidjil'
analysis_path = folder_path + '/browser/test/test.analysis'
if ENV['LIVE_SERVER']
......@@ -82,26 +82,27 @@ class Browser < MiniTest::Test
end
def test_00_info_segmentation
assert ($b.div(:id => 'info_segmented').text.include? '335 662 reads (76.78%)'), ' Incorrect number of segmented reads'
assert ($b.div(:id => 'info_segmented').text.include? '742 377 reads (94.35%)'), ' Incorrect number of segmented reads'
end
def test_00_info_reads
assert ($b.div(:id => 'info_total').text.include? '437 164 reads'), 'Incorrect number of reads'
assert ($b.div(:id => 'info_total').text.include? '786 861 reads'), 'Incorrect number of reads'
end
def test_00_default_point_name
assert ($b.div(:id => 'info_point').text.include? 'T8045-BC081-Diag'), 'Incorrect point name in info box'
assert ($b.div(:id => 'info_point').text.include? 'helloworld'), 'Incorrect point name in info box'
end
def test_00_germline
assert ($b.div(:id => 'info').span(:class => 'systemBoxNameMenu').text == 'GTRG'), 'Incorrect system name'
assert ($b.div(:id => 'info').span(:class => 'systemBoxNameMenu').text.include? 'TRA'), 'missing system TRA'
end
def test_00_legend_scatterplot
assert ($b.scatterplot_x_legend(0).text == 'TRGV5'), "Bad legend for scatterplot"
assert ($b.scatterplot_x_legend(1).text == '?'), "Bad legend for scatterplot"
assert ($b.scatterplot_y_legend(0).text == 'TRGJ1'), "Bad legend for scatterplot"
assert ($b.scatterplot_y_legend(1).text == '?'), "Bad legend for scatterplot"
assert ($b.scatterplot_x_legend(0).text == 'TRBV1'), "Bad legend for scatterplot"
assert ($b.scatterplot_x_legend(4).text == '?'), "Bad legend for scatterplot"
assert ($b.scatterplot_y_legend(0).text == 'TRBJ1-1'), "Bad legend for scatterplot"
assert ($b.scatterplot_y_legend(9).text == '?'), "Bad legend for scatterplot"
end
def test_00_info_point
......@@ -110,19 +111,19 @@ class Browser < MiniTest::Test
assert ($b.div(:id => 'info_timepoint').visible?), "After clicking info timepoint should be visible"
table = $b.div(:id => 'info_timepoint').table
assert (table[1][1].text == '437164'), "Incorrect number of reads in infopoint"
assert (table[2][1].text.include? '335662'), "Incorrect number of reads in infopoint"
assert (table[1][1].text == '786861'), "Incorrect number of reads in infopoint"
assert (table[2][1].text.include? '742377'), "Incorrect number of reads in infopoint"
$b.div(:id => 'data-container').span(:class => 'closeButton').click
assert (not $b.div(:id => 'info_timepoint').present?), "Info timepoint should not be present"
end
def test_01_init
begin
assert ( $b.clone_in_list('0').exists?), ">>fail init : clone 0 missing in list"
assert ( $b.clone_in_scatterplot('0').exists?), ">>fail init : clone 0 missing in scatterplot"
assert ( $b.clone_in_graph('0').exists?), ">>fail init : clone 0 missing in graph"
assert ( $b.clone_info('0')[:size].text == '72.47%' ) , ">>fail init : wrong clone size "
rescue
assert (false), "missing element to run test_01_init \n"
end
assert ( $b.clone_in_list('25').exists?), ">>fail init : clone 0 missing in list"
assert ( $b.clone_in_scatterplot('25').exists?), ">>fail init : clone 0 missing in scatterplot"
#assert ( $b.clone_in_graph('25').exists?), ">>fail init : clone 0 missing in graph"
assert ( $b.clone_in_list('25').text.include? '0.130%' ) , ">>fail init : wrong clone size "
end
def test_02_fold_left_menu
......@@ -134,8 +135,8 @@ class Browser < MiniTest::Test
end
def test_03_rename_clone_by_clicking
clone_name = $b.clone_info('0')[:name]
assert (clone_name.text == 'clone-001'), " >> clone name is no corect"
clone_name = $b.clone_info('25')[:name]
assert (clone_name.text == 'TRBV29*01 -1/0/-0 TRBD1*01 -2/0/-5 TRBJ2-5*01'), " >> clone name is not corect"
clone_name.double_click
$b.clone_name_editor.set 'toto'
......@@ -144,7 +145,8 @@ class Browser < MiniTest::Test
end
def test_04_rename_clone_by_enter
clone_name = $b.clone_info('0')[:name]
clone_name = $b.clone_info('25')[:name]
assert (clone_name.text == 'toto'), " >> clone name is not correct"
clone_name.double_click
$b.clone_name_editor.set 'other test'
......@@ -156,19 +158,19 @@ class Browser < MiniTest::Test
end
def check_when_list_or_scatterplot_focused
assert ( $b.clone_in_scatterplot('0', :class => 'circle_focus').exists?), ">> fail to focus correct plot after hovering a clone in the list"
assert ( $b.clone_in_graph('0', :class => "graph_focus").exists?), ">> fail to focus correct graphLine after hovering a clone in the list"
assert ( $b.clone_in_scatterplot('25', :class => 'circle_focus').exists?), ">> fail to focus correct plot after hovering a clone in the list"
assert ( $b.clone_in_graph('25', :class => "graph_focus").exists?), ">> fail to focus correct graphLine after hovering a clone in the list"
clone_name = $b.clone_info('0')[:name]
clone_name = $b.clone_info('25')[:name]
assert ( $b.infoline.text == clone_name.text), ">> Clone name is not correct in focus div"
end
def test_05_focus_in_list
begin
$b.unselect
#test hover a clone in the list
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_in_list('0').hover
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_in_list('25').hover
check_when_list_or_scatterplot_focused
rescue
......@@ -179,8 +181,8 @@ class Browser < MiniTest::Test
def test_05_focus_in_scatterplot
begin
$b.unselect
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_in_scatterplot('0').hover
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_in_scatterplot('25').hover
check_when_list_or_scatterplot_focused
rescue
......@@ -189,68 +191,68 @@ class Browser < MiniTest::Test
end
def check_when_list_or_scatterplot_clicked
clone_name = $b.clone_info('0')[:name]
clone_name = $b.clone_info('25')[:name]
assert ( $b.infoline.text == clone_name.text), ">> Clone name is not correct in focus div"
assert ( $b.clone_in_list('0').class_name == "list list_select" )
assert ( $b.clone_in_scatterplot('0', :class => "circle_select").exists?)
assert ( $b.clone_in_graph('0', :class=> "graph_select").exists?)
assert ( $b.clone_in_segmenter('0').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
assert ( $b.clone_in_list('25').class_name == "list list_select" )
assert ( $b.clone_in_scatterplot('25', :class => "circle_select").exists?)
assert ( $b.clone_in_graph('25', :class=> "graph_select").exists?)
assert ( $b.clone_in_segmenter('25').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
stats = $b.statsline
assert (stats.text.include? '1 clone'), ">> Incorrect stats, should have one clone"
assert (stats.text.include? '243 241 reads'), ">> Incorrect stats, should have 243241 reads"
assert (stats.text.include? '72.47%'), ">> Incorrect stats, should be at 72.47%"
assert (stats.text.include? '962 reads'), ">> Incorrect stats, should have 962 reads"
assert (stats.text.include? '0.130%'), ">> Incorrect stats, should be at 0.130%"
end
def test_08_click_in_list
#test select a clone in the list
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_info('0')[:name].click()
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_info('25')[:name].click()
check_when_list_or_scatterplot_clicked
#unselect
$b.unselect
assert ( $b.clone_in_list('0').class_name == "list" )
assert ( $b.clone_in_list('25').class_name == "list" )
end
def test_08_click_in_scatterplot
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_in_scatterplot('0').click
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_in_scatterplot('25').click
check_when_list_or_scatterplot_clicked
#unselect
$b.unselect
assert ( $b.clone_in_list('0').class_name == "list" )
assert ( $b.clone_in_list('25').class_name == "list" )
end
def test_09_normalize
$b.clone_info('0')[:star].click
$b.clone_info('25')[:star].click
$b.tag_selector_edit_normalisation.wait_until_present
$b.tag_selector_edit_normalisation.set('0.01')
$b.tag_selector_normalisation_validator.click
assert ( $b.clone_info('0')[:size].text == '1.000%' ) , ">> fail normalize on : wrong clone size "
assert ( $b.clone_info('25')[:size].text == '1.000%' ) , ">> fail normalize on : wrong clone size "
$b.menu_settings.click
$b.radio(:id => 'reset_norm').click
assert ( $b.clone_info('0')[:size].text == '72.47%' ) , ">> fail normalize off : wrong clone size "
assert ( $b.clone_info('25')[:size].text == '0.130%' ) , ">> fail normalize off : wrong clone size "
end
def test_10_imgt
begin
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_in_scatterplot('0').click
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_in_scatterplot('25').click
$b.span(:id => "toIMGT" ).click
assert ( $b.window(:title => "IMGT/V-QUEST").exists? ) , ">> fail opening IMGT "
$b.window(:title => "IMGT/V-QUEST").use do
assert ($b.text.include? "Number of analysed sequences: 1"), ">> fail IMGT analysis"
assert ($b.text.include? "Homsap TRGV5*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap TRGJ1*02"), ">> IMGT expected J not found"
assert ($b.text.include? "Homsap TRBV28*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap TRBJ2-5*01"), ">> IMGT expected J not found"
end
$b.window(:title => "Vidjil").use
......@@ -263,16 +265,16 @@ class Browser < MiniTest::Test
def test_11_igBlast
begin
$b.clone_in_scatterplot('0').wait_until_present
$b.clone_in_scatterplot('0').click
$b.clone_in_scatterplot('25').wait_until_present
$b.clone_in_scatterplot('25').click
$b.span(:id => "toIgBlast" ).click
assert ( $b.window(:title => "IgBLAST Search Results").exists? ) , ">> fail opening igblast "
$b.window(:title => "IgBLAST Search Results").use do
assert ($b.text.include? "Length=119"), ">> igblast: was not launched on the correct sequence"
assert ($b.text.include? "TRGV5*01"), ">> igblast: expected V not found"
assert ($b.text.include? "TRGJ1*02,TRGJ1*01,TRGJ2*01"), ">> igblast: expected Js not found"
assert ($b.text.include? "Length=180"), ">> igblast: was not launched on the correct sequence"
assert ($b.text.include? "TRBV28*01"), ">> igblast: expected V not found"
assert ($b.text.include? "TRBJ2-5*01"), ">> igblast: expected Js not found"
end
$b.window(:title => "Vidjil").use
......@@ -285,13 +287,13 @@ class Browser < MiniTest::Test
def test_12_tag
begin
$b.clone_info('0')[:star].click
$b.clone_info('25')[:star].click
$b.tag_item('0')[:name].click
$b.unselect
assert ($b.clone_info('0')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , ">> fail tag : clone color hasn't changed"
assert ($b.clone_info('25')[:name].style('color') == 'rgba(220, 50, 47, 1)' ) , ">> fail tag : clone color hasn't changed"
rescue
assert (false), "missing element to run test_13_tag \n"
assert (false), "missing element to run test_12_tag \n"
end
end
......@@ -301,32 +303,34 @@ class Browser < MiniTest::Test
tagSelector = $b.tag_selector
filterMenu = $b.menu_filter
$b.clone_info('0')[:star].click
$b.clone_info('25')[:star].click
edit = $b.tag_item('0')[:edit]
edit.wait_until_present
edit.click
$b.tag_selector_edit_name.set 'test_tag'
$b.tag_selector_name_validator.click
$b.tag_item('2')[:edit].click
$b.clone_info('25')[:star].click
edit.wait_until_present
edit.click
edit = $b.tag_item('2')[:edit].click
$b.tag_selector_edit_name.set 'other_test'
$b.send_keys :return
$b.tag_selector_close.click
tagSelector.wait_while_present
filterMenu.click
assert ( filterMenu.text.include? 'test_tag') , "fail edit tag with mouse : tag name in display menu hasn't changed"
assert ( filterMenu.text.include? 'other_test') , "fail edit tag with keyboard : tag name in display menu hasn't changed"
$b.clone_in_list('0')[:star].click
assert ( tagSelector.text.include? 'test_tag') , "fail edit tag with mouse : tag name in tag selector hasn't changed"
$b.clone_info('25')[:star].click
#assert ( tagSelector.text.include? 'test_tag') , "fail edit tag with mouse : tag name in tag selector hasn't changed"
assert ( tagSelector.text.include? 'other_test') , "fail edit tag with keyboard : tag name in tag selector hasn't changed"
tagSelector.span(:class => 'closeButton').click
end
end
# Not really a test, used to close server at the end
def test_zz_close_everything
......
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