Index: tst_main_treatment_heparin/test.py =================================================================== diff -u -rb98a26754d9f171df91a444374c4eb9a6f15450f -r4e552f84fba0a7f176c92b20d397e789a9e56529 --- tst_main_treatment_heparin/test.py (.../test.py) (revision b98a26754d9f171df91a444374c4eb9a6f15450f) +++ tst_main_treatment_heparin/test.py (.../test.py) (revision 4e552f84fba0a7f176c92b20d397e789a9e56529) @@ -12,22 +12,23 @@ from configuration import config, utility from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator +from configuration.utility import expected_heparin_value +from dialin.ui.utils import waitForGUI HIGHER_RANGE = 20 STEP_VALUE = 1 LOWER_RANGE = 0 - hd_simulator = HDSimulator() def verification_of_cumulative_value(expected_cumulative_value): """ Verifying cumulative values from heparin delivery section. @param expected_cumulative_value - (str) expected cumulative value. """ - expected_cumulative_value = str(expected_cumulative_value).replace(".0","") + expected_cumulative_value =str(expected_cumulative_value).replace(".0","") heparin_value = waitForObjectExists(utility.expected_heparin_value(expected_cumulative_value)) - test.compare(heparin_value.text, expected_cumulative_value, utility.msg("Actual heparin cumulative value: {} should be equal to expected heparin cumulative value: {}".format(heparin_value.text, expected_cumulative_value))) + test.compare(heparin_value.text,expected_cumulative_value, utility.msg("Actual heparin cumulative value: {} should be equal to expected heparin cumulative value: {}".format(heparin_value.text, expected_cumulative_value))) def constants_for_cumulative_value(): """ @@ -37,18 +38,17 @@ hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state= 0, heparin_state= 3, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state= 0, treatment_stop_state=0, dialysis_state= 0) - test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) - test.compare((waitForObjectExists(names.o_state0_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) + test.compare(str(waitForObjectExists(names.o_state1_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) + test.compare((waitForObjectExists(names.o_state1_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) initial_bolus_text = waitForObjectExists(names.o_state3_heparin_state_initial_bolus_text).text test.compare(str(initial_bolus_text), config.HEPARIN_BOLUS_ACTIVE_TEXT, utility.msg("Notification Message should be {}".format(config.HEPARIN_BOLUS_ACTIVE_TEXT))) + utils.waitForGUI(1) HIGHER_VALUE = HIGHER_RANGE * 10 #conversion of decaliter to liter for heparin_cumulative in range(LOWER_RANGE, HIGHER_VALUE+1, STEP_VALUE): heparin_cumulative = format(heparin_cumulative/10, ".1f") - test.log(str(heparin_cumulative)) heparin_cumulative = float(heparin_cumulative) hd_simulator.cmd_set_treatment_heparin_data(heparin_cumulative) - verification_of_cumulative_value(heparin_cumulative) utils.waitForGUI(1) test.endSection() @@ -64,8 +64,8 @@ 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, dialysis_state= 0) - test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) - test.compare((waitForObjectExists(names.o_state0_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) + test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_Off_text).text), config.HEPARIN_DELIVERY_OFF_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) + test.compare((waitForObjectExists(names.o_state0_heparin_delivery_Off_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) test.log("Verifying Notification Message") test.compare(str(findObject(names.o_state0_heparin_delivery_Off_text).text ), config.HEPARIN_DELIVERY_OFF_TEXT, utility.msg("Notification Message should be {}".format(config.HEPARIN_DELIVERY_OFF_TEXT))) utils.waitForGUI(1) @@ -74,8 +74,8 @@ hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 1, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state= 0) - test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) - test.compare((waitForObjectExists(names.o_state0_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) + test.compare(str(waitForObjectExists(names.o_state1_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) + test.compare((waitForObjectExists(names.o_state1_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) test.log("Verifying Notification Message") test.compare(str(waitForObjectExists(names.o_state_one_text).text), config.HEPARIN_STOP_TEXT, utility.msg("Notification Message should be {}".format(config.HEPARIN_STOP_TEXT))) utils.waitForGUI(1) @@ -88,8 +88,8 @@ rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state= 0) - test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) - test.compare((waitForObjectExists(names.o_state0_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) + test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_Off_text).text), config.HEPARIN_DELIVERY_OFF_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) + test.compare((waitForObjectExists(names.o_state0_heparin_delivery_Off_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) test.log("Verifying Notification Message") test.compare(str(waitForObjectExists(names.o_state5_heparin_state_completed_text).text), config.HEPARIN_MAXIMUM_VOLUME_DELIVERED_TEXT, utility.msg("Notification Message should be {}".format(config.HEPARIN_MAXIMUM_VOLUME_DELIVERED_TEXT))) utils.waitForGUI(1) @@ -99,8 +99,8 @@ rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state= 0) - test.compare(str(waitForObjectExists(names.o_state0_heparin_delivery_text).text), config.HEPARIN_DELIVERY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) - test.compare((waitForObjectExists(names.o_state0_heparin_delivery_text)).enabled, False, utility.msg("Heparin Delivery should be disabled")) + test.compare(str(waitForObjectExists(names.o_state6_heparin_state_empty_text).text), config.HEPARIN_SYRINGE_EMPTY_TEXT, utility.msg("Heparin Delivery Text should be {}".format(config.HEPARIN_DELIVERY_TEXT))) + test.compare((waitForObjectExists(names.o_state6_heparin_state_empty_text)).enabled, True, utility.msg("Heparin Delivery should be disabled")) test.log("Verifying Notification Message") test.compare(str(waitForObjectExists(names.o_state6_heparin_state_empty_text).text), config.HEPARIN_SYRINGE_EMPTY_TEXT, utility.msg("Notification Message should be {}".format(config.HEPARIN_SYRINGE_EMPTY_TEXT))) utils.waitForGUI(1) @@ -150,7 +150,9 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) heparin_stop_states_in_main_treatment() - verify_the_rejection_msg() + #TODO + #verify_the_rejection_msg() utils.tstDone() + \ No newline at end of file