Commit 245db541 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

update tests to match new dataset

parent 43e1f787
......@@ -27,14 +27,14 @@ class TestSampleSet < BrowserTest
def test_patient_001_list
table = go_to_list
# should be no patients
assert(!table.tbody.present?)
assert(table.tbody.present?)
end
def test_patient_002_add
table = go_to_list
count = table.tbody.rows.count
# go to form
$b.span(:class => "button2", :text => "+ new patients").click
form = $b.form(:id => "object_form")
......@@ -61,7 +61,7 @@ class TestSampleSet < BrowserTest
# ensure patients were added
table.wait_until_present
lines = table.tbody.rows
assert(lines.count == 5)
assert(lines.count == count + 5)
lines.each do |line|
#assert(line.cell(:index => 1).text.match("first %d last %d" % [i, i]))
assert(line.cell(:index => 2).text == "2010-10-10")
......@@ -100,6 +100,7 @@ class TestSampleSet < BrowserTest
def test_patient_004_delete
table = go_to_list
count = table.tbody.rows.count
# click delete button for first line in table
table.i(:class => "icon-erase", :index => 1).click
......@@ -109,7 +110,7 @@ class TestSampleSet < BrowserTest
table.wait_until_present
lines = table.tbody.rows
assert(lines.count == 4)
assert(lines.count == count-1)
end
def test_patient_005_search
......
......@@ -28,12 +28,12 @@ class TestPreProcess < BrowserTest
def test_pre_process_001_list
table = go_to_list
# should be no pre-processes
assert(!table.tbody.present?)
assert(table.tbody.present?)
end
def test_pre_process_002_add
table = go_to_list
count = table.tbody.rows.count
# go to form
$b.span(:class => "button2", :text => "+ new pre-process").click
......@@ -49,7 +49,7 @@ class TestPreProcess < BrowserTest
table = $b.table(:id => "table")
table.wait_until_present
lines = table.tbody.rows
assert(lines.count == 1)
assert(lines.count == count+1)
end
def test_zz_close
......
......@@ -18,15 +18,19 @@ class TestSample < BrowserTest
end
def go_to_first_set
go_to_set 0
end
def go_to_set(index)
# load patient list
$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
lines = table.tbody.rows
lines[0].wait_until_present
lines[index].wait_until_present
# select first patient
lines[0].click
lines[index].click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
# check that list of samples is loaded
table = $b.table(:id => "table")
......@@ -37,6 +41,8 @@ class TestSample < BrowserTest
def test_001_add
table = go_to_first_set
count = table.tbody.rows.count
add_button = $b.span(:text => "+ add samples")
add_button.wait_until_present
add_button.click
......@@ -74,7 +80,7 @@ class TestSample < BrowserTest
table.wait_until_present
lines = table.tbody.rows
assert(lines.count == $num_additional_files + 1)
assert(lines.count == count + $num_additional_files + 1)
end
def test_002_edit
......@@ -101,7 +107,9 @@ class TestSample < BrowserTest
end
def test_003_delete
table = go_to_first_set
table = go_to_set 3
count = table.tbody.rows.count
lines = table.tbody.rows
lines[0].wait_until_present
......@@ -115,16 +123,18 @@ class TestSample < BrowserTest
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
button = $b.button(:text => "delete sequence and results")
button = $b.button(:text => "delete")
button.wait_until_present
button.click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
table.wait_until_present
assert(table.tbody.rows.count == $num_additional_files)
assert(table.tbody.rows.count == count-1)
end
def test_004_run
table = go_to_first_set
table = go_to_set 3
$b.select_list(:id => "choose_config").select_value(2)
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
......
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