test_scatterplot.rb 3.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# coding: utf-8
load 'vidjil_browser.rb'
load 'browser_test.rb'

#browser test suite
class TestScatterplot < BrowserTest

  def setup
    super
    if not defined? $b
      set_browser("/tools/tests/data/fused_multiple.vidjil")
      if $b.div(id: 'tip-container').present?
        $b.div(:id => 'tip-container').div(:class => 'tip_1').element(:class => 'icon-cancel').click
      end

      # Make upload menu appear to test the application with this menu too
      $b.execute_script("$('#upload_summary')[0].style.display='block';")
    end
  end


  def after_tests
  end

  ##############
  ### CLONES ###
  ##############
  # id     0 --> biggest clone, IGHV1, IGHJ1, _average_read_length==162
  # id 15/16 --> other clone (TRD, IGH)
  # id    18 --> lenSeqAverage/_average_read_length == 162
  # id    27 --> lenCDR3 (undefined), represent all clones
  # id    29 --> seg5; seg3 (IGHV1; IGHJ1)

  def test_01_multiple_select_barmode
marc duez's avatar
marc duez committed
35
36
    $b.menu_filter.click
    $b.update_icon.wait_while(&:present?)
37
    $b.send_keys 4
38
    $b.update_icon.wait_while(&:present?)
39
40
41
42
    # to verify correct selection, We will look in semgenter the presence if clone entrie
    # Maybe another method could be more acurate
    
    $b.clone_in_list("0").click
marc's avatar
marc committed
43
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
44
45
    assert (     $b.clone_in_segmenter('0').present? ), ">> Firste click; Correct selection of clone 0 by click in scatterplot"
    assert ( not $b.clone_in_segmenter('1').present? ), ">> Firste click; Clone 1 should not be present in segmenter"
46
47
    
    $b.clone_in_list("1").click
marc's avatar
marc committed
48
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
49
50
    assert ( not $b.clone_in_segmenter('0').present? ), ">> Another click; Clone 0 should not be present anymore in segmenter"
    assert (     $b.clone_in_segmenter('1').present? ), ">> Another click; Correct selection of clone 1 after second click in scatterplot"
51
52
53
   

    $b.clone_in_list("0").click(:control)
marc's avatar
marc committed
54
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
55
56
    assert ( $b.clone_in_segmenter('0').present? ), ">> ctrl+click; Clone 0 should be present in segmenter"
    assert ( $b.clone_in_segmenter('1').present? ), ">> ctrl+click; Clone 1 should be present in segmenter"
57
58
59
60
61


  end

  def test_02_multiple_select_bubble
marc duez's avatar
marc duez committed
62
63
    $b.menu_filter.click
    $b.update_icon.wait_while(&:present?)
64
    $b.send_keys 1
65
    $b.update_icon.wait_while(&:present?)
66
67
68
69
    # to verify correct selection, We will look in semgenter the presence if clone entrie
    # Maybe another method could be more acurate
    
    $b.clone_in_list("0").click
marc's avatar
marc committed
70
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
71
72
    assert (     $b.clone_in_segmenter('0').present? ), ">> Firste click; Correct selection of clone 0 by click in scatterplot"
    assert ( not $b.clone_in_segmenter('1').present? ), ">> Firste click; Clone 1 should not be present in segmenter"
73
74
    
    $b.clone_in_list("1").click
marc's avatar
marc committed
75
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
76
77
    assert ( not $b.clone_in_segmenter('0').present? ), ">> Another click; Clone 0 should not be present anymore in segmenter"
    assert (     $b.clone_in_segmenter('1').present? ), ">> Another click; Correct selection of clone 1 after second click in scatterplot"
78
79
80
   

    $b.clone_in_list("0").click(:control)
marc's avatar
marc committed
81
    $b.update_icon.wait_while(&:present?)
marc duez's avatar
marc duez committed
82
83
    assert ( $b.clone_in_segmenter('0').present? ), ">> ctrl+click; Clone 0 should be present in segmenter"
    assert ( $b.clone_in_segmenter('1').present? ), ">> ctrl+click; Clone 1 should be present in segmenter"
84
85
86
87
88
89
90
91
92
93


  end


  # Not really a test
  def test_zz_close
    close_everything
  end
end