Commit 4755fb1c authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-c/2712-stage-external' into 'dev'

Feature c/2712 stage external

See merge request !113
parents 7d722503 f86c4071
Pipeline #10783 passed with stages
in 13 seconds
......@@ -11,6 +11,7 @@ stages:
- test_unit
- deploy_review
- test_functional
- test_functional_external
- test_shouldvdj
- valgrind_unit
- valgrind_functional
......@@ -78,7 +79,22 @@ test_browser-functional:
- make -C browser
- source /etc/profile.d/rvm.sh
- rvm use 2.1.1
- make headless_browser
- HEADLESS=1 make -C browser/test functional
artifacts:
paths:
- browser/
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- prod-client
test_browser-functional-external:
stage: test_functional_external
script:
- make -C browser
- source /etc/profile.d/rvm.sh
- rvm use 2.1.1
- HEADLESS=1 make -C browser/test external
artifacts:
paths:
- browser/
......
......@@ -5,9 +5,13 @@ unit: nightmare
headless:
HEADLESS=1 $(MAKE) functional
HEADLESS=1 $(MAKE) external
functional: ../../doc/analysis-example1.vidjil
sh launch_functional_tests
sh launch_functional_tests "functional/test_*rb"
external: ../../doc/analysis-example1.vidjil
sh launch_functional_tests "functional/external_test_*rb"
functional-rbx: ../../doc/analysis-example1.vidjil
LIVE_SERVER=http://app.vidjil.org/browser/ ruby test_browser.rb
......
......@@ -46,16 +46,16 @@ class BrowserTest < MiniTest::Test
print "Resize\n"
$b.window.resize_to(1500, 800)
print "Testing Vidjil browser at " + index_path + "\n"
print "Testing Vidjil client at " + index_path + "\n"
$b.goto index_path
# check that the browser loaded correctly
if not $b.div(:id => 'logo').present?
print "Loading of Vidjil browser failed. Do not execute remaining tests."
print "Loading of Vidjil client failed. Do not execute remaining tests."
exit
end
print "Vidjil browser loaded, launching tests.\n"
print "Vidjil client loaded, launching tests.\n"
# A live server can be configured with a database.
# The welcome popup should not be tested.
......@@ -82,10 +82,12 @@ class BrowserTest < MiniTest::Test
$b.div(:id => 'demo_file_menu').a(:id => 'import_data_anchor').click
# select data file
print " data: " + data_path + "\n"
$b.div(:id => 'file_menu').file_field(:name,"json").set(data_path)
# select analysis file
if analysis_path != nil
print " analysis: " + analysis_path + "\n"
$b.div(:id => 'file_menu').file_field(:name, "pref").set(analysis_path)
end
......
# coding: utf-8
load 'vidjil_browser.rb'
load 'browser_test.rb'
#browser test suite
class ExternalTest < BrowserTest
def setup
super
if not defined? $b
set_browser("/doc/analysis-example.vidjil")
end
end
def after_tests
end
def test_10_imgt
begin
$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 TRBV28*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap TRBJ2-5*01"), ">> IMGT expected J not found"
end
$b.window(:title => "").use
$b.window(:title => "IMGT/V-QUEST").close
$b.clone_in_scatterplot('26').click
$b.span(:id => "toIMGT" ).click
assert ( $b.window(:title => "IMGT/V-QUEST").exists? ) , ">> fail opening second 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 IGHV3-9*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap IGHJ6*02"), ">> IMGT expected J not found"
end
$b.window(:title => "").use
end
end
def test_10bis_imgt_post
begin
$b.clone_in_scatterplot('25').click
$b.span(:id => "toIMGTSeg" ).click
$b.segmenter_checkbox_imgt_vdj.wait_until_present
clone_info = $b.clone_info_segmenter('25')
productive_title = clone_info[:axis].element(:class => 'productivity-IMGT').title
assert (productive_title.include? 'productivity'), "IMGT should tell us the productivity of the sequence"
clone_segmenter = $b.clone_in_segmenter('25')
$b.segmenter_checkbox_imgt_vdj.click
highlights = clone_segmenter.spans(:class => 'highlight_border')
assert (highlights.size >= 2 && highlights.size <= 3), "We should have the V(D)J genes highlighted, we had %d highlights" % highlights.size
for h in highlights
assert (h.style('width').to_i >= 100), "Highlights should have a reasonable width, found to be %s" % h.style('width')
end
Watir::Wait.until(timeout=10) { clone_info[:identity].span.exists? }
clone_info[:identity].element(:text => "NaN%").wait_while_present
assert ((clone_info[:identity].text =~ /^[0-9\.]+%$/) == 0 ), "We should have identity rate (found: %s)" % clone_info[:identity].text
$b.unselect
end
end
def test_11_igBlast
begin
$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=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 => "IgBLAST Search Results").close
$b.window(:title => "").use
$b.clone_in_scatterplot('26').click
$b.span(:id => 'toIgBlast').click
assert ( $b.window(:title => "IgBLAST Search Results").exists? ) , ">> fail opening second igblast "
$b.window(:title => "IgBLAST Search Results").use do
assert ($b.text.include? "Length=318"), ">> igblast: was not launched on the correct sequence"
assert ($b.text.include? "IGHV3-9*01"), ">> igblast: expected V not found"
assert ($b.text.include? "IGHJ6*02"), ">> igblast: expected Js not found"
end
$b.window(:title => "").use
end
end
# Not really a test
def test_zz_close
close_everything
end
end
......@@ -182,97 +182,6 @@ class TestMultilocus < BrowserTest
assert ($b.preset_selector.selected? "[2] V/N length"), ">> preset selector not properly changed"
end
def test_10_imgt
begin
$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 TRBV28*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap TRBJ2-5*01"), ">> IMGT expected J not found"
end
$b.window(:title => "analysis-example").use
$b.window(:title => "IMGT/V-QUEST").close
$b.clone_in_scatterplot('26').click
$b.span(:id => "toIMGT" ).click
assert ( $b.window(:title => "IMGT/V-QUEST").exists? ) , ">> fail opening second 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 IGHV3-9*01"), ">> IMGT expected V not found"
assert ($b.text.include? "Homsap IGHJ6*02"), ">> IMGT expected J not found"
end
$b.window(:title => "analysis-example").use
end
end
def test_10bis_imgt_post
begin
$b.clone_in_scatterplot('25').click
$b.span(:id => "toIMGTSeg" ).click
$b.segmenter_checkbox_imgt_vdj.wait_until_present
clone_info = $b.clone_info_segmenter('25')
productive_title = clone_info[:axis].element(:class => 'productivity-IMGT').title
assert (productive_title.include? 'productivity'), "IMGT should tell us the productivity of the sequence"
clone_segmenter = $b.clone_in_segmenter('25')
$b.segmenter_checkbox_imgt_vdj.click
highlights = clone_segmenter.spans(:class => 'highlight_border')
assert (highlights.size >= 2 && highlights.size <= 3), "We should have the V(D)J genes highlighted, we had %d highlights" % highlights.size
for h in highlights
assert (h.style('width').to_i >= 100), "Highlights should have a reasonable width, found to be %s" % h.style('width')
end
Watir::Wait.until(timeout=10) { clone_info[:identity].span.exists? }
clone_info[:identity].element(:text => "NaN%").wait_while_present
assert ((clone_info[:identity].text =~ /^[0-9\.]+%$/) == 0 ), "We should have identity rate (found: %s)" % clone_info[:identity].text
$b.unselect
end
end
def test_11_igBlast
begin
$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=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 => "IgBLAST Search Results").close
$b.window(:title => "analysis-example").use
$b.clone_in_scatterplot('26').click
$b.span(:id => 'toIgBlast').click
assert ( $b.window(:title => "IgBLAST Search Results").exists? ) , ">> fail opening second igblast "
$b.window(:title => "IgBLAST Search Results").use do
assert ($b.text.include? "Length=318"), ">> igblast: was not launched on the correct sequence"
assert ($b.text.include? "IGHV3-9*01"), ">> igblast: expected V not found"
assert ($b.text.include? "IGHJ6*02"), ">> igblast: expected Js not found"
end
$b.window(:title => "analysis-example").use
end
end
def test_12_tag
begin
$b.clone_info('25')[:star].click
......
# sh launch_functional_tests "functional/test_*rb"
FUNCTIONAL_TESTS=$1
rename_reports_in() {
dir="$1"
......@@ -19,7 +22,7 @@ if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi
for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do
for file in functional/test_*rb; do
for file in $FUNCTIONAL_TESTS; do
if [ ${#browser} -gt 1 ]; then
export WATIR_BROWSER_PATH="$browser"
fi
......
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