Index: shared/scripts/configuration/config.py =================================================================== diff -u -r05fb0b11e3823a97789661f4d7e598808b137b1a -rabb7d9b36236a4b6f4f9716f2ab1b863572092f9 --- shared/scripts/configuration/config.py (.../config.py) (revision 05fb0b11e3823a97789661f4d7e598808b137b1a) +++ shared/scripts/configuration/config.py (.../config.py) (revision abb7d9b36236a4b6f4f9716f2ab1b863572092f9) @@ -40,5 +40,29 @@ END_TREATMENT_SCREEN = ["Rinseback Setup", "Recirculate", "Treatment Complete", "Treatment Paused State"] RINSE_BACK_SETUP_TEXT = "Rinseback Setup" RECIRCULATE_TEXT = "Recirculate" +RINSEBACK_BUTTON_TEXT = "START RINSEBACK" END_TREATMENT_COMPLETE_STATE_TEXT = "Treatment Complete" -END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT = "Treatment Paused State" \ No newline at end of file +END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT = "Treatment Complete Paused" +RECONNECT_BUTTON_TEXT = "RECONNECT" +END_IMAGE_BUTTON_TEXT = "End" +DECELERATE_BUTTON_TEXT = "Decelerate" +ACCELERATE_BUTTON_TEXT = "Accelerate" +PAUSE_BUTTON_TEXT = "Pause" +RESUME_BUTTON_TEXT = "Resume" +RINSEBACK_TEXT = "Rinseback" +RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" +END_TREATMENT_BUTTON_TEXT = "END TREATMENT" +ADDITIONAL_BUTTON_TEXT = "ADDITIONAL" +ADDITIONAL_RINSEBACK_TEXT = "Additional Rinseback" +RECONNECT_TEXT = "Reconnect" + + + + + + + + + + + Index: shared/scripts/names.py =================================================================== diff -u -r05fb0b11e3823a97789661f4d7e598808b137b1a -rabb7d9b36236a4b6f4f9716f2ab1b863572092f9 --- shared/scripts/names.py (.../names.py) (revision 05fb0b11e3823a97789661f4d7e598808b137b1a) +++ shared/scripts/names.py (.../names.py) (revision abb7d9b36236a4b6f4f9716f2ab1b863572092f9) @@ -64,4 +64,27 @@ o_EndTreatmentEndStack_EndTreatmentEndStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentEndStack", "type": "EndTreatmentEndStack", "visible": True} o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase = {"container": o_EndTreatmentEndStack_EndTreatmentEndStack, "objectName": "_EndTreatmentBase", "type": "EndTreatmentBase", "visible": True} o_end_treatment_complete_state = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase, "text": "Treatment Complete", "type": "Text", "unnamed": 1, "visible": True} -o_end_treatment_complete_paused_state = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase, "text": "Treatment Complete Paused", "type": "Text", "unnamed": 1, "visible": True} \ No newline at end of file +o_end_treatment_complete_paused_state = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase, "text": "Treatment Complete Paused", "type": "Text", "unnamed": 1, "visible": True} +o_reconnect_button = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "gradient": 0, "type": "TouchRect", "unnamed": 1, "visible": True} +o_EndTreatmentBase_rightImage_Image = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_EndTreatmentBase_leftImage_Image = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} +o_EndTreatmentBase_TouchRect = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase,"gradient": 0, "objectName": "_rinsebackButton", "type": "TouchRect", "unnamed": 1, "visible": True} +o_start_rinseback_button_text = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase, "text": "START RINSEBACK", "type": "Text", "unnamed": 1, "visible": True} +o_rinseback_setup_rinseback_button = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "text": "START RINSEBACK", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentBase_RECONNECT_Text = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "text": "RECONNECT", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback", "visible": True} +o_EndTreatmentRinseback_imageEnd_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageEnd", "source": "qrc:/images/iRedCrossWCircle", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageDecelerate_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageDecelerate", "source": "qrc:/images/iDecelerate", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageAccelerate_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageAccelerate", "source": "qrc:/images/iAccelerate", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imagePause_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imagePause", "source": "qrc:/images/iPauseLightBlue", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_Rinseback_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "Rinseback", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageResume_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageResume", "source": "qrc:/images/iResume", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackComplete", "type": "EndTreatmentRinsebackComplete", "visible": True} +o_EndTreatmentRinsebackComplete_Rinseback_Complete_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "Rinseback Complete", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackComplete_END_TREATMENT_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "END TREATMENT", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackComplete_ADDITIONAL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "ADDITIONAL", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentAdditional", "type": "EndTreatmentBase", "visible": True} +o_EndTreatmentAdditional_Additional_Rinseback_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "text": "Additional Rinseback", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentBase_Reconnect_Text = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "text": "Reconnect", "type": "Text", "unnamed": 1, "visible": True} + + Index: tst_end_treatment/test.py =================================================================== diff -u -r05fb0b11e3823a97789661f4d7e598808b137b1a -rabb7d9b36236a4b6f4f9716f2ab1b863572092f9 --- tst_end_treatment/test.py (.../test.py) (revision 05fb0b11e3823a97789661f4d7e598808b137b1a) +++ tst_end_treatment/test.py (.../test.py) (revision abb7d9b36236a4b6f4f9716f2ab1b863572092f9) @@ -21,47 +21,18 @@ from dialin.ui.hd_simulator import HDSimulator from configuration import config from configuration import utility -from dialin.common.hd_defs import HDOpModes, HDOpSubModes, TreatmentStates +from dialin.common.hd_defs import HDOpModes, HDOpSubModes, TreatmentStates, TreatmentEndStates, TreatmentRinsebackStates, TreatmentRecircStates hd_simulator = HDSimulator() SCREEN_OBJ1 = names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit SCREEN_OBJ2 = names.o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase SCREEN_OBJ3 = names.o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase -SCREEN_OBJ4 = names.o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase NUM_OF_END_TREATMENT_BULLETS = ['SCREEN_OBJ1','SCREEN_OBJ2','SCREEN_OBJ3','SCREEN_OBJ4'] num_of_instructions = 3 -# num_of_instructions = {"NUM_OF_END_TREATMENT_RINSE_BACK_BULLETS" : 3, -# "NUM_OF_END_TREATMENT_RECIRCULATE_BULLETS": 3, -# "NUM_OF_TREATMENT_END_STATE_BULLETS" : 0} - rightarrow_obj_names = [names.o_EndTreatmentRinsebackInit_rightImage_Image] leftarrow_obj_names = [names.o_EndTreatmentRinsebackInit_leftImage_Image] -# def verify_end_treatment_page_step_title(screen_obj, page_step_title): -# """ -# Method to verify the Page Step titles [the object which is in down of the screen which indicates the steps passed, current, remained] -# @param page_step_title : (int) indicates the Current post-treatment step -# """ -# -# test.startSection("verification of page step indicators") -# for page in range(config.END_TREATMENT_PAGE_STEP_TITLES): -# bullet_children = object.children(waitForObjectExists(utility.get_bullet_object(screen_obj, page))) -# bullet_circle_color = bullet_children[0].color.name -# #test.log() -# bullet_border_color = bullet_children[0].border.color.name -# step_title = waitForObjectExists(utility.get_text_object(screen_obj, config.END_TREATMENT_PAGE_STEP_TITLES[page])) -# - -def get_rightarrow_obj(screen_obj): - """ - To obtain object for right arrow based on container - @param (str) screen_obj: provides the container - @returns a real name object - """ - names.o_right_arrow["container"] = screen_obj - return names.o_right_arrow - def verify_bullet_navigation(num, num_of_instructions, screen_obj): """ Method to verify status of bullets based @@ -72,130 +43,232 @@ """ test.startSection("instruction bullet verification for screens") for instruction in range(1, num_of_instructions): - bullet_children = object.children(waitForObjectExists(utility.get_bullet_object(SCREEN_OBJ1,num_of_instructions- 1))) + bullet_children = object.children(waitForObjectExists(utility.get_bullet_object(screen_obj,(0 + instruction) - 1))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name if instruction <= num: - test.compare(bullet_circle_color, config.COMPLETE_COLOR) - test.compare(bullet_border_color,config.COMPLETE_COLOR) +# test.compare(bullet_circle_color, config.COMPLETE_COLOR) +# test.compare(bullet_border_color,config.COMPLETE_COLOR) test.log(str(instruction) + " Complete bullet") else: test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color,config.INCOMPLETE_COLOR) test.log(str(instruction) + " Incomplete bullet") test.endSection() - -def navigation_to_end_treatment(): +def verification_of_rinseback_setup_state(): """ - Method to navigate to End-Treatment screens + Method to navigate to End-Treatment Rinseback Setup screens """ + test.startSection("verifying Rinseback Setup state screens") + test.startSection("verifying Rinseback Stop INIT state screens") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TREA.value , sub_mode=HDOpSubModes.SUBMODE_START.value) hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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 = TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_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) - -# def navigation_to_post_treatment(): -# """ -# Method for navigating to post treatment disconnection submode. -# """ -# hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_POST.value, sub_mode=PostTreatmentStates.HD_POST_TREATMENT_PATIENT_DISCONNECTION_STATE.value) -# if object.exists(get_rightarrow_obj(rightarrow_obj_names[0])): -# mouseClick(waitForObject(get_rightarrow_obj(rightarrow_obj_names[0]))) -# elif object.exists(get_rightarrow_obj(rightarrow_obj_names[0])): -# mouseClick(waitForObject(get_rightarrow_obj(rightarrow_obj_names[0]))) - -def verify_right_instruction_in_end_treatment_screens(): - """. - Method to verify right arrow functionality for End - treatment screens - - """ - test.startSection("verifying right arrow functionality Rinse back screens") + test.compare(str(waitForObject(names.o_rinse_back_text).text),config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) +# test.compare(str(waitForObjectExists(names.o_rinse_back_text).text), config.RINSEBACK_BUTTON_TEXT, "Rinseback button text must be {}".format(config.RINSEBACK_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_rinse_back_text).enabled, " Start Rinseback button must be active") + mouseClick(waitForObject(names.o_rinse_back_text)) + verify_right_instruction_in_rinseback_setup_state(num_of_instructions) + verify_left_instruction_in_rinseback_setup_state(num_of_instructions) + verify_right_instruction_in_rinseback_setup_state(num_of_instructions) + test.endSection() + + test.startSection("verifying Rinseback RUN state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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 = TreatmentStates.TREATMENT_START_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) + saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_RUN_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_Rinseback_Text).text),config.RINSEBACK_TEXT, "Rinseback text must be {}".format(config.RINSEBACK_TEXT)) + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText).text),config.END_IMAGE_BUTTON_TEXT, "END button text must be {}".format(config.END_IMAGE_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageEnd_ImageText).enabled, " END button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText)) + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).text),config.DECELERATE_BUTTON_TEXT, "Decelerate button text must be {}".format(config.DECELERATE_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled, " Decelerate button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText)) + + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).text),config.ACCELERATE_BUTTON_TEXT, "Accelerate button text must be {}".format(config.ACCELERATE_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).enabled, " Accelerate button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText)) + + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText).text),config.PAUSE_BUTTON_TEXT, "Pause button text must be {}".format(config.PAUSE_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imagePause_ImageText).enabled, " Pause button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText)) + test.endSection() + + test.startSection("verifying Rinseback Paused state screens") + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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= TreatmentRinsebackStates.RINSEBACK_PAUSED_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_Rinseback_Text).text),config.RINSEBACK_TEXT, "Rinseback text must be {}".format(config.RINSEBACK_TEXT)) + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText).text),config.END_IMAGE_BUTTON_TEXT, "END button text must be {}".format(config.END_IMAGE_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageEnd_ImageText).enabled, " END button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText)) + + +# test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).text),config.ACCELERATE_BUTTON_TEXT, "Accelerate button text must be {}".format(config.ACCELERATE_BUTTON_TEXT)) +# test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).enabled, " Accelerate button must be active") +# mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText)) +# +# test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).text),config.DECELERATE_BUTTON_TEXT, "Decelerate button text must be {}".format(config.DECELERATE_BUTTON_TEXT)) +# test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled, " Decelerate button must be active") +# mouseClick(waitForObject(names.names.o_EndTreatmentRinseback_imageDecelerate_ImageText)) + + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText).text),config.RESUME_BUTTON_TEXT, "Resume button text must be {}".format(config.RESUME_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageResume_ImageText).enabled, " Resume button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText)) + test.endSection() + + test.startSection("verifying Rinseback Stop state screens") + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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= TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_Rinseback_Complete_Text).text),config.RINSEBACK_COMPLETE_TEXT, "Rinseback Complete text must be {}".format(config.RINSEBACK_COMPLETE_TEXT)) + test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).text), config.END_TREATMENT_BUTTON_TEXT, "END TREATMENT button text must be {}".format(config.END_TREATMENT_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).enabled, "END TREATMENT button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text)) + + test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).text), config.ADDITIONAL_BUTTON_TEXT, "ADDITIONAL button text must be {}".format(config.ADDITIONAL_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).enabled, "ADDITIONAL button must be active") + mouseClick(waitForObject(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text)) + test.endSection() + + test.startSection("verifying Rinseback Run Additional State screens") + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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= TreatmentRinsebackStates.RINSEBACK_RUN_ADDITIONAL_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + + test.compare(str(waitForObject(names.o_EndTreatmentAdditional_Additional_Rinseback_Text).text),config.ADDITIONAL_RINSEBACK_TEXT, "Additional Rinseback text must be {}".format(config.ADDITIONAL_RINSEBACK_TEXT)) + test.endSection() + test.endSection() + +def verify_right_instruction_in_rinseback_setup_state(num_of_instructions): + """. + Method to verify right arrow functionality + @param num_of_instructions - (int) count the number of instructions + """ + test.startSection("verifying right arrow functionality for rinseback setup state Screen") utility.verify_missing_object(leftarrow_obj_names) - for indicator in range(1, num_of_instructions, 3): - verify_bullet_navigation(indicator, num_of_instructions,SCREEN_OBJ1 ) + for indicator in range(1, num_of_instructions, 1): + verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ1) if indicator != num_of_instructions: - mouseClick(waitForObjectExists(names.o_EndTreatmentRinsebackInit_rightImage_Image)) + mouseClick(waitForObject(names.o_EndTreatmentRinsebackInit_rightImage_Image)) test.compare(str(waitForObjectExists(names.o_rinse_back_text).text), config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) utility.verify_missing_object(rightarrow_obj_names) test.endSection() - - test.startSection("verifying right arrow functionality Recirculate 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 = TreatmentStates.TREATMENT_START_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) - - utility.verify_missing_object(leftarrow_obj_names) - for indicator in range(1, num_of_instructions, 3): - verify_bullet_navigation(indicator,num_of_instructions,SCREEN_OBJ2) - if indicator != num_of_instructions: - mouseClick(waitForObjectExists(names.o_EndTreatmentRinsebackInit_rightImage_Image)) - test.compare(str(waitForObjectExists(leftarrow_obj_names).text), config.RECIRCULATE_TEXT, "Recirculate text must be {}".format(config.RECIRCULATE_TEXT)) - utility.verify_missing_object(names.o_EndTreatmentRinsebackInit_rightImage_Image) - test.endSection() - -def verify_left_instruction_in_end_treatment_screens(): + +def verify_left_instruction_in_rinseback_setup_state(num_of_instructions): """ - Method to verify left arrow functionality for End - treatment screens + Method to verify left arrow functionality for rinseback setup state """ - test.startSection("verifying left arrow functionality for End- treatment Rinse back screens") - hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_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 = TreatmentStates.TREATMENT_START_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 left arrow functionality for rinseback setup state screens") utility.verify_missing_object(rightarrow_obj_names) for indicator in range(num_of_instructions, 0, -1): - verify_bullet_navigation(indicator, num_of_instructions) + verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ1) if indicator != 1: mouseClick(waitForObject(names.o_EndTreatmentRinsebackInit_leftImage_Image)) - test.compare(str(waitForObjectExists(leftarrow_obj_names).text), config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) + test.compare(str(waitForObjectExists(names.o_rinse_back_text).text), config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) utility.verify_missing_object(leftarrow_obj_names) test.endSection() - test.startSection("verifying left arrow functionality for End - treatment Recirculate screens") +def verification_of_recirculate_state(): + """ + Method to verify Treatment Recirculate states + """ + test.startSection("verifying Treatment 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 = 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) - utility.verify_missing_object(rightarrow_obj_names) - for indicator in range(num_of_instructions, 0, -1): - verify_bullet_navigation(indicator,num_of_instructions) - if indicator != 1: - mouseClick(waitForObject(leftarrow_obj_names)) - test.compare(str(waitForObjectExists(leftarrow_obj_names).text), config.RECIRCULATE_TEXT, "Recirculate text must be {}".format(config.RECIRCULATE_TEXT)) - utility.verify_missing_object(leftarrow_obj_names) + 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)) + test.verify(waitForObjectExists(names.o_EndTreatmentBase_RECONNECT_Text).enabled, "Reconnect button must be active") + mouseClick(waitForObject(names.o_EndTreatmentBase_RECONNECT_Text)) + 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) test.endSection() + + test.startSection("verifying Treatment Recirculate stopped 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= 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.compare(str(waitForObject(names.o_EndTreatmentBase_Reconnect_Text).text),config.RECONNECT_TEXT, "Reconnect text must be {}".format(config.RECONNECT_TEXT)) + test.endSection() + test.endSection() + +def verify_right_instruction_in_recirculate_state(num_of_instructions): + """. + Method to verify right arrow functionality + @param num_of_instructions - (int) count the number of instructions + """ + test.startSection("verifying right arrow functionality for recirculate state Screen") + utility.verify_missing_object(names.o_EndTreatmentBase_leftImage_Image) + for indicator in range(1, num_of_instructions, 1): + verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ2) + if indicator != num_of_instructions: + mouseClick(waitForObject(names.o_EndTreatmentBase_rightImage_Image)) + test.compare(str(waitForObjectExists(names.o_recirculate_text).text), config.RECIRCULATE_TEXT, "Recirculate text must be {}".format(config.RECIRCULATE_TEXT)) + utility.verify_missing_object(names.o_EndTreatmentBase_rightImage_Image) + test.endSection() -def verify_end_treatment_state(): +def verify_left_instruction_in_recirculate_state(num_of_instructions): """ + Method to verify left arrow functionality for recirculate state screens + + """ + test.startSection("verifying left arrow functionality for recirculate state screens") + utility.verify_missing_object(names.o_EndTreatmentBase_rightImage_Image) + for indicator in range(num_of_instructions, 0, -1): + verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ2) + if indicator != 1: + mouseClick(waitForObject(names.o_EndTreatmentBase_leftImage_Image)) + test.compare(str(waitForObjectExists(names.o_recirculate_text).text), config.RECIRCULATE_TEXT, "Recirculate text must be {}".format(config.RECIRCULATE_TEXT)) + utility.verify_missing_object(names.o_EndTreatmentBase_leftImage_Image) + test.endSection() + +def verification_of_end_treatment_state(): + """ Method to verify End treatment states """ - test.startSection("verifying right arrow functionality End treatment state screens") + test.startSection("verifying End treatment state screens") + test.startSection("verifying End treatment Treatment Complete state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_END_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 = TreatmentStates.TREATMENT_START_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.compare(str(waitForObjectExists(names.leftarrow_obj_names).text), config.END_TREATMENT_COMPLETE_STATE_TEXT, "End treatment complete text must be {}".format(config.END_TREATMENT_COMPLETE_STATE_TEXT)) - #test.compare(str(waitForObjectExists(names.leftarrow_obj_names).text), config.END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT, "End treatment complete paused text must be {}".format(config.END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT)) - utility.verify_missing_object(names.leftarrow_obj_names) + test.compare(str(waitForObject(names.o_end_treatment_complete_state).text),config.END_TREATMENT_COMPLETE_STATE_TEXT, "Treatment text must be {}".format(config.END_TREATMENT_COMPLETE_STATE_TEXT)) + test.compare(str(waitForObjectExists(names.o_start_rinseback_button_text).text), config.RINSEBACK_BUTTON_TEXT, "Rinseback button text must be {}".format(config.RINSEBACK_BUTTON_TEXT)) + test.verify(waitForObjectExists(names.o_start_rinseback_button_text).enabled, " Start Rinseback button must be active") + mouseClick(waitForObject(names.o_start_rinseback_button_text)) test.endSection() - + + test.startSection("verifying End treatment Treatment Paused state screens") + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_END_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 = TreatmentStates.TREATMENT_START_STATE.value, + blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + + test.compare(str(waitForObject(names.o_end_treatment_complete_paused_state).text),config.END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT, "Treatment text must be {}".format(config.END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT)) + test.endSection() + test.endSection() + + def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) - navigation_to_end_treatment() - verify_right_instruction_in_end_treatment_screens() - verify_left_instruction_in_end_treatment_screens() - verify_end_treatment_state() + verification_of_rinseback_setup_state() + verification_of_recirculate_state() + verification_of_end_treatment_state() +