Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
bcc76655
Commit
bcc76655
authored
Oct 11, 2018
by
Ryan Herbert
Browse files
test_sample.rb implement missing association test
parent
dddf9a3c
Pipeline
#43812
passed with stages
in 6 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/tests/functional/test_sample.rb
View file @
bcc76655
...
...
@@ -146,7 +146,65 @@ class TestSample < ServerTest
end
def
test_set_association_create
assert
false
$b
.
a
(
:class
=>
"button button_token patient_token"
,
:text
=>
"patients"
).
click
Watir
::
Wait
.
until
(
30
)
{
$b
.
execute_script
(
"return jQuery.active"
)
==
0
}
table
=
$b
.
table
(
:id
=>
"table"
)
table
.
wait_until_present
patient_id
=
table
.
a
(
:text
=>
"#set_assoc_0"
).
parent
.
parent
.
cells
[
0
].
text
$b
.
a
(
:class
=>
"button button_token run_token"
,
:text
=>
"runs"
).
click
Watir
::
Wait
.
until
(
30
)
{
$b
.
execute_script
(
"return jQuery.active"
)
==
0
}
table
=
$b
.
table
(
:id
=>
"table"
)
table
.
wait_until_present
run_id
=
table
.
a
(
:text
=>
"#set_assoc_0"
).
parent
.
parent
.
cells
[
0
].
text
$b
.
a
(
:class
=>
"button button_token generic_token"
,
:text
=>
"sets"
).
click
Watir
::
Wait
.
until
(
30
)
{
$b
.
execute_script
(
"return jQuery.active"
)
==
0
}
table
=
$b
.
table
(
:id
=>
"table"
)
table
.
wait_until_present
set_id
=
table
.
a
(
:text
=>
"#set_assoc_0"
).
parent
.
parent
.
cells
[
0
].
text
samples_table
=
go_to_set_by_tag
"#set_assoc_0"
$b
.
span
(
:class
=>
"button2"
,
:text
=>
"+ add samples"
).
click
Watir
::
Wait
.
until
(
30
)
{
$b
.
execute_script
(
"return jQuery.active"
)
==
0
}
form
=
$b
.
form
(
:id
=>
"upload_form"
)
form
.
wait_until_present
$b
.
input
(
:id
=>
"source_nfs"
).
click
jstree
=
$b
.
div
(
:id
=>
"jstree"
)
$b
.
div
(
:id
=>
"jstree_field_0"
).
span
(
:text
=>
"browse"
).
click
assert
(
jstree
.
visible?
)
jstree_file
=
jstree
.
a
(
:id
=>
"//Demo-X5.fa_anchor"
)
unless
jstree_file
.
present?
and
jstree_file
.
present?
jstree
.
a
(
:id
=>
"/_anchor"
).
double_click
end
jstree_file
.
wait_until_present
jstree_file
.
click
$b
.
span
(
:id
=>
"jstree_button"
).
click
assert
(
!
jstree
.
visible?
)
form
.
text_field
(
:id
=>
"file_sampling_date_0"
).
set
(
"2010-10-10"
)
form
.
text_field
(
:id
=>
"file_info_0"
).
set
(
"#my_file_add"
)
val
=
":p 0 (2010-10-10) (
#{
patient_id
}
)|:r run 0 (
#{
run_id
}
)|:s generic 0 (
#{
set_id
}
)"
$b
.
execute_script
(
"return $('#file_set_list').val('
#{
val
}
');"
)
form
.
input
(
:type
=>
"submit"
).
click
samples_table
=
$b
.
table
(
:id
=>
"table"
)
samples_table
.
wait_until_present
samples_table
.
a
(
:text
=>
"#set_assoc_0"
).
parent
.
parent
.
i
(
:class
=>
"icon-pencil-2"
).
click
form
=
$b
.
form
(
:id
=>
"upload_form"
)
form
.
wait_until_present
set_div
=
form
.
div
(
:id
=>
'set_div'
)
assert
(
set_div
.
spans
.
length
==
3
)
end
def
test_set_association_update
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment