Index: tst_rinseback_setup/test.py =================================================================== diff -u -r652f22280b507addf7233e3ec60e4271f88a6ec9 -r63cc4b670684b2269a9617fea1910dacdff7bc28 --- tst_rinseback_setup/test.py (.../test.py) (revision 652f22280b507addf7233e3ec60e4271f88a6ec9) +++ tst_rinseback_setup/test.py (.../test.py) (revision 63cc4b670684b2269a9617fea1910dacdff7bc28) @@ -17,30 +17,21 @@ # This test contradicts verification of post treatment section. import names -import test from dialin.ui import utils -from dialin.ui.hd_simulator import HDSimulator -from dialin.ui.dg_simulator import DGSimulator from configuration import config -from configuration.config import * +from dialin.ui.hd_simulator import HDSimulator from configuration import utility from dialin.common.hd_defs import HDOpModes, HDOpSubModes, TreatmentStates, TreatmentEndStates, TreatmentRinsebackStates -dg_simulator = DGSimulator() hd_simulator = HDSimulator() +SCREEN_OBJ = names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit -SCREEN_OBJ1 = names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit -rightarrow_obj_names = [names.o_EndTreatmentRinsebackInit_rightImage_Image] -leftarrow_obj_names = [names.o_EndTreatmentRinsebackInit_leftImage_Image] -container_run_state = names.o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback -container_additional_state = names.o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase +COUNT_DOWN_VALUE = 121 +COUNT_DOWN_DEFAULT_VALUE = 0 +TIMER_DEFAULT_VALUE = 1 +NUM_OF_INSTRUCTION = 3 -count_down_value = 151 #Should be in capitals -count_down_default_value = 0 -timer_default_value = 1 -num_of_instructions = 3 - -def set_custom_object_property_rinseback_ml(text,container): +def set_custom_object_property_rinseback_ml(text, container): """ Method to set object property based on text @param text : (str) treatment parameter text @@ -55,65 +46,65 @@ Method to navigate and verify to Rinseback Stop INIT 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= 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) + 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=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) - test.startSection("verifying count down value of timer") - for num in range(timer_default_value,count_down_value): - hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_default_value, current_vol= count_down_default_value, flow_rate= count_down_default_value, timeout= num,timeout_countdown= num, is_completed= 0) + test.startSection("Verifying count down value of timer in " + config.RINSE_BACK_SETUP_TEXT) + for num in range(TIMER_DEFAULT_VALUE, COUNT_DOWN_VALUE + 1): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol=COUNT_DOWN_DEFAULT_VALUE, current_vol=COUNT_DOWN_DEFAULT_VALUE, flow_rate=COUNT_DOWN_DEFAULT_VALUE, timeout=num, timeout_countdown=num, is_completed= 0) min = utility.convert_seconds_into_min_and_sec(num, time_format="%M") sec = utility.convert_seconds_into_min_and_sec(num, time_format="%S") - test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_minute_Text).text),str(sec),"Verifying seconds appearing on UI")# log need to be changed - test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_hour_Text).text),str(min),"Verifying minutes appearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_minute_Text).text),str(sec), "Verifying seconds on timer in" + config.RINSE_BACK_SETUP_TEXT) + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_hour_Text).text),str(min), "Verifying minutes on timer in" + config.RINSE_BACK_SETUP_TEXT) test.endSection() 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.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) + verify_right_instruction_in_rinseback_setup_state(NUM_OF_INSTRUCTION) + verify_left_instruction_in_rinseback_setup_state(NUM_OF_INSTRUCTION) + verify_right_instruction_in_rinseback_setup_state(NUM_OF_INSTRUCTION) verify_rinseback_rejection_msg() test.endSection() def verify_rinseback_run_state_screen(): """ Method to navigate and verify to Rinseback RUN state screens """ - 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= 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.startSection("verifying count down value of timer") - for num in range(count_down_default_value,count_down_value): - hd_simulator.cmd_send_treatment_rinseback_data(target_vol=count_down_value, current_vol=num, flow_rate=num, timeout=count_down_default_value, timeout_countdown=count_down_default_value, is_completed=0) - rinseback_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT),container_run_state) - test.compare(str(waitForObject(rinseback_ml).text),str(num)+config.RINSEBACK_UNIT, "Verifying values apeearing on Progress circle")#log need to be channged - rinseback_ml_min = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT_MIN),container_run_state) - test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_circle_Circle).enabled, "Progress bar must be enable") - test.compare(str(waitForObject(rinseback_ml_min).text),str(num)+config.RINSEBACK_UNIT_MIN, "Verifying values apeearing on Lable")#log need to be changed - test.compare(str(waitForObject(names.o_EndTreatmentRinseback_circle_ProgressCircle).value),str(num), "Verifying Progress bar values")#log need to be changed + 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=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.startSection("Verifying count down value of timer in RUN state screen") + for num in range(COUNT_DOWN_DEFAULT_VALUE, COUNT_DOWN_VALUE + 1): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol=COUNT_DOWN_VALUE, current_vol=num, flow_rate=num, timeout=COUNT_DOWN_DEFAULT_VALUE, timeout_countdown=COUNT_DOWN_DEFAULT_VALUE, is_completed=0) + rinseback_ml = set_custom_object_property_rinseback_ml((str(num) + config.RINSEBACK_UNIT), names.o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback) + test.compare(str(waitForObject(rinseback_ml).text), str(num) + config.RINSEBACK_UNIT, "Verifying values on Progress bar in RUN state screen") + rinseback_ml_min = set_custom_object_property_rinseback_ml((str(num) + config.RINSEBACK_UNIT_MIN), names.o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_circle_ProgressCircle).enabled, "Progress bar must be enable") + test.compare(str(waitForObject(rinseback_ml_min).text), str(num) + config.RINSEBACK_UNIT_MIN, "Verifying values on Label in RUN state Screen") + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_circle_ProgressCircle).value), str(num), "Verifying Progress circle values in RUN state screen") test.endSection() - 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.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.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.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.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)) verify_rinseback_rejection_msg() @@ -124,11 +115,11 @@ Method to navigate and verify to Rinseback Paused state screens """ 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)) + 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)) @@ -137,7 +128,7 @@ decelarator = waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled test.compare(decelarator,False, " Decelerate button must be disabled") - 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.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)) verify_rinseback_rejection_msg() @@ -148,19 +139,19 @@ Method to navigate and verify to Rinseback Stop state screens """ 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.startSection("verifying count down value of timer") - for num in range(timer_default_value,count_down_value): - hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= count_down_default_value, flow_rate= count_down_default_value, timeout= num,timeout_countdown= num, is_completed= 0) + 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.startSection("Verifying count down value of timer in " + config.RINSEBACK_COMPLETE_TEXT) + for num in range(TIMER_DEFAULT_VALUE, COUNT_DOWN_VALUE): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol=COUNT_DOWN_VALUE, current_vol=COUNT_DOWN_DEFAULT_VALUE, flow_rate=COUNT_DOWN_DEFAULT_VALUE, timeout=num, timeout_countdown=num, is_completed= 0) min = utility.convert_seconds_into_min_and_sec(num, time_format="%M") sec = utility.convert_seconds_into_min_and_sec(num, time_format="%S") - test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_minute_Text).text),str(sec), "Vrifying seconds apeearing on UI")#log must be changes - test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_hour_Text).text),str(min), "Vrifying minutes apeearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_minute_Text).text),str(sec), "Verifying seconds on timer in" + config.RINSEBACK_COMPLETE_TEXT) + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_hour_Text).text),str(min), "Verifying minutes on timer in" + config.RINSEBACK_COMPLETE_TEXT) test.endSection() - 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(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)) @@ -179,48 +170,48 @@ 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.startSection("verifying count down value of timer") - for num in range(count_down_default_value,count_down_value): - hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= num, flow_rate= num, timeout= count_down_default_value,timeout_countdown= count_down_default_value, is_completed= 0) - rinseback_additional_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT_MIN),container_additional_state) - test.compare(str(waitForObject(rinseback_additional_ml).text),str(num)+config.RINSEBACK_UNIT_MIN, "Verifying values apeearing on Progres bar")#log must be changed - rinseback_additional_ml_min = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT),container_additional_state) - test.compare(str(waitForObject(rinseback_additional_ml_min).text),str(num)+config.RINSEBACK_UNIT, "Verifying values apeearing on Lable") - test.verify(waitForObjectExists(names.o_EndTreatmentAdditional_circle_Circle).enabled, "Progress Bar must be enable") - test.compare(str(waitForObject(names.o_EndTreatmentAdditional_circle_ProgressCircle).value),str(num), "Verifying Progress bar values") + test.startSection("verifying count down value of timer in" + config.ADDITIONAL_RINSEBACK_TEXT) + for num in range(COUNT_DOWN_DEFAULT_VALUE, COUNT_DOWN_VALUE + 1): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol=COUNT_DOWN_VALUE, current_vol=num, flow_rate=num, timeout=COUNT_DOWN_DEFAULT_VALUE, timeout_countdown=COUNT_DOWN_DEFAULT_VALUE, is_completed= 0) + rinseback_additional_ml = set_custom_object_property_rinseback_ml((str(num) + config.RINSEBACK_UNIT_MIN), names.o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase) + test.compare(str(waitForObject(rinseback_additional_ml).text), str(num) + config.RINSEBACK_UNIT_MIN, "Verifying Progress bar values" + config.ADDITIONAL_RINSEBACK_TEXT) + rinseback_additional_ml_min = set_custom_object_property_rinseback_ml((str(num) + config.RINSEBACK_UNIT), names.o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase) + test.compare(str(waitForObject(rinseback_additional_ml_min).text), str(num) + config.RINSEBACK_UNIT, "Verifying values on Label in" + config.ADDITIONAL_RINSEBACK_TEXT) + test.verify(waitForObjectExists(names.o_EndTreatmentAdditional_circle_ProgressCircle).enabled, "Progress Bar must be enable") + test.compare(str(waitForObject(names.o_EndTreatmentAdditional_circle_ProgressCircle).value), str(num), "Verifying Progress circle values" + config.ADDITIONAL_RINSEBACK_TEXT) test.endSection() - 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.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() -def verify_right_instruction_in_rinseback_setup_state(num_of_instructions): +def verify_right_instruction_in_rinseback_setup_state(NUM_OF_INSTRUCTION): """. 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, 1): - utility.verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ1) - if indicator != num_of_instructions: + utility.verify_missing_object(names.o_EndTreatmentRinsebackInit_leftImage_Image) + for indicator in range(1, NUM_OF_INSTRUCTION, 1): + utility.verify_bullet_navigation(indicator, NUM_OF_INSTRUCTION, SCREEN_OBJ) + if indicator != NUM_OF_INSTRUCTION: 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) + utility.verify_missing_object(names.o_EndTreatmentRinsebackInit_rightImage_Image) test.endSection() -def verify_left_instruction_in_rinseback_setup_state(num_of_instructions): +def verify_left_instruction_in_rinseback_setup_state(NUM_OF_INSTRUCTION): """ Method to verify left arrow functionality for rinseback setup state @param num_of_instructions - (int) count the number of instructions """ 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): - utility.verify_bullet_navigation(indicator, num_of_instructions, SCREEN_OBJ1) + utility.verify_missing_object(names.o_EndTreatmentRinsebackInit_rightImage_Image) + for indicator in range(NUM_OF_INSTRUCTION, 0, -1): + utility.verify_bullet_navigation(indicator, NUM_OF_INSTRUCTION, SCREEN_OBJ) if indicator != 1: mouseClick(waitForObject(names.o_EndTreatmentRinsebackInit_leftImage_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(leftarrow_obj_names) + utility.verify_missing_object(names.o_EndTreatmentRinsebackInit_leftImage_Image) test.endSection() def verify_rinseback_rejection_msg(): @@ -229,7 +220,7 @@ """ test.startSection("verifying rejection messages in rinseback screens ") for reason_id in range(1, config.NUM_OF_REQUEST_REJECT_REASONS + 1): - hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 0, reason= reason_id) + hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted=0, reason=reason_id) rejection_message = waitForObjectExists(utility.rinseback_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()