Index: tst_treatment_saline_data/test.py =================================================================== diff -u -r6bb43117bca2673c5de877f5b70b094da344418a -r9ef78246744be74035d8521b7ee71dc84a623883 --- tst_treatment_saline_data/test.py (.../test.py) (revision 6bb43117bca2673c5de877f5b70b094da344418a) +++ tst_treatment_saline_data/test.py (.../test.py) (revision 9ef78246744be74035d8521b7ee71dc84a623883) @@ -81,6 +81,9 @@ """ test.compare(waitForObjectExists(names.o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration).isTouchable, enabled_status,"uf touchable area is visible") +def saline_rejection_text_object(text): + names.o_treatmentHome_Saline_Rejection_Text["text"] = text + return names.o_treatmentHome_Saline_Rejection_Text def test_state(accept_status, button_text, target, saline_states): """ @@ -95,7 +98,7 @@ # when rejected reason set 16 -> saline bolus in progress if (not accept_status): rejection_reason = rejectReason.REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS.value hd_simulator.cmd_set_saline_bolus_response(accepted = accept_status, reason = rejection_reason, target = target) - if (not accept_status): test.compare(waitForObjectExists(utility.rejection_msg(config.REJECTION_REASON[rejection_reason])).text, config.REJECTION_REASON[rejection_reason], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection_reason])) + if (not accept_status): test.compare(waitForObjectExists(saline_rejection_text_object(config.REJECTION_REASON[rejection_reason])).text, config.REJECTION_REASON[rejection_reason], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection_reason])) #set saline transition state. hd_simulator.cmd_set_treatment_states_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_DISINFECT_STATE.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=saline_states, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, @@ -117,9 +120,11 @@ test.startSection("verification of rejection messages on saline bolus") for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS): hd_simulator.cmd_set_saline_bolus_response(accepted=accept_status, reason=rejection, target=target) - rejection_message = waitForObjectExists(utility.rejection_msg(config.REJECTION_REASON[rejection])) - test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) - + try: + rejection_message = waitForObjectExists(saline_rejection_text_object(config.REJECTION_REASON[rejection]), 256) #256ms timeout + test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) + except LookupError: + test.fail("expected rejection {msg} message object not found".format(msg=config.REJECTION_REASON[rejection])) test.endSection() @@ -141,8 +146,8 @@ test.log("verification of saline values from dialysis state for target value :" + str(target_value)+ " cumulative value :" +str(cumulative_value)+" and delivered value :"+ str(delivered_value)) verify_target_value(expected_target_value = format(target_value, '.1f')) - verify_delivered_value(expected_delivered_value = format(delivered_value, '.0f')) - verify_cumulative_value(expected_cumulative_value = format(cumulative_value, '.0f')) + verify_delivered_value(expected_delivered_value = format(delivered_value, '.1f')) + verify_cumulative_value(expected_cumulative_value = format(cumulative_value, '.1f')) test.endSection()