Commit 43606805 authored by Mathieu Giraud's avatar Mathieu Giraud

functional/live-test_sample-sets.rb: test Demo login and patients on live server

See #3099.
parent d3f7447c
load 'vidjil_browser.rb'
load 'server_test.rb'
class LiveTestSampleSets < ServerTest
def setup
super
if not defined? $b
set_browser("http://app.vidjil.org/browser")
end
login_form = $b.form(:id => 'login_form')
if login_form.present?
login_form.text_field(:id => "auth_user_email").set('demo@vidjil.org')
login_form.text_field(:id => "auth_user_password").set('demo')
login_form.tr(:id => 'submit_record__row').input(:type => 'submit').click
puts "Login sent"
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
end
end
def test_00_demo_logged_in
login_form = $b.form(:id => 'login_form')
assert(!login_form.present?)
end
def go_to_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
table
end
def test_01_demo_patients
table = go_to_list
lines = table.tbody.rows
puts "Demo sees %s patients." % lines.count
assert(lines.count >= 4)
assert(lines.count < 10)
end
def test_02_demo_patients_search
filter = $b.text_field(:id => "db_filter_input")
filter.wait_until_present
filter.set('LIL-L3')
filter.fire_event('onchange')
Watir::Wait.until(30) {$b.execute_script("return jQuery.active") == 0}
table = $b.table(:id => "table")
table.wait_until_present
lines = table.tbody.rows
puts "Searching for 'LIL-L3', Demo sees %s patients." % lines.count
assert(lines.count == 2)
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