Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rb38389f9f6ed5e603368e16902671b824d8c9202 -r0ace1db5298cbd423b8ac5194ffa3e3fda7963a4 --- shared/scripts/configuration/utility.py (.../utility.py) (revision b38389f9f6ed5e603368e16902671b824d8c9202) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 0ace1db5298cbd423b8ac5194ffa3e3fda7963a4) @@ -14,7 +14,6 @@ import builtins import names -import pytz import squish import sys import test @@ -81,9 +80,6 @@ date_format='%Y/%b/%d - %H:%M' date = datetime.now() - device_timezone=pytz.timezone('US/Pacific') - date = device_timezone.localize(date) - date = date.astimezone(device_timezone) return str(date.strftime(date_format)) @@ -93,10 +89,10 @@ value using keypad @param entry: (str) User expected value """ - test.startSection("Enter {}".format(entry)) + test.startSection("Entering {}".format(entry)) for value in entry: value = builtins.int(value) - key_val = squish.waitForObject(keypad_input(key_value=value)) + key_val = squish.waitForObject(keypad_input(value)) squish.mouseClick(key_val) utils.waitForGUI(1) test.endSection() @@ -109,12 +105,12 @@ """ test.startSection("Erasing value") input_field= squish.waitForObject(input_field) - entered_value = input_field.text.toUtf8().constData() + 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(input_field.text.toUtf8().constData(), "", "Input field should be empty") + test.compare(str(input_field.text), "", "Input field should be empty") test.endSection() def vitals_reading_obj(reading): Index: tst_main_treatment_vitals/test.py =================================================================== diff -u -rb38389f9f6ed5e603368e16902671b824d8c9202 -r0ace1db5298cbd423b8ac5194ffa3e3fda7963a4 --- tst_main_treatment_vitals/test.py (.../test.py) (revision b38389f9f6ed5e603368e16902671b824d8c9202) +++ tst_main_treatment_vitals/test.py (.../test.py) (revision 0ace1db5298cbd423b8ac5194ffa3e3fda7963a4) @@ -52,19 +52,19 @@ test.log("Verifying the 'Vitals' pop up is displayed") if object.exists(names.o_vitals_pop_up_title): vitals_pop_up_title = waitForObject(names.o_vitals_pop_up_title) - vitals_pop_up_title = vitals_pop_up_title.text.toUtf8().constData() + vitals_pop_up_title = str(vitals_pop_up_title.text) test.compare(vitals_pop_up_title, VITALS_TITLE,"Vitals title text is displayed") bp_title = waitForObject(names.o_pop_up_bp_title) - bp_title = bp_title.text.toUtf8().constData() + bp_title = str(bp_title.text) test.compare(bp_title, BLOOD_PRESSURE_TITLE,"Blood pressure title text is displayed") bp_uom = waitForObject(names.o_bp_uom) - bp_uom = bp_uom.text.toUtf8().constData() + bp_uom = str(bp_uom.text) test.compare(bp_uom, BLOOD_PRESSURE_UNIT,"Blood pressure unit should be {}".format(BLOOD_PRESSURE_UNIT)) heart_rate_title = waitForObject(names.o_pop_up_heart_rate_title) - heart_rate_title = heart_rate_title.text.toUtf8().constData() + heart_rate_title = str(heart_rate_title.text) test.compare(heart_rate_title, HEART_RATE_TITLE,"Heart rate title text is displayed") hr_uom = waitForObject(names.o_hr_uom) - hr_uom = hr_uom.text.toUtf8().constData() + hr_uom = str(hr_uom.text) test.compare(hr_uom, HEART_RATE_UNIT,"Heart Rate unit should be {}".format(HEART_RATE_UNIT)) test.endSection() @@ -106,7 +106,7 @@ test.startSection("Verify the last read of blood pressure and heart rate") expected_last_read = "Interval: 30min , Last Read: {}".format(saved_time) last_read = waitForObject(vitals_reading_obj(expected_last_read)) - last_read = last_read.text.toUtf8().constData() + last_read = str(last_read.text) test.compare(last_read, expected_last_read, "Last read time should be {}".format(last_read)) test.endSection() @@ -121,9 +121,9 @@ test.startSection("Verify the user entered {} value {} in main-treatment screen".format(vital, value)) if save: input_field = waitForObject(vitals_reading_obj(value)) - entered_value = input_field.text.toUtf8().constData() + entered_value = input_field.text value = str(value) - test.compare(entered_value, value, + test.compare(str(entered_value), value, "Expected {} value: {} should be equal to Actual {} value: {}".format(vital, value, vital, entered_value)) elif (save is False): if object.exists(vitals_reading_obj(value)) is False: @@ -134,14 +134,14 @@ def verify_entered_value_in_pop_up(value, input_field, vital): """ - method to verify the user entered value + Method to verify the user entered value @param value - (int) user entered value @param vital - (str) parameter name under which user is entering value (sys/dia/heart rate) @param input_field - (obj) object of input field """ test.startSection("Verify the user entered {} value {}".format(vital, value)) input_field = waitForObject(input_field) - entered_value = input_field.text.toUtf8().constData() + entered_value = str(input_field.text) test.compare(entered_value, value, "Actual {} value: {} should be equal to Expected {} value: {}".format(vital, entered_value, vital, value)) test.endSection()