Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7882eef58dfd3755ab3a6f2709a6e81f8662a0a2 -r75b5f2a93fc13f944d268961901be981dec4bfbe --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7882eef58dfd3755ab3a6f2709a6e81f8662a0a2) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 75b5f2a93fc13f944d268961901be981dec4bfbe) @@ -150,3 +150,80 @@ test.compare(bullet_border_color,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.INCOMPLETE_COLOR))) 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): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + 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() + + +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 + + + + + + +