Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r741e5fa12b6970490bd1ddecbed3e43494d4cd66 -r09c151304b448aecfed8a67c28800d161018641e --- shared/scripts/configuration/utility.py (.../utility.py) (revision 741e5fa12b6970490bd1ddecbed3e43494d4cd66) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -944,7 +944,70 @@ date = datetime.now(timezone.utc) return str(date.strftime(date_format)) + +def get_disinfect_bullet_object(id, screen_obj): + """ + To set a custom object based on item from parameters + @param screen_obj (String): provides the custom container for the object + @param id (String): provides the custom id for the object + @returns a real name object + """ + 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(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 screen_obj (Dict) : Parent objject of page step indicator. + @param treatment_id (List) : disinfection id's for disinfection types. + @param treatment_step (Int) : indicates the Current treatment step. + @param treatment_screens(List): Type of disinfection. + """ + 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], 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], screen_obj)) + #To verify the step indicators of the completed treatment screens + if page < treatment_step: + 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(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(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, screen_obj): + """ + To set a custom object based on item from parameters + @param screen_obj (String): provides the custom container for the object + @param text (String) : provides the custom text for the object + @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 + + def append_cloudsync_credentials_file(): """ This function is used for creating .pem files in the cloudsync folder.