Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 -r98f13c9198e630726f86fa3288e452554d3b2cf5 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 98f13c9198e630726f86fa3288e452554d3b2cf5) @@ -112,39 +112,41 @@ "trying 100 times") - def page_step_indicator_verification(pre_treatment_step, pre_treatment_items_object): """ 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 :(int) indicates the Current pre-treatment step @param pre_treatment_items_object :(dictionary) pre_treatment @return N/A """ - for page in range(len(config.PRE_TREATMENT_SCREENS)): - bullet_children = object.children(squish.waitForObjectExists(pre_treatment_items_object)) + test.startSection("Method to verify the Page Step indicators from patient connection section") + for page in range(1, len(config.PRE_TREATMENT_SCREENS)): + pre_treatment_items_object["occurrence"] = page + bullet_children = object.children(squish.waitForObject(pre_treatment_items_object)) bullet_circle_color = bullet_children[0].color.name #waitForObjectExsits need to be checked. bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(names.text_object(config.PRE_TREATMENT_SCREENS[page])) + step_title = bullet_children[2] #To verify the step indicators of the completed pre treatment screens if page < pre_treatment_step: - test.verify(squish.waitForObjectExists(names.bullet_object(page)).complete) - test.verify(not squish.waitForObjectExists(names.bullet_object(page)).current) - test.compare(bullet_circle_color, config.COMPLETE_COLOR) - test.compare(bullet_border_color,config.COMPLETE_COLOR) #config.PRETREATMENT_INDICATOR[1] - test.compare(step_title.color.name,config.ENABLED_COLOR) + test.verify(squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" complete attribute should be True")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" current attribute should be false")) + test.compare(bullet_circle_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(bullet_border_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(step_title.color.name, config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" title color hex should be "+str(config.ENABLED_COLOR))) #To verify the step indicators of the current pre treatment screen elif page == pre_treatment_step: - test.verify(squish.waitForObjectExists(names.bullet_object(page)).current,) - test.verify(not squish.waitForObjectExists(names.bullet_object(page)).complete) - 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) + test.verify(squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" complete attribute should be True")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" current attribute should be false")) + test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet color hex should be "+str(config.CURRENT_COLOR))) + test.compare(bullet_border_color,config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(step_title.color.name,config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" title color hex should be "+str(config.ENABLED_COLOR))) + test.verify(step_title.font.bold, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" title font bold should be "+str(config.ENABLED_COLOR))) #To verify the step indicators of the remaining pre-treatment screens else: - test.verify(not squish.waitForObjectExists(names.bullet_object(page)).current,) - test.verify(not squish.waitForObjectExists(names.bullet_object(page)).complete,) - 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.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" complete attribute should be false")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" current attribute should be false")) + test.compare(step_title.color.name,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" title color hex should be "+str(config.INCOMPLETE_COLOR))) + test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet circle color hex should be "+str(config.CURRENT_COLOR))) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[pre_treatment_step]+" bullet border color hex should be "+str(config.INCOMPLETE_COLOR))) + + test.endSection()