Index: tst_treatment_monitoring/test.py =================================================================== diff -u -r7ca7f96e85f513986b5eeef60916500b84879c36 -ra79f4327ddb07d62332ccf205707a98cef2a98f5 --- tst_treatment_monitoring/test.py (.../test.py) (revision 7ca7f96e85f513986b5eeef60916500b84879c36) +++ tst_treatment_monitoring/test.py (.../test.py) (revision a79f4327ddb07d62332ccf205707a98cef2a98f5) @@ -18,27 +18,27 @@ import names from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator -from configuration import config, utility +from configuration import config BLOOD_PRIMING_TARGET_VALUE = 150 +hd_simulator = HDSimulator() + def test_blood_prime_value(expected_blood_prime_value): """ Tests to verify target values from blood prime section. @param: expected_blood_prime_value - expected blood prime value. @return: N/A """ - bloodprime_text = waitForObject(names.o_target_value) - bloodprime_unit = object.children(bloodprime_text)[1] expected_blood_prime_value = str(expected_blood_prime_value) +" "+config.LIQUID_UNIT - test.compare(expected_blood_prime_value, bloodprime_unit.text) + test.compare(expected_blood_prime_value, waitForObject(names.o_target_value).text) -def verification_of_blood_prime_from_dialysis_state(hd_instance): +def verification_of_blood_prime_from_dialysis_state(): """ Tests for verification of blood prime UI section. - @param hd_instance - instance for hd simulator. + @param N/A @return: N/A """ test.startSection("verification of blood prime values based on target value") @@ -47,22 +47,22 @@ for target_range in (BLOOD_PRIMING_TARGET_VALUE, config.BLOOD_PRIMING_TARGET_MAXIMUM+1): test.log("Selected target value should be -> " + str(target_range)) - for current_range in range(0, config.BLOOD_PRIMING_RANGE-1): - hd_instance.cmd_send_treatment_blood_prime_data(target = target_range,current = current_range) + for current_range in range(0, config.BLOOD_PRIMING_RANGE): + hd_simulator.cmd_send_treatment_blood_prime_data(target = target_range,current = current_range) test_blood_prime_value(expected_blood_prime_value = current_range) - utils.waitForGUI(1.5) #For fetching the effect in UI + utils.waitForGUI(0.3) #For fetching the effect in UI test.endSection() -def monitoring_treatment_parameters(hd_instnace): +def monitoring_treatment_parameters(): """ Tests for monitoring treatment parameters. - @param: hd_instance - instance for hd simulator. + @param: N/A @return: N/A """ test.startSection("Verification of treatment parameters") - hd_instnace.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, + hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0) @@ -127,19 +127,14 @@ def main(): utils.tstStart(__file__) - utility.start_application(config.AUT_NAME) + startApplication(config.AUT_NAME) - hd = HDSimulator() - - hd.cmd_send_power_on_self_test_version_request() - hd._handler_ui_first_check_in(message = None) + utils.waitForGUI(2) - hd.cmd_send_hd_operation_mode(6, 0) - verification_of_blood_prime_from_dialysis_state(hd) - monitoring_treatment_parameters(hd) + hd_simulator.cmd_send_hd_operation_mode(6, 0) - utils.waitForGUI(0.5) + verification_of_blood_prime_from_dialysis_state() + monitoring_treatment_parameters() utils.tstDone() - - + \ No newline at end of file