Index: tst_pre_treatment_disposables/test.py =================================================================== diff -u -r9ed766a31269686d91df7eec65b03ae213cea580 -r4e525fac94941a1451bd54f2390f47ece7f4f1b0 --- tst_pre_treatment_disposables/test.py (.../test.py) (revision 9ed766a31269686d91df7eec65b03ae213cea580) +++ tst_pre_treatment_disposables/test.py (.../test.py) (revision 4e525fac94941a1451bd54f2390f47ece7f4f1b0) @@ -182,6 +182,7 @@ test.startSection("Verifying the status 'CONFIRM' button") test.compare(str(waitForObjectExists(names.o_confirm_button_text).text), CONFIRM_BUTTON_TEXT,"'CONFIRM' button text should be {}".format(CONFIRM_BUTTON_TEXT)) test.compare(waitForObjectExists(names.o_confirm_button_text).enabled , True, "'CONFIRM' button should be enabled") + #mouseClick(waitForObjectExists(names.o_confirm_button_text)) test.endSection() def verify_functionality_for_cartridge_installation(): @@ -236,9 +237,53 @@ click_on_next_button() verify_right_instruction_navigation(NUM_OF_HEPARIN_SYRINGE_SCREENS, HEPARIN_SYRINGE) click_on_next_button() + test_state + test_rejection_message_on_saline_bolus verify_confirm_button() + mouseClick(waitForObject(names.o_confirm_button_text)) test.endSection() + +def test_state(accept_status, button_text, target, saline_states): + """ + Method to verify rejection message and transition state of saline bolus parameter. + @param accept_status: (int) boolean accept/reject response + @param button_text: (str) "START"/"STOP" based on button text. + @param target: (int) saline bolus Target volume + @param saline_states: (int) saline bolus transition State + @return: none + """ + rejection_reason = 0 + # 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])) + + #set saline transition state. + hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=saline_states, 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_treatmentStart_SalineSection).buttonText), "{} BOLUS".format(button_text)) + verification_of_target_value(expected_target_value = target) + + +def test_rejection_message_on_saline_bolus(accept_status, target, saline_states): + """ + verification of rejection messages on saline bolus. + @param accept_status: (int) boolean accept/reject response + @param target: (int) saline bolus Target volume + @param saline_states: (int) saline bolus transition State + @return: none + """ + 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])) + + test.endSection() def main(): utils.tstStart(__file__) startApplication(AUT_NAME)