Index: tst_post_treatment/test.py =================================================================== diff -u -ref979c18b1d91ee061bf9102ac8deb44f178b0cc -r8977e6f10ea8a1b5807f963a1b98dc11ea2d181f --- tst_post_treatment/test.py (.../test.py) (revision ef979c18b1d91ee061bf9102ac8deb44f178b0cc) +++ tst_post_treatment/test.py (.../test.py) (revision 8977e6f10ea8a1b5807f963a1b98dc11ea2d181f) @@ -24,7 +24,6 @@ from configuration import utility from dialin.common.hd_defs import HDOpModes, HDOpSubModes, PostTreatmentStates - hd_simulator = HDSimulator() NUM_OF_POSTTREATMENT_BULLETS = len(config.POST_TREATMENT_SCREENS) @@ -40,14 +39,7 @@ rightarrow_obj_names = [names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase] leftarrow_obj_names = [names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase] -contents = [] -parameter_names = [] -parameter_values = [] -parameter_units = [] -title_list = [] - - def get_rightarrow_obj(screen_obj): """ To obtain object for right arrow based on container @@ -57,17 +49,18 @@ names.o_right_arrow["container"] = screen_obj return names.o_right_arrow - + 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]))) - if object.exists(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 post_treatment_review_text_obj(text): """ Method to set object property as dynamic. @@ -197,35 +190,31 @@ test.compare(str(waitForObjectExists(names.o_patient_disconnection_confirm_button).text), config.PATIENT_DISCONNECTION_CONFIRM_BUTTON_TEXT,"Confirm button text must be {}".format(config.PATIENT_DISCONNECTION_CONFIRM_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_patient_disconnection_confirm_button).enabled, "Confirm button must be enabled") mouseClick(waitForObject(names.o_patient_disconnection_confirm_button)) - utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ2,1) - test.compare(waitForObject(names.o_treatment_review_next_text).text, config.NEXT_TEXT, "NEXT button text must be NEXT") - test.verify(waitForObject(names.o_treatment_review_next_button).enabled, "NEXT button must be enabled") - mouseClick(waitForObject(names.o_treatment_review_next_button)) test.endSection() + - -def navigate_treatment_review_screen(): +def verify_treatment_review_screen(): """ - Method to navigate to review treatment screen and verify page step indicator + Method to verify parameters under 'Treatment Review Screens' """ - - test.startSection("navigating and verifying page step indicator under Review screen") - test.verify(waitForObjectExists(names.o_disposables_removal_backButton).enabled, " Back button must be active") + test.startSection("Verifying Treatment Review Screen") + utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ2,1) + test.compare(waitForObject(names.o_treatment_review_next_text).text, config.NEXT_TEXT, "NEXT button text must be NEXT") test.verify(not waitForObjectExists(names.o_treatmentReviewConfirm_Export_Text).enabled, " Export button should not be active") test.compare(str(waitForObjectExists(names.o_treatmentReviewConfirm_Export_Text).text), config.EXPORT_TEXT,"Export button text must be {}".format(config.EXPORT_TEXT)) - mouseClick(waitForObject(names.o_disposables_removal_backButton)) - test.verify(waitForObjectExists(names.o_treatment_review_next_button).enabled, " Next button must be active") + verify_post_treatment_review_parameters() + verify_post_treatment_review_log_data() + test.verify(waitForObject(names.o_treatment_review_next_button).enabled, "NEXT button must be enabled") mouseClick(waitForObject(names.o_treatment_review_next_button)) - utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ3, DISPOSABLES_STEP) test.endSection() - + def verify_disposables_screen(): """ Method to verify parameters under 'Disposables screens' """ - navigate_treatment_review_screen() test.startSection("verification of Disposable Screen") + utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ3, DISPOSABLES_STEP) names.o_bullet_object.pop("occurrence") verify_right_instruction_navigation_disposables(NUM_OF_DISPOSABLE_INSTALLATION_SCREENS) test.verify(waitForObjectExists(names.o_disposables_removal_confirm_button).enabled, " confirm button must be active") @@ -241,26 +230,19 @@ """ Method to verify post treatment review parameters and unit by default. """ - test.startSection("verification of post treatment review parameters") - mouseClick(waitForObject(names.o_disposables_removal_backButton)) + test.startSection("verification of post treatment review parameters with Units") treatment_review_text = waitForObjectExists(post_treatment_review_text_obj(config.TREATMENT_REVIEW_TITLE_TEXT)) test.compare(treatment_review_text.text, config.TREATMENT_REVIEW_TITLE_TEXT, "{} screen is displayed".format(config.TREATMENT_REVIEW_TITLE_TEXT)) utils.waitForGUI(0.1) - for parameter in config.POST_TREATMENT_REVIEW_SCREEN_PARAMETERS: + for parameter in config.POST_TREATMENT_REVIEW_SCREEN_UNITS.keys(): utility.scroll_to_zone(review_text(parameter), names.o_review_area) parameter_text = waitForObjectExists(review_text(parameter)) test.log("verification of parameter -> " + str(parameter)) test.compare(parameter_text.text, parameter, "{} should be available under 'Treatment Review' screen".format(parameter)) - test.endSection() - - utility.scroll_to_zone(review_text(parameter), names.o_review_area, direction = "Top") - test.startSection("verification of post treatment review units") - - for parameter in config.POST_TREATMENT_REVIEW_SCREEN_PARAMETERS: unit = config.POST_TREATMENT_REVIEW_SCREEN_UNITS[parameter] unit_text = waitForObjectExists(review_text(unit)) test.log("verification of unit for data -> " + str(parameter)) - test.compare(unit_text.text, unit, "{} should be available under 'Treatment Review' screen".format(unit)) + test.compare(unit_text.text, unit, "{} should be available under 'Treatment Review' screen".format(unit)) test.endSection() @@ -278,8 +260,8 @@ def verify_post_treatment_review_log_data(): """ - Method to verify all the log values on review submode of post treatment - Here we are verifying 5 set of values to the review section based in edge condition. This section coveres log verification. + Method to verify all the log values on review submode of post treatment + Here we are verifying 5 set of values to the review section based in edge condition. This section coveres log verification. """ test.startSection("Method to check all the values of parameters in review screen") @@ -327,8 +309,7 @@ average_arterial_pressure = config.POST_TREATMENT_REVIEW_PARAMETER_RANGE["Average Arterial Pressure"][index], average_venous_pressure = config.POST_TREATMENT_REVIEW_PARAMETER_RANGE["Average Venous Pressure"][index] ) - - utils.waitForGUI(1) #adding delay for fetching effect. + utils.waitForGUI(1) test.startSection("verification of post treatment review values for iteration -> "+str(index+1)) test.log("###verification of post treatment UI data") @@ -395,7 +376,6 @@ test.log("###verification of values for parameter - >" + parameters_value + " from UI screen") parameter_set[index] = parameter_to_scroll test.compare(str(parameter_set[index]), str(parameter_text.text), "parameter value should be "+str(parameter_set[index])) - test.log("verification of post treatment log file data") parameter_value, parameter_unit = utility.verify_parameter_from_post_treatment_log(parameters_value) @@ -412,14 +392,12 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) - - #navigate to post treatment screens hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_POST.value, sub_mode=PostTreatmentStates.HD_POST_TREATMENT_PATIENT_DISCONNECTION_STATE.value) - verify_patient_disconnection_screens() + verify_treatment_review_screen() verify_disposables_screen() - verify_post_treatment_review_parameters() - verify_post_treatment_review_log_data() utils.tstDone() + +