Commit bcc76655 authored by Ryan Herbert's avatar Ryan Herbert

test_sample.rb implement missing association test

parent dddf9a3c
Pipeline #43812 passed with stages
in 6 minutes and 30 seconds
......@@ -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
......
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