Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -re2c906a7b5fde31d48d168f097fe6a5a2ab0afea -r7b9f32ef9f4913714edca4cafdcbfa1503c16416 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision e2c906a7b5fde31d48d168f097fe6a5a2ab0afea) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 7b9f32ef9f4913714edca4cafdcbfa1503c16416) @@ -1,5 +1,6 @@ import squish import test +from datetime import datetime def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -12,3 +13,11 @@ except LookupError: test.fail("ERROR : " + error_message) return None + +def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): + date = datetime.now() + return str(date.strftime(date_format)) + +def vitals_reading_obj(reading): + names.o_vitals_reading["text"] = reading + return names.o_vitals_reading Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -re2c906a7b5fde31d48d168f097fe6a5a2ab0afea -r7b9f32ef9f4913714edca4cafdcbfa1503c16416 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision e2c906a7b5fde31d48d168f097fe6a5a2ab0afea) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 7b9f32ef9f4913714edca4cafdcbfa1503c16416) @@ -2,7 +2,7 @@ from objectmaphelper import * -AUT_NAME ="leahi" +AUT_NAME = "leahi -k -K -S -q" # Top Parents o_Gui_MainView = { "type": "Gui::MainView", "unnamed": 1 } @@ -58,5 +58,38 @@ o_ExportLogsNotificationBar = {"container": o_SettingsExportLogs, "id": "_information", "type": "NotificationBarSmall" } o_DeviceSettingsGrid = {"container": o_SettingsHome, "id": "_grid", "type": "Grid", } - - +#patient vitals +o_option_combo_box = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_PreTreatmentCreateStack_PreTreatmentCreateStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentCreateStack","type": "PreTreatmentCreateStack", } +o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", } +o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_durationControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_durationControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinStopTimeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateTemperatureControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_salineBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox= {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bicarbonateConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_createTreatmentRect_TouchRect = {"container": o_standByScreen_MainHome, "id": "_createTreatmentRect", "type": "TouchRect", "unnamed": 1 } +o_PreTreatment_vitalsCombobox_BaseCombobox = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatmentButtom = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_confirmButton", "type": "ConfirmButton" } +o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_acidConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialyzerTypeComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_vitalsButton_VitalsButton = {"container": o_Gui_MainView, "id": "_vitalsButton", "type": "VitalsButton", "unnamed": 1 } +o_bloodPressureSystolic_TextEntry = {"container": o_Overlay, "id": "_bloodPressureSystolic", "type": "TextEntry", "unnamed": 1 } +o_bloodPressureDiastolic_TextEntry = {"container": o_Overlay, "id": "_bloodPressureDiastolic", "type": "TextEntry", "unnamed": 1 } +o_title_Text = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_heartRate_TextEntry = {"container": o_Overlay, "id": "_heartRate", "type": "TextEntry", "unnamed": 1 } +o_confirm_button = {"container": o_Overlay, "id": "_confirmButton", "type": "ConfirmButton", "unnamed": 1 } +o_treatmentHome_bloodPressure_LabelValue = {"container": mainTreatmentScreen, "id": "_bloodPressure", "type": "LabelValue", "unnamed": 1 } +o_treatmentHome_editButton_IconButton = {"container": mainTreatmentScreen, "id": "_editButton", "type": "IconButton", "unnamed": 1,"visible": True } +o_vitals_Interval_TitleText = {"container": o_Overlay, "type": "TitleText", "unnamed": 1 } +o_vitals_Interval_BaseComboBox = {"container": o_Overlay, "id": "_bpMeasurementIntervalControl", "type": "BaseComboBox", "unnamed": 1 } +o_treatmentHome_heartBeat_LabelValue = {"container": mainTreatmentScreen, "id": "_heartBeat", "type": "LabelValue", "unnamed": 1 } +o_vitals_close_btn = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1 } +o_back_space_key = {"container": o_Overlay, "source": "qrc:/images/iBackspace", "type": "Image", "unnamed": 1 } +o_PatientIDEntry_TextEntry = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_pretreatmentPatientIDEntry", "type": "TextEntry", "unnamed": 1 } +o_vitalCountdown_Text = {"container": o_Gui_MainView, "objectName": "_vitalCountdown", "type": "Text" } +o_vitals_reading = {"container": mainTreatmentScreen, "type": "Text", "unnamed": 1 } +keyboard_input = {"container": o_Overlay, "type": "Text", "unnamed": 1, } \ No newline at end of file Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u --- suite_leahi/tst_patient_vitals/test.py (revision 0) +++ suite_leahi/tst_patient_vitals/test.py (revision 7b9f32ef9f4913714edca4cafdcbfa1503c16416) @@ -0,0 +1,434 @@ +# Subject/Title: LDT -2280 Patient Vitals - SW - 02 - Q&R - 15: SIT - Software Integration Tests - Squish Qt +# +# Functionalities: Testing all functionalities of Patient Vitals in the main treatment screen +# +# Steps: +# 1 Patient Vitals: +# - Verify the Systolic minimum,mid and maximum values in Vital Popup +# - Verify the Diastolic minimum ,mid and maximum values in Vital Popup +# - Verify the Heart Rate minimum,mid and maximum values in Vital Popup +# - Verify the time intervals in the vital interval Popup +# - Verify the vitals popup is opened automatically once the BPM interval time is elapsed when the rejection reason is 1 +# - Verify the confirm button is disabled when user enters out of range values in the systolic, diastolic and heart rate parameters +# - Verify the vitals interval time with current system time + +import names +import time +import builtins +from leahi_dialin.ui import utils +from configuration import utility +from leahi_dialin.ui.td_messaging import TD_Messaging +from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates +from datetime import datetime +import squish + +td =TD_Messaging() + +ACID_CONCENTRATE = ["1.0 K, 2.50 Ca, 1 Mg","2.0 K, 2.50 Ca, 1 Mg","3.0 K, 2.50 Ca, 1 Mg"] +DIALYZER_TYPE = ["Diacap Pro 13H","Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] +VITALS = ["OFF","5","10","15","20","30","60"] +BICARBONATE = ["Sodium Bicarbonate"] + +SYSTOLIC = "Systolic" +DIASTOLIC = "Diastolic" +HEARTRATE = "Heart Rate" + +MIN_SYSTOLIC = "60" +MIN_DIASTOLIC = "40" +MIN_HEARTRATE = "40" + +MAX_SYSTOLIC = "250" +MAX_DIASTOLIC = "200" +MAX_HEARTRATE = "180" + +SYSTOLIC_251 = "251" +DIASTOLIC_201 = "201" +HEARTRATE_181 = "181" + +VISIBLE = True + + + +def findObjectById(parent, id): + """ + Recursively searches for a child object by its id. + Returns the found object or None if not found. + """ + if str(parent.id) == id: + return parent + + for child in object.children(parent): + found = findObjectById(child, id) + if found: + return found + + return None + +def set_value_based_on_target(obj, target_value): + """ + obj: dictionary containing object paths + Example: + { + "value_obj": ":mainTreatmentScreen.PressureText", + "left_arrow": ":mainTreatmentScreen.LeftArrow", + "right_arrow": ":mainTreatmentScreen.RightArrow" + } + + target_value: integer or string number, e.g. 220 + """ + target_value = target_value + + # Wait for all objects + parent_obj = waitForObjectExists(obj) + + # change range as per your screen count + left_arrow = findObjectById(parent_obj, "_leftArrow") + right_arrow =findObjectById(parent_obj, "_rightArrow") + + # Read current value (supports invisible text too) + try: + current_value = round(float(findObject(obj).value),1) + except LookupError: + current_value = float(findObject(obj).property("value")) + + # Determine direction + while current_value != float(target_value): + if current_value < float(target_value): + mouseClick(waitForObject(right_arrow)) + + elif current_value > float(target_value): + mouseClick(waitForObject(left_arrow)) + + # Update current value after click + try: + current_value = round(float(findObject(obj).value),1) + except Exception: + current_value = float(findObject(obj).property("value")) + + test.log(f"Updated value: {current_value}") + test.log(f"✅Target value reached: {current_value}") + +def custom_object_for_combo_box(text): + """ + Method to set custom object property for export option + @param text : (string) parameter text + """ + names.o_option_combo_box["text"] = text + return names.o_option_combo_box + +def select_different_dropdown(object,type,whichTypeIndex): + type_combo_box = utility.get_object_from_names(object, error_message="Combo box object is missing") + if type_combo_box is not None: + mouseClick(waitForObjectExists(object)) + + type_option = utility.get_object_from_names(custom_object_for_combo_box(type[whichTypeIndex]), + error_message=f"Option {type[whichTypeIndex]} object is missing",timeout_ms=5000) + if type_option is not None: + mouseClick(waitForObject(type_option)) + return True + return False # default return if not successful + +def verify_create_treatment_parameters(): + test.startSection("Pre treatment parameters") + mouseClick(waitForObject(names.o_PatientIDEntry_TextEntry)) + waitForObject(names.o_PatientIDEntry_TextEntry).text ="abcd" + set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 90) + set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, 100) + set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 105) + set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) + set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.5) + set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 105) + select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,2) + set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,37.0) + select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,2) + set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 100) + select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,VITALS,2) + select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) + mouseClick(waitForObject(names.o_PreTreatmentButtom)) + td.td_Treatment_Parameters_Validation( vAccepted = 1, + vBloodFlowRateRejectReason = 0, + vDialysateFlowRateRejectReason = 0, + vTreatmentDurationRejectReason = 0, + vSalineBolusVolumeRejectReason = 0, + vHeparinStopTimeRejectReason = 0, + vHeparinTypeRejectReason = 0, + vAcidConcentrateRejectReason = 0, + vBicarbonateConcentrateRejectReason = 0, + vDialyzerTypeRejectReason = 0, + vBloodPressureMeasureIntervalRejectReason = 0, + vRinsebackFlowRateRejectReason = 0, + vRinsebackVolumeRejectReason = 0, + vArterialPressureLimitWindowRejectReason = 0, + vVenousPressureLimitWindowRejectReason = 0, + vVenousPressureLimitAsymtrcRejectReason = 0, + vTrancembrncPressureLimitWindowRejectReason = 0, + vDialysateTempRejectReason = 0, + vHeparinDispensingRateRejectReason = 0, + vHeparinBolusVolumeRejectReason = 0 + ) + + confirmButton = waitForObject(names.o_PreTreatmentButtom) + mouseClick(waitForObject(confirmButton)) + td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) + test.endSection() + +def get_title_text_obj(text): + names.o_title_Text["text"] = text + return names.o_title_Text + +def keyboard_object_map_helper(text): + """ + Method for setting custom object property's for keyboard keys + @return: required object property's for keys + """ + if text is not None: + names.keyboard_input["text"] = text + return names.keyboard_input + else: + test.log("Invalid ",text," for object.") + names.o_keyboard_input["text"] = "Q" + +def verify_valid_vitals_through_keypad(title_name,input_field_obj,expected_value, actual_value): + """ + Tests verifies valid patient id set through application keyboard setup . + @return: N/A + """ + input_field = waitForObject(input_field_obj) + mouseClick(input_field) + + #check the title + title = waitForObjectExists(get_title_text_obj(title_name)) + test.compare(title_name, title.text, "Title text should be -> "+ str(title_name)) + + for text in expected_value: + keyboard_value = keyboard_object_map_helper(text) + utils.waitForGUI(0.6) + mouseClick(waitForObjectExists(keyboard_value)) + utils.waitForGUI(0.6) + + test.compare(actual_value, (input_field.text), "Value should be -> "+ str(actual_value)) + test.log("User successfully authenticated through patient id -> " + expected_value + "using keypad.") + +def custom_object_for_combo_box(text): + """ + Method to set custom object property for export option + @param text : (string) parameter text + """ + names.o_option_combo_box["text"] = text + return names.o_option_combo_box + +def verify_vitals_pop_up_is_opened_automatically_after_an_interval(interval): + """ + Method to verify the vitals pop up + is opened automatically once the + BPM interval time is elapsed + @param interval - (int) interval in min + """ + test.startSection("Verify the vitals pop up opened automatically after interval time is elapsed") + sec = interval*60 + start_time = time.time() + sec_count = 0 + while not(object.exists(names.o_vitals_close_btn)): + utils.waitForGUI(1) + sec_count += 1 + end_time = time.time() + if sec_count in range(295, 301): + test.log("Dialog close button be visible after {}".format(sec)) + close_btn = waitForObject(names.o_vitals_close_btn) + total_elapsed_time = end_time - start_time + test.log("Total elapsed time : {}".format(total_elapsed_time)) + test.compare(close_btn.visible, VISIBLE, "Popup close option is visible after the vitals pop up is opened automatically") + 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) + if len(entered_value) != 0: + for value in range(len(entered_value)+1): + utils.waitForGUI(0.1) + squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + + test.compare(str(input_field.text), "", "Input field should be empty") + test.endSection() + +def clear_BP_and_HR_settings(): + #clearing systolic field + #Add start section and end section + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + systolic = waitForObject(names.o_bloodPressureSystolic_TextEntry) + mouseClick(systolic) + erase_entered_value(input_field=systolic) + + #clear diastolic field + diastolic = waitForObject(names.o_bloodPressureDiastolic_TextEntry) + mouseClick(diastolic) + erase_entered_value(diastolic) + + #Clearing HR field + hr = waitForObject(names.o_heartRate_TextEntry) + mouseClick(hr) + erase_entered_value(hr) + +def verify_entered_patient_vitals_in_maintreatment_screen(): + """ + Method to verify BP/HR section from patient vitals. + """ + test.startSection("verification of BP/HR section from patient vitals") + test.log("Clearing all fields") + clear_BP_and_HR_settings() + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,"185","185") #Mid values + verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,"140","140") + verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, "130", "130") + mouseClick(waitForObject(names.o_confirm_button)) + test.endSection() + +def verify_interval_for_bpm(): + """ + Method to check the popup is opened automatically after time interval + """ + test.startSection("Verify popup is opened automatically after time interval") + verify_entered_patient_vitals_in_maintreatment_screen() + td.td_vitals_adjustment_response(vRejectionReason=1) + utils.waitForGUI(1) + verify_vitals_pop_up_is_opened_automatically_after_an_interval(interval=10) + + test.endSection() + +def validate_time_interval(vital_interval_obj, int_min): + """ + vm_time_obj: Object name/path that displays VM time (HH:MM) + vitals interval_obj: Object name/path that displays remaining time (MM:SS) + interval_minutes: Integer (ex: 5, 10, 15 ...) + """ + vm_time_str = str(utility.get_current_date_and_time(date_format='%H:%M:%S')).strip() + + try: + hh, mm, ss = vm_time_str.split(":") + print(f"current time: {vm_time_str}") + except Exception as e: + test.fail(f"Invalid VM time format: {vm_time_str}, error={e}") + + # Compute interval start time + # Example: interval=5, vm=09:01 -> start = 09:05 - 5 = 09:00 + interval_seconds =int_min *60 + + # Expected remaining seconds + elapsed =(builtins.int(mm) * 60)% interval_seconds + builtins.int(ss) + remaining_seconds = interval_seconds - elapsed + + # If negative, clamp to zero + if remaining_seconds < 0: + remaining_seconds = 0 + + # Convert to MM:SS + expected_mm = remaining_seconds // 60 + expected_ss = remaining_seconds % 60 + expected_str = f"{expected_mm:02d}:{expected_ss:02d}" + + #Read UI displayed remaining time (MM:SS) + ui_str = str(waitForObject(vital_interval_obj).text).strip() + fmt = "%M:%S" + expected_time = datetime.strptime(expected_str, fmt) + actual_time = datetime.strptime(ui_str, fmt) + diff = abs((actual_time - expected_time).total_seconds()) + + if diff <= 1: + test.log(f"Remaining time is correct: {ui_str}") + else: + test.fail(f"Remaining time incorrect. Expected {expected_str}, got {ui_str}") + + +def main(): + utils.tstStart(__file__) + startApplication(names.AUT_NAME) + + td.td_operation_mode(TDOpModes.MODE_STAN.value) + + # verify Standby screen + test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") + mouseClick(waitForObject(names.o_createTreatmentRect_TouchRect)) + td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) + test.startSection("Create the pretreatment values") + verify_create_treatment_parameters() + test.endSection() + test.startSection("Check the vitals in main treatment screen") + td.td_operation_mode(TDOpModes.MODE_TREA.value, 0) + td.td_tx_state(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value , + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0) + utils.waitForGUI(2) + validate_time_interval(names.o_vitalCountdown_Text,10) + test.endSection() + + test.startSection("Verify the minimum values in the vitals popup") + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,MIN_SYSTOLIC,MIN_SYSTOLIC) + verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,MIN_DIASTOLIC,MIN_DIASTOLIC) + verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, MIN_HEARTRATE, MIN_HEARTRATE) + mouseClick(waitForObject(names.o_confirm_button)) + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText + test.compare(MIN_SYSTOLIC+"/"+MIN_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(MIN_SYSTOLIC+"/"+MIN_DIASTOLIC)) + heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText + test.compare(MIN_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(MIN_HEARTRATE)) + test.endSection() + + test.startSection("Verify the maximum values in the vitals popup") + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,MAX_SYSTOLIC,MAX_SYSTOLIC) + verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,MAX_DIASTOLIC,MAX_DIASTOLIC) + verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, MAX_HEARTRATE, MAX_HEARTRATE) + mouseClick(waitForObject(names.o_confirm_button)) + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText + test.compare(MAX_SYSTOLIC+"/"+MAX_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(MAX_SYSTOLIC+"/"+MAX_DIASTOLIC)) + heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText + test.compare(MAX_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(MAX_HEARTRATE)) + test.endSection() + + test.startSection("Verify the confirm button is disabled when user enter invalid values") + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,SYSTOLIC_251,SYSTOLIC_251) + verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,DIASTOLIC_201,DIASTOLIC_201) + verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, HEARTRATE_181, HEARTRATE_181) + confirm_button =waitForObjectExists(names.o_confirm_button) + test.verify(not confirm_button.enabled, "Confirm button is not enabled") + mouseClick(waitForObject(names.o_vitals_close_btn)) + test.endSection() + + test.startSection("Verify the vitals interval popup") + mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) + #check the title text in the popup + vitals_titleText = waitForObjectExists(names.o_vitals_Interval_TitleText).text + test.compare("Vitals Interval", vitals_titleText, "Vitals Interval popup text should be ->"+str("Vitals Interval")) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,0) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,1) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[1], "Vitals interval value should be :"+str(VITALS[1])) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,2) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[2], "Vitals interval value should be :"+str(VITALS[2])) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,3) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[3], "Vitals interval value should be :"+str(VITALS[3])) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,4) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[4], "Vitals interval value should be :"+str(VITALS[4])) + select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,5) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[5], "Vitals interval value should be :"+str(VITALS[5])) + mouseClick(waitForObject(names.o_vitals_close_btn)) + test.endSection() + + test.startSection("Verify the vitals pop up opened automatically after interval time is elapsed") + verify_interval_for_bpm() + test.endSection() + + + \ No newline at end of file