Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r234ccf8d090d577de39369d3ff0f8455623ecfab -r0f8c72cdb9ebe10b644674e3d053f81911c867cb --- shared/scripts/configuration/utility.py (.../utility.py) (revision 234ccf8d090d577de39369d3ff0f8455623ecfab) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 0f8c72cdb9ebe10b644674e3d053f81911c867cb) @@ -20,9 +20,11 @@ import squish from configuration import config +from dialin.ui import utils from builtins import int as pyInt from datetime import datetime from pytz import timezone +from squish import * def start_application(app_name): @@ -129,17 +131,33 @@ return str(date.strftime(date_format)) -def enter_keypad_value(entry): +def enter_keypad_value(entry, input_field): """ Method to enter user desired value using keypad """ test.startSection("Enter {entry}".format(entry=entry)) + input_field = waitForObject(input_field) for value in entry: - test.log("Entering {value}".fomar(value=value)) + test.log("Entering {value}".format(value=value)) value = builtins.int(value) - mouseClick(waitForObject(names.keypad_input(key_value=value))) + squish.mouseClick(waitForObject(names.keypad_input(key_value=value))) + utils.waitForGUI(1) test.endSection() + + +def erase_entered_value(input_field): + """ + Method to erase the entered value + """ + input_field = waitForObject(input_field) + entered_value = input_field.text.toUtf8().constData() + for value in entered_value: + squish.mouseClick(input_field) + utils.waitForGUI(1) + squish.mouseClick(waitForObject(names.o_back_space_key)) + + test.compare(entered_value, "", "Input field should be empty")