Commit f0acb3fc authored by Mathieu Giraud's avatar Mathieu Giraud

tests/functional: extract 'external_test_segmenter' from 'test_segmenter-page'

Completes #2712.
parent 4755fb1c
Pipeline #10801 passed with stages
in 19 seconds
load 'segmenter_browser.rb'
load 'segmenter_test.rb'
class TestExternalSegmenterPage < SegmenterTest
def test_00_launch_query
sequences = $b.textarea(:id => 'form_sequences')
sequences.set ">seq1
CGTCTTCTGTACTATGACGTCTCCAACTCAAAGGATGTGTTGGAATCAGGACTCAGTCCAGGAAAGTATTATACTCATACACCCAGGAGGTGGAGCTGGATATTGATACTACGAAATCTAATTGAAAATGATTCTGGGGTCTATTACTGTGCCACCTGGGGGGCCAGATTATAAGAAACTCTTTGGCAGTGGAACAACAC
>seq2
GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACATGCACTGGGTCCGCCAAGCTACAGGAAAAGGTCTGGAGTGGGTCTCAGCTATTGGTACTGCTGGTGACACATACTATCCAGGCTCCGTGAAGGGCCGATTCACCATCTCCAGAGAAAATGCCAAGAACTCCTTGTATCTTCAAATGAACAGCCTGAGAGCCGGGGACACGGCTGTGTATTACTGTGCAAGAGTGAGGCGGAGAGATCGGGGGATTGTAGTGGTGGTAGCTGCTACTCAACGGTAAGTTGGTTCGACCCCTGGGGCCAGGGAACCCTGGTCACCGTCTCCTCAGGT"
assert (not $b.element(:class => 'segmenter').present?), "Segmenter should not be present yet"
assert (not $b.element(:class => 'scatterplot').present?), "Segmenter should not be present yet"
$b.button(:id => 'form_submit').click
$b.element(:class => 'imgAjaxLoading').wait_until_present
$b.clone_in_scatterplot('0').wait_until_present
assert ($b.element(:class => 'segmenter').present?), "Segmenter should be present"
assert ($b.element(:class => 'scatterplot').present?), "Segmenter should be present"
end
def test_05_imgt_post
begin
$b.span(:id => "toIMGTSeg" ).click
$b.segmenter_checkbox_imgt_vdj.wait_until_present
Watir::Wait.until(timeout=10) { $b.span(:class => "identityBad").exists? }
clone_info = $b.clone_info_segmenter('0')
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('0')
$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
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
end
end
def test_zz_close
close_everything
end
end
......@@ -63,29 +63,6 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
end
end
def test_05_imgt_post
begin
$b.span(:id => "toIMGTSeg" ).click
$b.segmenter_checkbox_imgt_vdj.wait_until_present
Watir::Wait.until(timeout=10) { $b.span(:class => "identityBad").exists? }
clone_info = $b.clone_info_segmenter('0')
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('0')
$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
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
end
end
def test_06_scatterplot_change_preset
$b.scatterplot_select_preset(/CDR3 length/)
......
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