Index: tst_recirculate/test.py =================================================================== diff -u -rccf9a587e0dc447600f44e1520706c66d7141fab -rc4796ed14e7e7bbf8c17976d6da7c6a95518ddc8 --- tst_recirculate/test.py (.../test.py) (revision ccf9a587e0dc447600f44e1520706c66d7141fab) +++ tst_recirculate/test.py (.../test.py) (revision c4796ed14e7e7bbf8c17976d6da7c6a95518ddc8) @@ -10,7 +10,7 @@ # file tst_post_treatment_disconnection # date 2022/06/06 # author Amol Shinde -# author Shweta POlicepatil +# author Shweta Policepatil # author Amrita Debnath # author Ajina S M # NOTE: @@ -56,18 +56,20 @@ def verification_of_recirculate_recirculate_state(): """ - Method to verify Treatment Recirculate Recirculate state screens + Method to verify Treatment Recirculate Recirculate state screens """ test.startSection("verifying Treatment Recirculate Recirculate state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RECIRC_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, - saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentStates.TREATMENT_START_STATE.value, recirculate_state = TreatmentRecircStates.TREATMENT_RECIRC_RECIRC_STATE.value, - blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) - test.startSection("Verifying Timer conunt down timer") + saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state= TreatmentStates.TREATMENT_START_STATE.value, recirculate_state = TreatmentRecircStates.TREATMENT_RECIRC_RECIRC_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentStates.TREATMENT_START_STATE.value, + treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.startSection("Verifying Timer count down timer") for num in range(timer_default_value,count_down_value): hd_simulator.cmd_send_treatment_recirculate_data(timeout_total = num, timeout_count_down = num) min,sec = utility.convert_seconds_into_min_and_sec(num) - test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_minute_Text).text),str(sec),"Verifying seconds apeearing on UI") - test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_hour_Text).text),str(min),"Verifying minutes apeearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_minute_Text).text),str(sec),"Verifying seconds appearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_hour_Text).text),str(min),"Verifying minutes appearing on UI") test.endSection() test.compare(str(waitForObject(names.o_recirculate_text).text),config.RECIRCULATE_TEXT, "Recirculate text must be {}".format(config.RECIRCULATE_TEXT)) test.compare(str(waitForObjectExists(names.o_EndTreatmentBase_RECONNECT_Text).text), config.RECONNECT_BUTTON_TEXT, "Reconnect button text must be {}".format(config.RECONNECT_BUTTON_TEXT)) @@ -76,6 +78,7 @@ verify_right_instruction_in_recirculate_state(num_of_instructions) verify_left_instruction_in_recirculate_state(num_of_instructions) verify_right_instruction_in_recirculate_state(num_of_instructions) + verify_rejection_messages_for_recirculate() test.endSection() def verification_of_treatment_recirculate_stopped_state(): @@ -88,14 +91,15 @@ rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = TreatmentRecircStates.TREATMENT_RECIRC_STOPPED_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) - test.startSection("Verifying Timer conunt down timer") + test.startSection("Verifying Timer count down timer") for num in range(timer_default_value,count_down_value): hd_simulator.cmd_send_treatment_recirculate_data(timeout_total = num, timeout_count_down = num) min,sec = utility.convert_seconds_into_min_and_sec(num) - test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_minute_Text).text),str(sec),"Verifying seconds apeearing on UI") - test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_hour_Text).text),str(min),"Verifying minutes apeearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_minute_Text).text),str(sec),"Verifying seconds appearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentBase_TimeText_hour_Text).text),str(min),"Verifying minutes appearing on UI") test.endSection() test.compare(str(waitForObject(names.o_EndTreatmentBase_Reconnect_Text).text),config.RECONNECT_TEXT, "Reconnect text must be {}".format(config.RECONNECT_TEXT)) + verify_rejection_messages_for_recirculate() test.endSection() @@ -129,7 +133,16 @@ utility.verify_missing_object(names.o_EndTreatmentBase_leftImage_Image) test.endSection() - +def verify_rejection_messages_for_recirculate(): + """ + Method to test current states and rejection messages + """ + test.startSection("Verifying test case scenario for rejection and acceptance in current state") + for reason_id in range(1, config.NUM_OF_REQUEST_REJECT_REASONS + 1): + hd_simulator.cmd_send_treatment_adjust_recirculate_response(accepted=0, reason=reason_id) + rejection_message = waitForObjectExists(utility.rejection_msg(text=config.REJECTION_REASON[reason_id])) + test.compare(rejection_message.text, config.REJECTION_REASON[reason_id], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[reason_id])) + test.endSection() def main():