Index: tst_main_treatment_heparin/test.py =================================================================== diff -u -r6bb43117bca2673c5de877f5b70b094da344418a -r24c54e0efb0d604eb70dd1ac1c7f1bd4580cd192 --- tst_main_treatment_heparin/test.py (.../test.py) (revision 6bb43117bca2673c5de877f5b70b094da344418a) +++ tst_main_treatment_heparin/test.py (.../test.py) (revision 24c54e0efb0d604eb70dd1ac1c7f1bd4580cd192) @@ -15,13 +15,13 @@ HEPARIN_BUTTON_STATES = {0: "OFF", 1: "HEPARIN DELIVERY", 2: "RESUME DELIVERY", - 3: "HEPARIN DELIVERY", 4: "PAUSE DELIVERY", + 3: "HEPARIN DELIVERY", 4: "PAUSE HEPARIN", 5: "OFF", 6: "HEPARIN DELIVERY"} HEPARIN_STATE_MSGS = {"STATE_0_OFF_MESSAGE": "", "STATE_1_HEPARIN DELIVERY_MESSAGE": "Delivery Stopped", "STATE_2_RESUME DELIVERY_MESSAGE": "Delivery Paused", "STATE_3_HEPARIN DELIVERY_MESSAGE": "Bolus Active", - "STATE_4_PAUSE DELIVERY_MESSAGE": "Dispensing Active", + "STATE_4_PAUSE HEPARIN_MESSAGE": "Dispensing Active", "STATE_5_OFF_MESSAGE": "Maximum Cumulative Heparin Volume Delivered", "STATE_6_HEPARIN DELIVERY_MESSAGE": "Syringe Empty"} @@ -39,12 +39,15 @@ treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) mouseClick(waitForObject(names.o_treatmentHome_mouseArea_MouseArea_2)) test.compare(str(waitForObjectExists(names.o_treatment_text).text), config.TREATMENT_TEXT, utility.msg("Treatment title Text should be {}".format(config.TREATMENT_TEXT))) - mouseClick(waitForObject(names.o_trending_text)) - mouseClick(waitForObject(names.o_treatmentHome_mouseArea_MouseArea_2)) - test.compare(str(waitForObjectExists(names.o_trending_text).text), config.TRENDING_TEXT, utility.msg("Trending title Text should be {}".format(config.TRENDING_TEXT))) - mouseClick(waitForObject(names.o_main_settings_text)) - mouseClick(waitForObject(names.o_treatmentHome_mouseArea_MouseArea_2)) - test.compare(str(waitForObjectExists(names.o_main_settings_text).text), config.SETTINGS_TEXT, utility.msg("Trending title Text should be {}".format(config.SETTINGS_TEXT))) + + # TODO uncomment the following lines if Trending and Settings are visible in the TreatmentStack.qml' MainMenu + # mouseClick(waitForObject(names.o_trending_text)) + # mouseClick(waitForObject(names.o_treatmentHome_mouseArea_MouseArea_2)) + # test.compare(str(waitForObjectExists(names.o_trending_text).text), config.TRENDING_TEXT, utility.msg("Trending title Text should be {}".format(config.TRENDING_TEXT))) + # mouseClick(waitForObject(names.o_main_settings_text)) + # mouseClick(waitForObject(names.o_treatmentHome_mouseArea_MouseArea_2)) + # test.compare(str(waitForObjectExists(names.o_main_settings_text).text), config.SETTINGS_TEXT, utility.msg("Trending title Text should be {}".format(config.SETTINGS_TEXT))) + 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 @@ -53,7 +56,7 @@ for index in range(10): utils.waitForGUI(0.2) - hd_simulator.cmd_set_treatment_heparin_data(cumulative = config.HEPARIN_VALUES["Cumulative Value"][index]) + hd_simulator.cmd_set_treatment_heparin_data(cumulative = config.HEPARIN_VALUES["Cumulative Value"][index], required = config.HEPARIN_VALUES["Required Value"][index]) parameter_text = object.children(waitForObjectExists(names.o_volume_delivered_text)) test.compare((str(parameter_text[2].text)), str(config.HEPARIN_VALUES["Cumulative Value"][index]) , "parameter value should be "+str(config.HEPARIN_VALUES["Cumulative Value"][index])) test.endSection() @@ -149,7 +152,8 @@ Method to verify rejection messages """ test.startSection("Verifying Rejection Messages") - rejection_msg = waitForObjectExists(utility.rejection_msg(text=config.REJECTION_REASON[reason_id])) + names.o_heparin_rejection_textLabel["text"] = config.REJECTION_REASON[reason_id] + rejection_msg = waitForObjectExists(names.o_heparin_rejection_textLabel) test.compare(rejection_msg.text, config.REJECTION_REASON[reason_id], utility.msg("The rejection message should be {}".format(config.REJECTION_REASON[reason_id]))) test.endSection()