Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,712
Issues
1,712
List
Boards
Labels
Service Desk
Milestones
Merge Requests
87
Merge Requests
87
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
5b0ba979
Commit
5b0ba979
authored
Feb 04, 2019
by
Mathieu Giraud
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-cs/update-watir' into 'dev'
Update watir See merge request
!398
parents
c22ac23f
b849c26b
Pipeline
#61752
failed with stages
in 2 minutes and 18 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
245 additions
and
249 deletions
+245
-249
.gitlab-ci.yml
.gitlab-ci.yml
+3
-3
browser/index.html
browser/index.html
+0
-2
browser/test/functional/browser_test.rb
browser/test/functional/browser_test.rb
+4
-4
browser/test/functional/external_test_imgt-igblast.rb
browser/test/functional/external_test_imgt-igblast.rb
+5
-5
browser/test/functional/external_test_segmenter.rb
browser/test/functional/external_test_segmenter.rb
+6
-6
browser/test/functional/test_analysis-example1.rb
browser/test/functional/test_analysis-example1.rb
+8
-6
browser/test/functional/test_loading_analysis.rb
browser/test/functional/test_loading_analysis.rb
+26
-23
browser/test/functional/test_multilocus.rb
browser/test/functional/test_multilocus.rb
+23
-21
browser/test/functional/test_normalization.rb
browser/test/functional/test_normalization.rb
+23
-23
browser/test/functional/test_segmenter-page.rb
browser/test/functional/test_segmenter-page.rb
+11
-10
browser/test/functional/test_segmenter_page_errors.rb
browser/test/functional/test_segmenter_page_errors.rb
+3
-3
browser/test/functional/vidjil_browser.rb
browser/test/functional/vidjil_browser.rb
+7
-6
doc/dev.org
doc/dev.org
+8
-21
server/web2py/applications/vidjil/tests/functional/browser_test.rb
...b2py/applications/vidjil/tests/functional/browser_test.rb
+2
-2
server/web2py/applications/vidjil/tests/functional/test_login.rb
...web2py/applications/vidjil/tests/functional/test_login.rb
+5
-5
server/web2py/applications/vidjil/tests/functional/test_pre_process.rb
.../applications/vidjil/tests/functional/test_pre_process.rb
+20
-19
server/web2py/applications/vidjil/tests/functional/test_sample.rb
...eb2py/applications/vidjil/tests/functional/test_sample.rb
+63
-62
server/web2py/applications/vidjil/tests/functional/test_sample_set.rb
...y/applications/vidjil/tests/functional/test_sample_set.rb
+17
-16
server/web2py/applications/vidjil/tests/functional/test_tag.rb
...r/web2py/applications/vidjil/tests/functional/test_tag.rb
+11
-12
No files found.
.gitlab-ci.yml
View file @
5b0ba979
...
...
@@ -222,7 +222,7 @@ test_browser-functional:
script
:
-
make -C browser
-
source /etc/profile.d/rvm.sh
-
rvm use 2.
1
.1
-
rvm use 2.
6
.1
-
HEADLESS=1 make -C browser/test functional
artifacts
:
paths
:
...
...
@@ -241,7 +241,7 @@ test_browser-functional-external:
script
:
-
make -C browser
-
source /etc/profile.d/rvm.sh
-
rvm use 2.
1
.1
-
rvm use 2.
6
.1
-
HEADLESS=1 make -C browser/test external
artifacts
:
paths
:
...
...
@@ -306,7 +306,7 @@ test_server_functional:
-
docker exec docker_uwsgi_1 sed -i "s/^\(FILE_SOURCE .*\)/FILE_SOURCE = '\/usr\/share\/vidjil\/demo'/" /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py
-
docker exec docker_nginx_1 make -C /usr/share/vidjil browser
-
source /etc/profile.d/rvm.sh
-
rvm use 2.
1
.1
-
rvm use 2.
6
.1
-
HEADLESS=1 make functional_server || (cd docker && docker-compose stop; docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker rmi "vidjil/server:test" "vidjil/client:test";
false
)
-
cd docker && docker-compose stop
-
docker stop $(docker ps -aq)
...
...
browser/index.html
View file @
5b0ba979
...
...
@@ -198,8 +198,6 @@
normalization
<form
name=
"normalize_list"
id=
"normalize_list"
>
</form>
<form
name=
"normalize_list"
id=
"normalize_list"
>
<!-- class="devel-mode"> -->
</form>
</div>
<div
class=
"menu_box"
>
size display
</br>
...
...
browser/test/functional/browser_test.rb
View file @
5b0ba979
require
'rubygems'
gem
"minitest"
require
'watir
-webdriver
'
require
'watir'
require
'test/unit'
require
"minitest/autorun"
require
'minitest/ci'
...
...
@@ -65,7 +65,7 @@ class BrowserTest < MiniTest::Test
print
"Welcome popup.
\n
"
# wait for the welcoming popup
$b
.
div
(
:class
=>
'popup_msg'
).
wait_until
_present
(
2
)
$b
.
div
(
:class
=>
'popup_msg'
).
wait_until
(
timeout:
2
){
|
el
|
el
.
present?
}
# close the welcoming popup
$b
.
div
(
:class
=>
'popup_msg'
).
button
(
:text
=>
'ok'
).
click
...
...
@@ -83,12 +83,12 @@ class BrowserTest < MiniTest::Test
# select data file
print
" data: "
+
data_path
+
"
\n
"
$b
.
div
(
:id
=>
'file_menu'
).
file_field
(
:name
,
"json"
).
set
(
data_path
)
$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
)
$b
.
div
(
:id
=>
'file_menu'
).
file_field
(
name:
"pref"
).
set
(
analysis_path
)
end
$b
.
div
(
:id
=>
'file_menu'
).
button
(
:text
=>
'start'
).
click
...
...
browser/test/functional/external_test_imgt-igblast.rb
View file @
5b0ba979
...
...
@@ -19,7 +19,7 @@ class ExternalTest < BrowserTest
def
test_10_imgt
begin
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_scatterplot
(
'25'
).
click
$b
.
span
(
:id
=>
"toIMGT"
).
click
...
...
@@ -53,7 +53,7 @@ class ExternalTest < BrowserTest
begin
$b
.
clone_in_scatterplot
(
'25'
).
click
$b
.
span
(
:id
=>
"toIMGTSeg"
).
click
$b
.
segmenter_checkbox_imgt_vdj
.
wait_until
_present
$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
...
...
@@ -67,8 +67,8 @@ class ExternalTest < BrowserTest
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
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
...
...
@@ -78,7 +78,7 @@ class ExternalTest < BrowserTest
def
test_11_igBlast
begin
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_scatterplot
(
'25'
).
click
$b
.
span
(
:id
=>
"toIgBlast"
).
click
...
...
browser/test/functional/external_test_segmenter.rb
View file @
5b0ba979
...
...
@@ -17,8 +17,8 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
$b
.
button
(
:id
=>
'form_submit'
).
click
$b
.
element
(
:class
=>
'imgAjaxLoading'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'0'
).
wait_until
_present
$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"
...
...
@@ -27,15 +27,15 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
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?
}
$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'
)
clone_info
[
:identity
].
element
(
:text
=>
"NaN%"
).
wait_while
_present
clone_info
[
:identity
].
element
(
:text
=>
"NaN%"
).
wait_while
(
&
:present?
)
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'
)
Watir
::
Wait
.
until
(
timeout
=
10
)
{
$b
.
execute_script
(
"return typeof model.clone(0).seg.imgt['N-REGION end']"
)
!=
"undefined"
}
Watir
::
Wait
.
until
(
timeout
:
10
)
{
$b
.
execute_script
(
"return typeof model.clone(0).seg.imgt['N-REGION end']"
)
!=
"undefined"
}
$b
.
segmenter_checkbox_imgt_vdj
.
click
highlights
=
clone_segmenter
.
spans
(
:class
=>
'highlight_border'
)
...
...
browser/test/functional/test_analysis-example1.rb
View file @
5b0ba979
...
...
@@ -7,19 +7,21 @@ class TestSimple < BrowserTest
super
if
not
defined?
$b
set_browser
(
"/doc/analysis-example1.vidjil"
)
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
if
$b
.
div
(
id:
'tip-container'
).
present?
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
end
end
end
def
test_00_graph_hidden
# assert (not $b.clone_in_graph('0').
visible
?), "Graph lines should not be visible"
# assert (not $b.clone_in_graph('0').
present
?), "Graph lines should not be visible"
assert
(
not
$b
.
graph
.
exists?
),
"Graph should not exist"
end
def
test_00_double_scatterplot
# analysis-example has only one sample, second scatterplot expected
assert
(
$b
.
scatterplot
.
visible
?
),
"First scatterplot should be found"
assert
(
$b
.
scatterplot
(
2
).
visible
?
),
"Second scatterplot should be found"
assert
(
$b
.
scatterplot
.
present
?
),
"First scatterplot should be found"
assert
(
$b
.
scatterplot
(
2
).
present
?
),
"Second scatterplot should be found"
end
def
test_01_legend_scatterplot
...
...
@@ -35,12 +37,12 @@ class TestSimple < BrowserTest
def
test_02_deactivate_locus
initial_read_nb
=
$b
.
info_selected_locus
.
text
$b
.
locus_topleft
(
'TRG'
).
click
$b
.
clone_in_scatterplot
(
'0'
).
wait_while
_present
$b
.
clone_in_scatterplot
(
'0'
).
wait_while
(
&
:present?
)
assert
(
$b
.
info_selected_locus
.
text
==
"no read"
),
"When unselected we have no reads"
# Reactivate
$b
.
locus_topleft
(
'TRG'
).
click
$b
.
clone_in_scatterplot
(
'0'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'0'
).
wait_until
(
&
:present?
)
assert
(
$b
.
info_selected_locus
.
text
==
initial_read_nb
),
"Read number should be identical to what we had at first"
end
...
...
browser/test/functional/test_loading_analysis.rb
View file @
5b0ba979
...
...
@@ -7,8 +7,10 @@ class TestLoadingAnalysis < BrowserTest
super
if
not
defined?
$b
set_browser
(
"/doc/analysis-example2.vidjil"
,
"/doc/analysis-example2.analysis"
)
$b
.
clone_in_scatterplot
(
'0'
).
wait_until_present
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
$b
.
clone_in_scatterplot
(
'0'
).
wait_until
(
&
:present?
)
if
$b
.
div
(
id:
'tip-container'
).
present?
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
end
end
end
...
...
@@ -30,9 +32,9 @@ class TestLoadingAnalysis < BrowserTest
$b
.
select_tag
(
'0'
).
click
assert
(
not
$b
.
clone_in_list
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_graph
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_list
(
'0'
).
present
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'0'
).
present
?
)
assert
(
not
$b
.
clone_in_graph
(
'0'
).
present
?
)
$b
.
select_tag
(
'0'
).
click
end
...
...
@@ -61,36 +63,36 @@ class TestLoadingAnalysis < BrowserTest
end
def
test_04_hide_clone
assert
(
$b
.
clone_in_list
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_graph
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_list
(
'0'
).
present
?
)
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
present
?
)
assert
(
$b
.
clone_in_graph
(
'0'
).
present
?
)
# Hide the clone by affecting it to a hidden tag
$b
.
clone_info
(
'0'
)[
:star
].
click
$b
.
tag_item
(
'4'
)[
:name
].
click
assert
(
not
$b
.
clone_in_list
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_graph
(
'0'
).
visible
?
)
assert
(
not
$b
.
clone_in_list
(
'0'
).
present
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'0'
).
present
?
)
assert
(
not
$b
.
clone_in_graph
(
'0'
).
present
?
)
# Unhide clone
$b
.
element
(
:id
=>
'fastTag4'
,
:class
=>
'inactiveTag'
).
click
assert
(
not
$b
.
element
(
:id
=>
'fastTag4'
,
:class
=>
'inactiveTag'
).
exists?
)
assert
(
$b
.
clone_in_list
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_graph
(
'0'
).
visible
?
)
assert
(
$b
.
clone_in_list
(
'0'
).
present
?
)
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
present
?
)
assert
(
$b
.
clone_in_graph
(
'0'
).
present
?
)
end
def
test_05_check_cluster
clustered
=
$b
.
clone_info
(
'1'
)
assert
(
clustered
[
:name
].
text
==
'clone2'
),
"First clone of cluster should be clone2"
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
visible
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
present
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
present
?
)
clustered
[
:cluster
].
click
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
visible?
)
assert
(
$b
.
clone_in_scatterplot
(
'2'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
present?
),
"First clone should still be present"
$b
.
clone_in_scatterplot
(
'2'
).
wait_until
(
&
:present
?
)
first_in_cluster
=
$b
.
clone_in_cluster
(
'1'
,
'1'
)
second_in_cluster
=
$b
.
clone_in_cluster
(
'1'
,
'2'
)
...
...
@@ -105,12 +107,13 @@ 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
.
clone_in_cluster
(
'1'
,
'2'
)[
:delete
].
click
assert
(
not
$b
.
clone_cluster
(
'1'
).
visible
?
)
assert
(
not
$b
.
clone_cluster
(
'1'
).
present
?
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'2'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
present
?
)
assert
(
$b
.
clone_in_scatterplot
(
'2'
).
present
?
)
clone3
=
$b
.
clone_info
(
'2'
)
assert
(
clone3
[
:name
].
text
==
"clone3"
)
...
...
@@ -125,8 +128,8 @@ end
clustered
=
$b
.
clone_info
(
'1'
)
assert
(
clustered
[
:name
].
text
==
'clone2'
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
visible
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
visible
?
)
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
present
?
)
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
present
?
)
end
def
test_08_select_cluster
...
...
browser/test/functional/test_multilocus.rb
View file @
5b0ba979
...
...
@@ -9,7 +9,9 @@ class TestMultilocus < BrowserTest
super
if
not
defined?
$b
set_browser
(
"/doc/analysis-example.vidjil"
)
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
if
$b
.
div
(
id:
'tip-container'
).
present?
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
end
end
end
...
...
@@ -44,7 +46,7 @@ class TestMultilocus < BrowserTest
def
test_00_info_point
assert
(
not
$b
.
div
(
:id
=>
'info_timepoint'
).
present?
),
"Info timepoint should not be present"
$b
.
info_point
.
i
.
click
assert
(
$b
.
div
(
:id
=>
'info_timepoint'
).
visible
?
),
"After clicking info timepoint should be visible"
assert
(
$b
.
div
(
:id
=>
'info_timepoint'
).
present
?
),
"After clicking info timepoint should be visible"
table
=
$b
.
div
(
:id
=>
'info_timepoint'
).
table
assert
(
table
[
1
][
1
].
text
==
'786861'
),
"Incorrect number of reads in infopoint"
...
...
@@ -107,7 +109,7 @@ class TestMultilocus < BrowserTest
begin
$b
.
unselect
#test hover a clone in the list
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_list
(
'25'
).
hover
check_when_list_or_scatterplot_focused
...
...
@@ -117,7 +119,7 @@ class TestMultilocus < BrowserTest
def
test_05_focus_in_scatterplot
begin
$b
.
unselect
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_scatterplot
(
'25'
).
hover
check_when_list_or_scatterplot_focused
...
...
@@ -140,7 +142,7 @@ class TestMultilocus < BrowserTest
def
test_08_click_in_list
#test select a clone in the list
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_info
(
'25'
)[
:name
].
click
()
check_when_list_or_scatterplot_clicked
...
...
@@ -150,7 +152,7 @@ class TestMultilocus < BrowserTest
end
def
test_08_click_in_scatterplot
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_scatterplot
(
'25'
).
click
check_when_list_or_scatterplot_clicked
...
...
@@ -159,9 +161,9 @@ class TestMultilocus < BrowserTest
assert
(
not
$b
.
clone_in_list
(
'25'
).
class_name
.
include?
"list_select"
),
">> Incorrect class name, clone is not unselected'"
end
def
TODO_
test_09_normalize
def
test_09_normalize
$b
.
clone_info
(
'25'
)[
:star
].
click
$b
.
tag_selector_edit_normalisation
.
wait_until
_present
$b
.
tag_selector_edit_normalisation
.
wait_until
(
&
:present?
)
$b
.
tag_selector_edit_normalisation
.
set
(
'0.01'
)
$b
.
tag_selector_normalisation_validator
.
click
...
...
@@ -175,7 +177,7 @@ class TestMultilocus < BrowserTest
end
def
test_0a_shortcuts_numpad
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'25'
).
wait_until
(
&
:present?
)
$b
.
clone_in_scatterplot
(
'25'
).
click
assert
(
$b
.
preset_selector
.
selected?
"[0] V/J (genes)"
),
">> preset selector badly set"
...
...
@@ -187,9 +189,9 @@ class TestMultilocus < BrowserTest
begin
$b
.
clone_info
(
'25'
)[
:star
].
click
name
=
$b
.
tag_item
(
'0'
)[
:name
]
name
.
wait_until
_present
name
.
wait_until
(
&
:present?
)
name
.
click
name
.
wait_while
_present
name
.
wait_while
(
&
:present?
)
assert
(
$b
.
clone_info
(
'25'
)[
:name
].
style
(
'color'
)
==
'rgba(220, 50, 47, 1)'
)
,
">> fail tag : clone color hasn't changed"
end
...
...
@@ -202,9 +204,9 @@ class TestMultilocus < BrowserTest
$b
.
clone_in_scatterplot
(
'90'
).
click
(
:control
)
$b
.
menu_item_export_fasta
.
click
assert
(
$b
.
window
(
:
title
=>
""
).
exists?
)
,
">> fail opening fasta export "
$b
.
window
(
:
title
=>
""
).
use
do
assert
(
$b
.
text
.
include?
">TRBV29*01 -1/0/-0 TRBD1*01 -2/0/-5 TRBJ2-5*01"
),
"header name
"
assert
(
$b
.
window
(
:
url
=>
/about:blank/
)
)
,
">> fail opening fasta export "
$b
.
window
(
:
url
=>
/about:blank/
).
use
do
assert
(
$b
.
text
.
include?
">TRBV29*01 -1/0/-0 TRBD1*01 -2/0/-5 TRBJ2-5*01"
),
"header name
: "
+
$b
.
text
assert
(
$b
.
text
.
include?
"YYGGGYYACGYAYAGCGGYGYTTYYCCTYTYTGYTYTGCYAAAYAACYYYYTGTGYCTYTGTGCYGYGTTYCCCGGYYYAAACYCYCYYCCTYGG
\n
CYAGGYCYGG"
),
"sequence"
assert
(
$b
.
text
.
include?
">ERG-4F 0/TCT/0 ERG-Seq-R"
),
"header name locus ERG"
assert
(
not
$b
.
text
.
include?
">ERG-4F
\n
"
),
"header name of segment should not exist (segment is not present in germline)"
...
...
@@ -258,11 +260,11 @@ class TestMultilocus < BrowserTest
assert
(
smaller
.
text
.
include?
(
"smaller clones"
)),
"We should have smaller clones at index %d of the list, instead we have %s "
%
[
i
,
smaller
.
text
]
assert
(
smaller
.
visible
?
),
"Smaller clones #%d should be visible, it is not"
%
[
i
]
assert
(
smaller
.
present
?
),
"Smaller clones #%d should be visible, it is not"
%
[
i
]
smaller
.
hover
assert
(
smaller
.
visible
?
),
"Smaller clones #%d should still be visible after hovering it"
%
[
i
]
assert
(
smaller
.
present
?
),
"Smaller clones #%d should still be visible after hovering it"
%
[
i
]
assert
(
not
$b
.
clone_in_scatterplot
(
smaller
.
id
).
visible
?
),
"Smaller clone %d should not be visible in scatterplot"
%
[
i
]
assert
(
not
$b
.
clone_in_scatterplot
(
smaller
.
id
).
present
?
),
"Smaller clone %d should not be visible in scatterplot"
%
[
i
]
end
end
...
...
@@ -308,7 +310,7 @@ class TestMultilocus < BrowserTest
def
test_18_empty_clone_invisible
assert
(
$b
.
execute_script
(
"return m.clones[66].reads[0]"
)
==
0
),
"Clone should have no read"
assert
(
not
$b
.
clone_in_scatterplot
(
'66'
).
visible
?
),
"Clone should not be visible"
assert
(
not
$b
.
clone_in_scatterplot
(
'66'
).
present
?
),
"Clone should not be visible"
end
def
TODO_test_14_edit_tag
...
...
@@ -317,7 +319,7 @@ class TestMultilocus < BrowserTest
$b
.
clone_info
(
'25'
)[
:star
].
click
edit
=
$b
.
tag_item
(
'0'
)[
:edit
]
edit
.
wait_until
_present
edit
.
wait_until
(
&
:present?
)
edit
.
click
$b
.
tag_selector_edit_name
.
set
'renamed_click'
$b
.
tag_selector_name_validator
.
click
...
...
@@ -329,7 +331,7 @@ class TestMultilocus < BrowserTest
$b
.
clone_info
(
'24'
)[
:star
].
click
edit
=
$b
.
tag_item
(
'1'
)[
:edit
]
edit
.
wait_until
_present
edit
.
wait_until
(
&
:present?
)
edit
.
click
$b
.
tag_selector_edit_name
.
set
'renamed_return'
$b
.
send_keys
:return
...
...
@@ -340,7 +342,7 @@ class TestMultilocus < BrowserTest
## check renames (on again another clone)
$b
.
clone_info
(
'23'
)[
:star
].
click
edit
=
$b
.
tag_item
(
'1'
)[
:edit
]
edit
.
wait_until
_present
edit
.
wait_until
(
&
:present?
)
assert
(
$b
.
tag_selector
.
text
.
include?
'renamed_click'
),
"fail edit tag with mouse : tag name in tag selector hasn't changed"
assert
(
$b
.
tag_selector
.
text
.
include?
'renamed_return'
),
"fail edit tag with keyboard : tag name in tag selector hasn't changed"
...
...
browser/test/functional/test_normalization.rb
View file @
5b0ba979
...
...
@@ -8,8 +8,10 @@ class TestNormalization < BrowserTest
def
setup
super
if
not
defined?
$b
set_browser
(
"/doc/analysis-example.vidjil"
)
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
set_browser
(
"/doc/analysis-example.vidjil"
)
if
$b
.
div
(
id:
'tip-container'
).
present?
$b
.
div
(
:id
=>
'tip-container'
).
div
(
:class
=>
'tip_1'
).
element
(
:class
=>
'icon-cancel'
).
click
end
end
end
...
...
@@ -20,45 +22,43 @@ class TestNormalization < BrowserTest
def
test_00_normalization_none
$b
.
element
(
:id
=>
'settings_menu'
).
click
assert
(
$b
.
div
(
:id
=>
'normalize_list'
).
visible?
),
"After clicking normalize_list form should be visible"
assert
(
$b
.
div
(
:id
=>
'reset_norm'
).
present?
),
"Form have the input for reset normalization"
$b
.
execute_script
(
' showSelector("settingsSelector"); console.log( "hide settings")'
)
$b
.
send_keys
:escape
end
assert
(
$b
.
form
(
:id
=>
'normalize_list'
).
present?
),
"After clicking normalize_list form should be visible"
assert
(
$b
.
input
(
:id
=>
'reset_norm'
).
present?
),
"Form have the input for reset normalization"
$b
.
clone_in_list
(
'25'
).
hover
# Just put the mouse somewhere else to close the menu
end
def
test_01_normalization_expected
set_browser
(
"/doc/analysis-example.vidjil"
)
$b
.
div
(
:id
=>
'color25'
)
.
click
$b
.
t
ext_field
(
:id
=>
'norm_button'
)
.
set
'0.1'
assert
(
$b
.
clone_info
(
'25'
)[
:size
].
text
==
'0.129%'
),
"Span show correct size before normalization"
$b
.
clone_info
(
'25'
)[
:star
]
.
click
$b
.
t
ag_selector_edit_normalisation
.
set
'0.1'
$b
.
send_keys
:enter
assert
(
$b
.
span
(
:text
=>
'10.00%'
).
present?
),
"Span show correct normalized size"
assert
(
$b
.
clone_info
(
'25'
)[
:size
].
text
==
'10.00%'
),
"Span show correct normalized size"
$b
.
element
(
:id
=>
'settings_menu'
)
.
click
assert
(
$b
.
div
(
:id
=>
'normalize_list'
).
visible
?
),
"After clicking normalize_list form should be visible"
$b
.
menu_settings
.
click
assert
(
$b
.
form
(
:id
=>
'normalize_list'
).
present
?
),
"After clicking normalize_list form should be visible"
assert
(
$b
.
div
(
:id
=>
'normalizetest25'
).
present?
),
"Form have the input for expected normalization"
$b
.
div
(
:id
=>
'reset_norm'
).
click
$b
.
input
(
:id
=>
'reset_norm'
).
click
$b
.
send_keys
:escape
assert
(
$b
.
span
(
:text
=>
'0.129%'
).
present?
),
"Span show correct size after reset normalization"
assert
(
$b
.
clone_info
(
'25'
)[
:size
].
text
==
'0.129%'
),
"Span show correct size after reset normalization"
end
def
test_02_normalization_external
set_browser
(
"/doc/analysis-example.vidjil"
)
assert
(
$b
.
span
(
:text
=>
'0.122%'
).
present?
),
"Span show correct normalized size (external) by default"
assert
(
$b
.
clone_info
(
'1'
)[
:size
].
text
==
'0.081%'
),
"Span show correct size after reset normalization"
$b
.
element
(
:id
=>
'settings_menu'
)
.
click
assert
(
$b
.
div
(
:id
=>
'normalize_list'
).
visible
?
),
"After clicking normalize_list form should be visible"
$b
.
menu_settings
.
click
assert
(
$b
.
form
(
:id
=>
'normalize_list'
).
present
?
),
"After clicking normalize_list form should be visible"
assert
(
$b
.
div
(
:id
=>
'normalize_external'
).
present?
),
"Form have the input for external normalization"
assert
(
not
$b
.
div
(
:id
=>
'normalizetest25'
).
present?
),
"Form have not
the input for expected normalization"
assert
(
$b
.
div
(
:id
=>
'normalizetest25'
).
present?
),
"Form still have
the input for expected normalization"
$b
.
div
(
:id
=>
'
reset_norm
'
).
click
$b
.
div
(
:id
=>
'
normalize_external
'
).
click
assert
(
$b
.
span
(
:text
=>
'0.081%'
).
present?
),
"Span show correct size after reset normalization
"
assert
(
$b
.
clone_info
(
'1'
)[
:size
].
text
==
'0.122%'
),
"Span should show correct normalized size (external) ("
+
$b
.
clone_info
(
'1'
)[
:size
].
text
+
")
"
end
...
...
browser/test/functional/test_segmenter-page.rb
View file @
5b0ba979
...
...
@@ -17,23 +17,23 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
$b
.
button
(
:id
=>
'form_submit'
).
click
$b
.
element
(
:class
=>
'imgAjaxLoading'
).
wait_until
_present
$b
.
clone_in_scatterplot
(
'0'
).
wait_until
_present
$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_01_segmenter
assert
(
$b
.
clone_in_segmenter
(
'0'
).
visible
?
),
"Clone 0 should be in segmenter"
assert
(
$b
.
clone_in_segmenter
(
'1'
).
visible
?
),
"Clone 1 should be in segmenter"
assert
(
$b
.
clone_in_segmenter
(
'0'
).
present
?
),
"Clone 0 should be in segmenter"
assert
(
$b
.
clone_in_segmenter
(
'1'
).
present
?
),
"Clone 1 should be in segmenter"
assert
(
not
$b
.
clone_in_segmenter
(
'2'
).
exists?
),
"Clone 2 should not exist"
end
def
test_02_scatterplot
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
visible
?
),
"Clone 0 should be in scatterplot"
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
visible
?
),
"Clone 1 should be in scatterplot"
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
visible
?
),
"Clone 2 should not be visible"
assert
(
$b
.
clone_in_scatterplot
(
'0'
).
present
?
),
"Clone 0 should be in scatterplot"
assert
(
$b
.
clone_in_scatterplot
(
'1'
).
present
?
),
"Clone 1 should be in scatterplot"
assert
(
not
$b
.
clone_in_scatterplot
(
'2'
).
present
?
),
"Clone 2 should not be visible"
end
def
test_03_change_color
...
...
@@ -44,6 +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"
# Must remove rgb from the start of the fill style, and the closing parentheses at the end,
...
...
@@ -58,7 +59,7 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
for
i
in
[
'0'
,
'1'
]
for
gene
in
[
'V'
,
'J'
]
span
=
$b
.
clone_in_segmenter
(
i
).
span
(
:class
=>
gene
)
assert
(
span
.
visible
?
),
"
#{
gene
}
span should be visible"
assert
(
span
.
present
?
),
"
#{
gene
}
span should be visible"
end
end
end
...
...
@@ -74,8 +75,8 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
def
test_07_export_fasta
$b
.
element
(
:id
=>
'btn_exportfasta'
).
click
assert
(
$b
.
window
(
:
title
=>
""
).
exists?
)
,
">> fail opening fasta export "
$b
.
window
(
:
title
=>
""
).
use
do
assert
(
$b
.
window
(
:
url
=>
/about:blank/
).
exists?
)
,
">> fail opening fasta export "
$b
.
window
(
:
url
=>
/about:blank/
).
use
do
assert
(
$b
.
text
.
index
(
/TRGV5.*200 nt/
)
>
0
),
"header name"
assert
(
$b
.
text
.
index
(
/IGHV3-13.*374 nt/
)
>
0
),
"header name"
assert
(
$b
.
text
.
include?
"CCTGGG
\n
GGGCCAG
\n
ATT"
),
"sequence"
...
...
browser/test/functional/test_segmenter_page_errors.rb
View file @
5b0ba979
...
...
@@ -12,7 +12,7 @@ class TestSegmenterPageErrors < SegmenterTest
$b
.
button
(
:id
=>
'form_submit'
).
click
$b
.
element
(
:class
=>
'flash_2'
).
wait_until
_present
$b
.
element
(
:class
=>
'flash_2'
).
wait_until
(
&
:present?
)
assert
(
$b
.
element
(
:class
=>
'flash_2'
,
:index
=>
1
).
text
.
include?
"invalid sequences"
),
"We should have an error_message"
assert
(
not
$b
.
element
(
:class
=>
'segmenter'
).
present?
),
"Segmenter should not be present"
...
...
@@ -30,8 +30,8 @@ CGTCTT"
$b
.
button
(
:id
=>
'form_submit'
).
click