Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r443e626c9bedcb9ab7b81e57cbb71a93513d45d4 -re8da75c7ba46f21fe99cc7400f3616a715c2ea5e --- shared/scripts/configuration/utility.py (.../utility.py) (revision 443e626c9bedcb9ab7b81e57cbb71a93513d45d4) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision e8da75c7ba46f21fe99cc7400f3616a715c2ea5e) @@ -76,43 +76,42 @@ "trying 100 times") -def verify_page_step_indicator(screen_obj, pre_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 + @param treatment_step : indicates the Current treatment step """ + test.startSection("verification of page step indicators") - for page in range(len(config.PRE_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.PRE_TREATMENT_SCREENS[page])) - - if page < pre_treatment_step: - test.log("To verify the step indicator of the completed pre-treatment screen " + config.PRE_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 == pre_treatment_step: - test.log("To verify the step indicators of the current pre-treatment screen " + config.PRE_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 pre-treatment screen " + config.PRE_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() def set_arterial_ranges_min_val(art_low): Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r860dba59c921a0ae5b6f1a17f42d053bf13b63e3 -re8da75c7ba46f21fe99cc7400f3616a715c2ea5e --- tst_create_custom_treatment/test.py (.../test.py) (revision 860dba59c921a0ae5b6f1a17f42d053bf13b63e3) +++ tst_create_custom_treatment/test.py (.../test.py) (revision e8da75c7ba46f21fe99cc7400f3616a715c2ea5e) @@ -613,15 +613,15 @@ utils.waitForGUI(0.3) test.log("Verification of page step indicator from patient id page") - utility.verify_page_step_indicator(names.o_PreTreatmentBase_gridSteps_Grid_1, PRE_TREATMENT_STEP) + utility.verify_page_step_indicator(screen_obj=names.o_PreTreatmentBase_gridSteps_Grid_1, treatment_step=PRE_TREATMENT_STEP, treatment_screens=config.PRE_TREATMENT_SCREENS) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), config.PATIENT_ID) test.compare(waitForObject(names.o_PreTreatmentBase_Patient_ID_Text).text, config.PATIENT_ID_TEXT, "Title text should be -> "+str(config.PATIENT_ID_TEXT)) mouseClick(waitForObject(names.o_confirm_button)) test.log("Verification of page step indicator from create custom treatment page") - utility.verify_page_step_indicator(names.o_PreTreatmentCreate_gridSteps_Grid, PRE_TREATMENT_STEP) + utility.verify_page_step_indicator(screen_obj=names.o_PreTreatmentCreate_gridSteps_Grid, treatment_step=PRE_TREATMENT_STEP, treatment_screens=config.PRE_TREATMENT_SCREENS) verify_create_custom_treatment_parameter()