Commit de2427a3 authored by Ryan Herbert's avatar Ryan Herbert

more pre-process tests

Add some pre_process dummy data and add edit and delete test
parent 89d01751
Pipeline #35810 failed with stages
in 3 minutes and 56 seconds
......@@ -68,6 +68,8 @@ class DBInitialiser(object):
public_group = db(db.auth_group.role == "public").select().first()
pid = db.pre_process.insert(name="public pre-process", command="cat &file1& &file2& > &result&", info="concatenate two files")
auth.add_permission(public_group.id, PermissionEnum.access.value, db.pre_process, pid)
for i in range(3):
db.pre_process.insert(name="test pre-process %d" % i, command="dummy &file1& &file2& > &result&", info="test %d" % i)
@_needs_sets
def _init_sequence_files(self):
......
......@@ -40,9 +40,9 @@ class TestPreProcess < BrowserTest
form = $b.form(:id => "data_form")
form.wait_until_present
form.text_field(:id => "pre_process_name").set('cat')
form.textarea(:id => "pre_process_command").set('cat &file1& &file2& > &result&')
form.textarea(:id => "pre_process_name").set('concatenate two files using cat')
form.text_field(:id => "pre_process_name").set('dummy')
form.textarea(:id => "pre_process_command").set('dummy &file1& &file2& > &result&')
form.textarea(:id => "pre_process_name").set('dummy pre-process for testing purposes')
form.input(:type => "submit").click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
......@@ -51,4 +51,43 @@ class TestPreProcess < BrowserTest
lines = table.tbody.rows
assert(lines.count == count+1)
end
def test_pre_process_edit
table = go_to_list
line = table.td(:text => "test pre-process 0").parent
uid = line.td(:index => 0).text
line.i(:class => "icon-pencil-2").click
form = $b.form(:id => "data_form")
form.wait_until_present
info = form.textarea(:id => "pre_process_info")
assert(form.text_field(:id => "pre_process_name").value == "test pre-process 0")
assert(form.textarea(:id => "pre_process_command").value == "dummy &file1& &file2& > &result&")
assert(info.value == "test 0")
info.set("edited")
form.input(:type => "submit").click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
table = $b.table(:id => 'table')
table.wait_until_present
line = table.td(:index => 0, :text => uid).parent
assert(line.td(:text => "edited").present?)
end
def test_pre_process_delete
table = go_to_list
count = table.tbody.rows.count
line = table.td(:text => "test pre-process 2").parent
line.i(:class => "icon-erase").click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
$b.button(:text => "continue").click
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
table.wait_until_present
lines = table.tbody.rows
assert(lines.count == count-1)
end
end
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