Fisheye: Tag 4ff9b2fc13ff77fe1886036e39ab912aabc6026a refers to a dead (removed) revision in file `config.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 4ff9b2fc13ff77fe1886036e39ab912aabc6026a refers to a dead (removed) revision in file `envvars'. Fisheye: No comparison available. Pass `N' to diff? 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") Index: shared/scripts/names.py =================================================================== diff -u -r234ccf8d090d577de39369d3ff0f8455623ecfab -r0f8c72cdb9ebe10b644674e3d053f81911c867cb --- shared/scripts/names.py (.../names.py) (revision 234ccf8d090d577de39369d3ff0f8455623ecfab) +++ shared/scripts/names.py (.../names.py) (revision 0f8c72cdb9ebe10b644674e3d053f81911c867cb) @@ -62,11 +62,12 @@ o_pop_up_bp_title = {"container": o_treatmentStack_TreatmentStack, "text": "Blood Pressure", "type": "Text", "unnamed": 1, "visible": True} o_pop_up_bp_uom = {"container": o_treatmentStack_TreatmentStack, "text": "mmHg", "type": "Label", "unnamed": 1, "visible": True} o_pop_up_systolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} -o_pop_up_diasytolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} +o_pop_up_diastolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} o_pop_up_heart_rate_title = {"container": o_treatmentStack_TreatmentStack, "text": "Heart Rate", "type": "Text", "unnamed": 1, "visible": True} o_pop_up_heart_rate_uom = {"container": o_treatmentStack_TreatmentStack, "text": "BPM", "type": "Label", "unnamed": 1, "visible": True} o_pop_up_heart_rate_input_field = {"backgroundcolor": "#254670", "container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 3, "type": "TextInput", "unnamed": 1, "visible": True} o_keypad_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} +o_back_space_key = {"container": o_Gui_MainView, "gradient": 0, "id": "backspaceKeyBackground", "type": "Rectangle", "unnamed": 1, "visible": True} def vitals_reading_obj(reading): o_vitals_reading["text"] = reading Index: tst_main_treatment_vitals/test.py =================================================================== diff -u -r234ccf8d090d577de39369d3ff0f8455623ecfab -r0f8c72cdb9ebe10b644674e3d053f81911c867cb --- tst_main_treatment_vitals/test.py (.../test.py) (revision 234ccf8d090d577de39369d3ff0f8455623ecfab) +++ tst_main_treatment_vitals/test.py (.../test.py) (revision 0f8c72cdb9ebe10b644674e3d053f81911c867cb) @@ -33,9 +33,12 @@ DIASTOLIC_PRESSSURE_200 = "200" DIASTOLIC_PRESSSURE_175 = "175" DIASTOLIC_PRESSSURE_80 = "80" +DIASTOLIC_TEXT = "diastolic" +SYSTOLIC_TEXT = "systolic" +SYSTOLIC_LOWER_LIMIT = 60 +SYSTOLIC_UPPER_LIMIT = 250 - def open_vitals_pop_up(): """ Method to open the vitals pop up @@ -52,7 +55,40 @@ test.endSection() +# def verify_color_of_entry(entry, vital_parameter): +# +# if +def verify_systolic_value_in_pop_up(value): + """ + method to verify the entered systolic value + @param value: user entered systolic value + """ + test.startSection("Verify the user entered systolic value") + systolic = waitForObject(names.o_pop_up_systolic_input_field) + systolic_value = systolic.text.toUtf8().constData() + test.compare(systolic_value, value, + "Expected Systolic value: {value} ".format(value=value) + + "should be equal to Actual Systolic value: " + + "{actual_value}".format(actual_value=systolic_value)) + test.endSection() + +def verify_blood_pressure_range(systolic=None, in_range=None): + + if in_range: + if systolic is True: + systolic = waitForObject(names.o_pop_up_systolic_input_field) + mouseClick(systolic) + for value in range(SYSTOLIC_LOWER_LIMIT, SYSTOLIC_UPPER_LIMIT): + enter_keypad_value(entry=str(value), input_field=systolic) + verify_systolic_value_in_pop_up(value=value) + erase_entered_value(input_field=systolic) + + + + + + def main(): utils.tstStart(__file__) @@ -66,12 +102,14 @@ utils.waitForGUI(delay_s=3) open_vitals_pop_up() + test.log("Done") + verify_blood_pressure_range(systolic=True, in_range=True) - test.log("Done") + current_date_time = get_current_date_and_time() test.log(current_date_time)