Commit e9a82bd8 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-cs/3695-functional-tests-with-chrome' into 'dev'

Client functional tests with chrome or recent Firefox

See merge request !409
parents 22f38c36 efbda870
Pipeline #67807 passed with stages
in 6 minutes and 12 seconds
......@@ -878,7 +878,7 @@ a.tag-link {
.modal.info-container {
top: 50px;
left: 495px;
max-width: calc(100% - 475px + 60px);
max-width: calc(100% - 535px);
height: calc(100% - 215px);
}
.modal.jstree-container {
......
......@@ -878,7 +878,7 @@ a.tag-link {
.modal.info-container {
top: 50px;
left: 495px;
max-width: calc(100% - 475px + 60px);
max-width: calc(100% - 535px);
height: calc(100% - 215px);
}
.modal.jstree-container {
......
......@@ -878,7 +878,7 @@ a.tag-link {
.modal.info-container {
top: 50px;
left: 495px;
max-width: calc(100% - 475px + 60px);
max-width: calc(100% - 535px);
height: calc(100% - 215px);
}
.modal.jstree-container {
......
......@@ -876,7 +876,7 @@ a.tag-link {
.modal.info-container {
top: 50px;
left: 495px;
max-width: calc(100% - 475px + 60px);
max-width: calc(100% - 535px);
height: calc(100% - 215px);
}
.modal.jstree-container {
......
......@@ -878,7 +878,7 @@ a.tag-link {
.modal.info-container {
top: 50px;
left: 495px;
max-width: calc(100% - 475px + 60px);
max-width: calc(100% - 535px);
height: calc(100% - 215px);
}
.modal.jstree-container {
......
......@@ -1054,7 +1054,7 @@ a.tag-link {
&.data-container, &.info-container{
top: 50px;
left: 20px + @width_left_container;
max-width: calc(~"100%" - @width_left_container + 60px);
max-width: calc(~"100%" - (@width_left_container + 60px));
height: calc(~"100%" - 215px);
}
......
......@@ -76,7 +76,7 @@ class BrowserTest < MiniTest::Test
# check the 'import data' menu element, and click on it
assert ($b.div(:id => 'demo_file_menu').present?), "File menu is not present"
# $b.div(:id => 'demo_file_menu').hover
$b.div(:id => 'demo_file_menu').hover
$b.div(:id => 'demo_file_menu').click
assert ($b.div(:id => 'demo_file_menu').a(:id => 'import_data_anchor').present?), "'import data' not present"
$b.div(:id => 'demo_file_menu').a(:id => 'import_data_anchor').click
......@@ -97,10 +97,10 @@ class BrowserTest < MiniTest::Test
def close_everything
if defined? $b
print "\nTests finished, closing browser.\n"
$b.close
if ENV['HEADLESS']
$headless.destroy
else
$b.close
end
end
end
......
......@@ -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?)
......@@ -129,7 +129,7 @@ end
clustered = $b.clone_info('1')
assert (clustered[:name].text == 'clone2')
assert ($b.clone_in_scatterplot('1').present?)
assert (not $b.clone_in_scatterplot('2').present?)
$b.until{ not $b.clone_in_scatterplot('2').present? }
end
def test_08_select_cluster
......@@ -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
......@@ -219,6 +219,10 @@ class TestMultilocus < BrowserTest
def test_14_export_sample_report
if ENV['WATIR_CHROME']
skip "Issue #3699 must be solved first"
end
assert ($b.scatterplot_x_legend(0).text.include? 'TRB'), "Current system should be TRB"
# Select a clone
......@@ -291,7 +295,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 +372,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.
......
......@@ -7,9 +7,16 @@ class VidjilBrowser < Watir::Browser
if ENV['WATIR_BROWSER_PATH']
print "Using custom browser location " + ENV['WATIR_BROWSER_PATH'] + "\n"
Selenium::WebDriver::Firefox.path = ENV['WATIR_BROWSER_PATH']
Selenium::WebDriver::Chrome.path = ENV['WATIR_BROWSER_PATH']
end
# :chrome or :safari
super :firefox, :marionette => false
if ENV['WATIR_CHROME']
super :chrome
elsif ENV['WATIR_MARIONETTE']
super :firefox
else
super :firefox, :marionette => false
end
print "Running "+driver.capabilities.browser_name+" "+driver.capabilities.version+"\n"
end
......@@ -337,6 +344,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