Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r3f8003f8a5f8c61fba56c802c5a123d5340b9058 -r1d3192e66bed27fb83cc86d4468bc5bdcc79647a --- shared/scripts/configuration/utility.py (.../utility.py) (revision 3f8003f8a5f8c61fba56c802c5a123d5340b9058) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 1d3192e66bed27fb83cc86d4468bc5bdcc79647a) @@ -14,69 +14,73 @@ import math import squish +import object import sys +import names import test from dialin.common import MsgIds +from configuration import config from dialin.utils import * from dialin.protocols import DenaliMessage, DenaliCanMessenger, DenaliChannels from builtins import int as pyInt from datetime import datetime -def get_disinfect_bullet_object(): +def get_disinfect_bullet_object(id, screen_obj): """ To obtain a bullet object based on occurrence provided. @param screen_obj: provides the container on which the bullet must be present @param num: provides the occurrence value @returns a real name object """ - names.o_disinfect_dynamic_StepBullet["id"] = screen_obj + names.o_disinfect_dynamic_StepBullet["container"] = screen_obj + names.o_disinfect_dynamic_StepBullet["id"] = id return names.o_disinfect_dynamic_StepBullet -def verify_page_step_indicator_for_disinfect(treatment_id, treatment_step, treatment_screens): +def verify_page_step_indicator_for_disinfect(screen_obj, treatment_id, 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 treatment_step : indicates the Current treatment step """ test.startSection("verification of page step indicators") - for page in range(len(treatment_screens)): - bullet_children = object.children(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page]))) + for page in range(len(treatment_screens)): + bullet_children = object.children(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_disinfect_text_object(treatment_screens[page])) - + step_title = squish.waitForObjectExists(get_disinfect_text_object(treatment_screens[page], screen_obj)) #To verify the step indicators of the completed treatment screens if page < treatment_step: - test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).current) + test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).complete) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) 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_disinfect_bullet_object(screen_obj, page)).current) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete) + test.verify(squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).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) #To verify the step indicators of the remaining treatment screens else: - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).current,) - test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(screen_obj, page)).complete,) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).current) + test.verify(not squish.waitForObjectExists(get_disinfect_bullet_object(treatment_id[page], screen_obj)).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.endSection() -def get_disinfect_text_object(text): +def get_disinfect_text_object(text, screen_obj): """ To obtain a text object based on text provided @param screen_obj: provides the container on which the txt must be present @returns a real name object """ + names.o_disinfect_dynamic_StepBullet_Text["container"] = screen_obj names.o_disinfect_dynamic_StepBullet_Text["text"] = text return names.o_disinfect_dynamic_StepBullet_Text @@ -86,4 +90,3 @@ date = datetime.now() return str(date.strftime(date_format)) -