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)