Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r75b5f2a93fc13f944d268961901be981dec4bfbe -r956fd22d63adc5ebecc6320221df8a60ce069a4a --- shared/scripts/configuration/utility.py (.../utility.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 956fd22d63adc5ebecc6320221df8a60ce069a4a) @@ -114,16 +114,16 @@ 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] + Method to verify the Page Step indicators 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 + @param pre_treatment_items_object :(dictionary) pre_treatment bullet object @return N/A """ 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_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name step_title = bullet_children[2] #To verify the step indicators of the completed pre treatment screens @@ -152,78 +152,38 @@ test.endSection() - - - - - - - - - - - - - - - - - - -############################################################################## -from configuration import config -from dialin.ui import utils -from builtins import int as pyInt -from datetime import datetime - -def get_current_date_and_time(): - - date_format='%Y/%b/%d - %H:%M' - date = datetime.now() - return str(date.strftime(date_format)) - - -def enter_keypad_value(entry): +def training_screen_indicator_verification(current_indicator, training_items_object): """ - Method to enter user desired - value using keypad - @param entry: (str) User expected value + Method to verify the pre treatment tutorial indicators on top of the screen which indicates the steps passed, current, remained] + @param current_indicator :(int) Current pre-treatment tutorial indicator + @param training_items_object :(dictionary) pre_treatment bullet object + @return N/A """ - test.startSection("Entering {}".format(entry)) - for value in entry: - value = pyInt(value) - key_val = squish.waitForObject(keypad_input(value)) - squish.mouseClick(key_val) - utils.waitForGUI(1) - test.endSection() + test.startSection("Method to verify the Page Step indicators from patient connection section") + for page in range(config.TRAINING_INDICATOR_SCREEN): + occurrence_index = 10 + page #1-9 occurrence of object belongs to page indicators, 10 - 13 occurrence of object belongs to training indicators + training_items_object["occurrence"] = occurrence_index + bullet_children = object.children(squish.waitForObject(training_items_object)) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + #To verify the step indicators of pre treatment tutorial screens + if page < current_indicator: + test.verify(squish.waitForObjectExists(training_items_object).complete, "bullet indicator {index} should be in complete state".format(index=current_indicator)) + test.verify(not squish.waitForObjectExists(training_items_object).current, "bullet indicator {index} current attribute should be unchecked".format(index=current_indicator)) + test.compare(bullet_circle_color, config.COMPLETE_COLOR, " bullet color hex should be "+str(config.COMPLETE_COLOR)) + test.compare(bullet_border_color, config.COMPLETE_COLOR, " bullet border color hex should be "+str(config.COMPLETE_COLOR)) + #To verify the step indicators of pre treatment tutorial screen + elif page == current_indicator: + test.verify(squish.waitForObjectExists(training_items_object).current, "bullet indicator {index} should be in complete state".format(index=current_indicator)) + test.verify(not squish.waitForObjectExists(training_items_object).complete, "bullet indicator {index} current attribute should be unchecked".format(index=current_indicator)) + test.compare(bullet_circle_color,config.COMPLETE_COLOR, "bullet color hex should be "+str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.COMPLETE_COLOR, "bullet border color hex should be "+str(config.COMPLETE_COLOR)) + #To verify the step indicators of pre-treatment tutorial screens + else: + test.verify(not squish.waitForObjectExists(training_items_object).current, "bullet indicator {index} should not be complete state".format(index=current_indicator)) + test.verify(not squish.waitForObjectExists(training_items_object).complete, "bullet indicator {index} current attribute should be unchecked".format(index=current_indicator)) + test.compare(bullet_circle_color,config.CURRENT_COLOR, "bullet circle color hex should be "+str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR, "bullet border color hex should be "+str(config.INCOMPLETE_COLOR)) - -def erase_entered_value(input_field): - """ - Method to erase the entered value - @param input_field - (obj) object of input field - """ - test.startSection("Erasing value") - input_field= squish.waitForObject(input_field) - entered_value = str(input_field.text) - for value in entered_value: - utils.waitForGUI(1) - squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) - - test.compare(str(input_field.text), "", "Input field should be empty") test.endSection() - -def vitals_reading_obj(reading): - names.o_vitals_reading["text"] = reading - return names.o_vitals_reading -def keypad_input(key_value): - names.o_keypad_input["text"] = key_value - return names.o_keypad_input - - - - - - -