Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rffa29812cc49397be901378d94e5ac7dadd24d0c -ref6b58164d66c831ffaba8b71c57472cffac6c55 --- shared/scripts/configuration/utility.py (.../utility.py) (revision ffa29812cc49397be901378d94e5ac7dadd24d0c) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision ef6b58164d66c831ffaba8b71c57472cffac6c55) @@ -192,43 +192,42 @@ squish.testSettings.objectNotFoundDebugging = True -def verify_page_step_indicator_post_treatment(screen_obj, post_treatment_step): +def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): """ - Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] - @param pre_treatment_step : indicates the Current pre-treatment step + Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] + @param treatment_step : indicates the Current treatment step """ + test.startSection("verification of page step indicators") - for page in range(len(config.POST_TREATMENT_SCREENS)): + for page in range(len(treatment_screens)): bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.POST_TREATMENT_SCREENS[page])) - - if page < post_treatment_step: - test.log("To verify the step indicator of the completed post-treatment screen " + config.POST_TREATMENT_SCREENS[page]) + step_title = squish.waitForObjectExists(get_text_object(screen_obj, treatment_screens[page])) + + #To verify the step indicators of the completed treatment screens + if page < treatment_step: test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) - test.compare(bullet_circle_color, config.COMPLETE_COLOR, " the bullet color must be " + str(config.COMPLETE_COLOR)) - test.compare(bullet_border_color, config.COMPLETE_COLOR," the bullet border color must be " + str(config.COMPLETE_COLOR)) - test.compare(step_title.color.name, config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) - - elif page == post_treatment_step: - test.log("To verify the step indicators of the current post-treatment screen " + config.POST_TREATMENT_SCREENS[page]) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(step_title.color.name,config.ENABLED_COLOR) + #To verify the step indicators of the current treatment screen + elif page == treatment_step: test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) - test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) - test.compare(bullet_border_color,config.COMPLETE_COLOR, " the bullet border color must be " + str(config.COMPLETE_COLOR)) - test.compare(step_title.color.name,config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) - test.verify(step_title.font.bold, " the current text must be in bold") - + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.COMPLETE_COLOR) + test.compare(step_title.color.name, config.ENABLED_COLOR) + test.verify(step_title.font.bold) + #To verify the step indicators of the remaining treatment screens else: - test.log("To verify the step indicators of the remaining post-treatment screen " + config.POST_TREATMENT_SCREENS[page]) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) - test.compare(step_title.color.name,config.INCOMPLETE_COLOR, " the text color must be " + str(config.INCOMPLETE_COLOR)) - test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) - test.compare(bullet_border_color,config.INCOMPLETE_COLOR, " the bullet border color must be " + str(config.INCOMPLETE_COLOR)) - test.endSection() + test.compare(step_title.color.name, config.INCOMPLETE_COLOR) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.INCOMPLETE_COLOR) + test.endSection() Index: tst_post_treatment/test.py =================================================================== diff -u -rffa29812cc49397be901378d94e5ac7dadd24d0c -ref6b58164d66c831ffaba8b71c57472cffac6c55 --- tst_post_treatment/test.py (.../test.py) (revision ffa29812cc49397be901378d94e5ac7dadd24d0c) +++ tst_post_treatment/test.py (.../test.py) (revision ef6b58164d66c831ffaba8b71c57472cffac6c55) @@ -40,6 +40,7 @@ NUM_OF_DISPOSABLE_INSTALLATION_SCREENS = 7 DISPOSABLES_STEP = 2 PATIENT_DISCONNECTION_STEP = 0 +REVIEW_TREATMENT_STEP = 1 rightarrow_obj_names = [names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase] leftarrow_obj_names = [names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase] @@ -187,7 +188,7 @@ Method to verify parameters under 'Patient Disconnection Screens' """ test.startSection("verifying Patient Disconnection screen") - utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ1, PATIENT_DISCONNECTION_STEP) + utility.verify_page_step_indicator(SCREEN_OBJ1, PATIENT_DISCONNECTION_STEP, config.POST_TREATMENT_SCREENS) verify_right_instruction_navigation_patient_disconnection(NUM_OF_PATIENT_DISCONNECTION_SCREENS) verify_left_instruction_navigation_patient_disconnection(NUM_OF_PATIENT_DISCONNECTION_SCREENS) verify_right_instruction_navigation_patient_disconnection(NUM_OF_PATIENT_DISCONNECTION_SCREENS) @@ -202,7 +203,7 @@ Method to verify parameters under 'Treatment Review Screens' """ test.startSection("Verifying Treatment Review Screen") - utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ2,1) + utility.verify_page_step_indicator(SCREEN_OBJ2, REVIEW_TREATMENT_STEP, config.POST_TREATMENT_SCREENS) 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)) @@ -218,7 +219,11 @@ Method to verify parameters under 'Disposables screens' """ test.startSection("verification of Disposable Screen") - utility.verify_page_step_indicator_post_treatment(SCREEN_OBJ3, DISPOSABLES_STEP) + utils.waitForGUI(0.3) #Delay given for screen navigation + mouseClick(waitForObjectExists(names.o_disposablesRemovalConfirm_BACK_Text)) + utils.waitForGUI(0.3) #Delay given for screen navigation + mouseClick(waitForObject(names.o_treatment_review_next_button)) + utility.verify_page_step_indicator(SCREEN_OBJ3, DISPOSABLES_STEP, config.POST_TREATMENT_SCREENS) 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")