Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r3240e0c4aa8e9c80663df4e810734c73813d15d7 -r3668d4a9747b75c20be05a1245edb041cb91cc4b --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 3240e0c4aa8e9c80663df4e810734c73813d15d7) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 3668d4a9747b75c20be05a1245edb041cb91cc4b) @@ -108,5 +108,7 @@ HEARTRATE_181 = "181" VISIBLE = True +FEATURE_CONFIGURATIONS = "Feature Configurations" +# Settings Service +DEFAULT_SERVICE_PASSWORD_RAW = "Atal.Matal.22leh" # TODO need to update if we ever change the default - Index: suite_leahi/shared/scripts/configuration/navigation.py =================================================================== diff -u -r3240e0c4aa8e9c80663df4e810734c73813d15d7 -r3668d4a9747b75c20be05a1245edb041cb91cc4b --- suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision 3240e0c4aa8e9c80663df4e810734c73813d15d7) +++ suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision 3668d4a9747b75c20be05a1245edb041cb91cc4b) @@ -35,6 +35,33 @@ config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT ), ) + +def navigate_to_device_settings_using_service_password(): + td_simulator.td_operation_mode(TDOpModes.MODE_SERV.value, 0) + grid_container = squish.waitForObject(names.o_DeviceSettingsGrid) + service_option = utility.findChildByText(grid_container, "Service") + + if service_option is not None: + squish.mouseClick(service_option) + + headerbar_container = squish.waitForObject(names.o_headerBar_HeaderBar) + service_screen_headerbar_title_text = utility.findChildByText( + headerbar_container, "Service" + ) + if service_screen_headerbar_title_text is not None: + test.compare( + service_screen_headerbar_title_text.text, + config.SERVICE_SCREEN_TITLE_TEXT, + "{} screen is displayed and Comparison of Device Settings Screen Title text".format( + config.SERVICE_SCREEN_TITLE_TEXT + ), + ) + input_field = squish.waitForObject(names.o_userConfirmation_TextInput, 1000) + + squish.type(input_field, config.DEFAULT_SERVICE_PASSWORD_RAW) + confirm_button = squish.waitForObject(names.o_userConfirmation_ConfirmButton, 1000) + squish.mouseClick(confirm_button) + def get_ini_value(conf_path: str , section: str, key: str): """ Method to get the advanced option from the System.conf file Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r3240e0c4aa8e9c80663df4e810734c73813d15d7 -r3668d4a9747b75c20be05a1245edb041cb91cc4b --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 3240e0c4aa8e9c80663df4e810734c73813d15d7) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 3668d4a9747b75c20be05a1245edb041cb91cc4b) @@ -242,4 +242,12 @@ o_last_read = {"container": mainTreatmentScreen, "id":"_lastRecorded" , "type": "Text", "unnamed": 1 } o_measureVitalsButton_TouchRect = {"container": o_Overlay, "id": "_measureVitalsButton", "type": "TouchRect", "unnamed": 1 } o_preTreatmentStack_confirmButton_ConfirmButton = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_confirmButton", "type": "ConfirmButton", "visible": True } -o_bpMeasurementIntervalControl_ValueAdjusterCustom = {"container": o_Overlay, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1} +o_bpMeasurementIntervalControl_ValueAdjusterCustom = {"container": o_Overlay, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1 } +o_notification_bar = {"container": o_Overlay, "objectName": "NotificationBar", "type": "NotificationBarSmall" } +o_SettingsBase_SettingsFeatureConfigurations = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsFeatureConfigurations", } +o_SettingsBase_integratedBPCuffSwitch_BaseSwitch = {"checkable": True, "container": o_SettingsBase_SettingsFeatureConfigurations, "id": "_integratedBPCuffSwitch", "type": "BaseSwitch", "unnamed": 1 } +o_headerBar_HeaderBar = {"container": o_Gui_MainView, "id": "_headerBar", "type": "HeaderBar", "unnamed": 1 } +o_SettingsStack_SettingsStack = {"container": o_Gui_MainView, "objectName": "_SettingsStack", "type": "SettingsStack", } +o_UserConfirmation_SettingsServicePassword = {"container": o_SettingsStack_SettingsStack, "objectName": "UserConfirmation", "type": "SettingsServicePassword", } +o_userConfirmation_TextInput = {"container": o_UserConfirmation_SettingsServicePassword, "echoMode": 2, "id": "_input", "passwordCharacter": "•", "type": "TextInput", "unnamed": 1, } +o_userConfirmation_ConfirmButton = {"container": o_UserConfirmation_SettingsServicePassword, "objectName": "_confirmButton", "type": "ConfirmButton", } Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u -r50d3084c54eef035058b21579538b53f503af657 -r3668d4a9747b75c20be05a1245edb041cb91cc4b --- suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision 50d3084c54eef035058b21579538b53f503af657) +++ suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision 3668d4a9747b75c20be05a1245edb041cb91cc4b) @@ -26,7 +26,7 @@ import builtins from leahi_dialin.ui import utils from configuration import utility -from configuration import config +from configuration import config,navigation from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates from datetime import datetime @@ -35,8 +35,18 @@ td =TD_Messaging() can_interface = td.can_interface -vitals = {"0":"0","1":"5","2":"10","3":"15","4":"20","5":"30","6":"60"} - +vitalsrequest =False + +def check_bp_cuff_enabled(): + integrated_bp_value = navigation.get_ini_value("/home/denali/Public/luis/config/configurations/Settings/System.conf", section ="Feature Configurations", key ="IntegratedBPCuff") + if integrated_bp_value == "0": + navigation.navigate_to_device_settings_using_service_password() + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid) + mouseClick(utility.findChildByText(device_settings_grid, config.FEATURE_CONFIGURATIONS)) + integrated_bp_cuff_mode_switch = waitForObject(names.o_SettingsBase_integratedBPCuffSwitch_BaseSwitch, 3000) + mouseClick(integrated_bp_cuff_mode_switch) + + test.log(f "Initial Integrated BP Cuff switch is enabled state") def keyboard_object_map_helper(text): """ Method for setting custom object property's for keyboard keys @@ -70,29 +80,7 @@ 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 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)): - 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, config.VISIBLE, "Popup close option is visible after the vitals pop up is opened automatically") - reason_text = waitForObjectExists(utility.setObjectText(text = "Rejected Reason: [1] Request is not allowed in the current operating mode",obj =names.o_title_Text)) - test.compare(reason_text.text, "Rejected Reason: [1] Request is not allowed in the current operating mode", "Rejection reason text should be"+str("Rejected Reason: [1] Request is not allowed in the current operating mode")) - test.endSection() + def verify_last_read_time(interval): test.startSection("Verify the last read time") @@ -143,16 +131,13 @@ """ Method to check the popup is opened automatically after time interval """ - vitalsrequest = False # mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) test.startSection("Verify popup is opened automatically after time interval") mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - td.td_vitals( systolic = 70, - diastolic = 50, - heartRate = 120 ) + mouseClick(waitForObject(names.o_measureVitalsButton_TouchRect)) td.td_vitals_adjustment_response(vRejectionReason=1) - verify_vitals_pop_up_is_opened_automatically_after_an_interval(interval=5) - test.verify(waitFor("'vitalsrequest == True'", 1000), "UI Sending the request to FW") + rejectionReason = utility.get_object_from_names(names.o_notification_bar) + test.compare(rejectionReason.text, "Rejected Reason: [1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str(rejectionReason.text)) test.endSection() def validate_time_interval(vital_interval_obj, int_min): @@ -199,52 +184,30 @@ else: test.fail(f"Remaining time incorrect. Expected {expected_str}, got {ui_str}") - - # handler for messages from UI to FW -def handle_patient_vitals_request( message): +def handle_patient_vitals_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @return: None """ - message = message['message'] - index = MsgFieldPositions.START_POS_FIELD_1 - index = conversions.bytearray_to_integer( message, index) global vitalsrequest vitalsrequest = True def verify_automatic_vitals_noRejection_Reason(): - global vitalsrequest - vitalsrequest = False - MAX_WAIT = 5 * 60 # 5 minutes in seconds - POLL_INTERVAL = 5 # check every 5 seconds - - mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - mouseClick(names.o_measureVitalsButton_TouchRect) - td.td_vitals( systolic = 70, - diastolic = 50, - heartRate = 120 ) + MAX_WAIT = 5 * 60 * 1000 # 5 minutes in seconds - test.verify(waitFor("'vitalsrequest == True'", 1000), "UI Sending the request to FW") - + test.verify(waitFor( lambda: vitalsrequest == True, MAX_WAIT), "UI Sending the request to FW") td.td_vitals_adjustment_response(vRejectionReason=0) - start_time = time.time() - - while time.time() - start_time < MAX_WAIT: - if vitalsrequest: - td.td_vitals(systolic = 80, - diastolic = 60, - heartRate = 140 ) - break - time.sleep(POLL_INTERVAL) - else: - test.log("Condition not satisfied within 5 minutes. Exiting loop.") + td.td_vitals(systolic = 80, + diastolic = 60, + heartRate = 140 ) + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText - test.compare("70"+"/"+"50", blood_pressure,"Blood pressure value should be ->"+str("80"+"/"+"60")) + test.compare("80"+"/"+"60", blood_pressure,"Blood pressure value should be ->"+str("80"+"/"+"60")) heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText - test.compare("120", heart_rate,"Heart Rate value should be ->"+str(120)) + test.compare("140", heart_rate,"Heart Rate value should be ->"+str(120)) def set_value_based_on_target_patientvitals(obj, target_value): """ @@ -313,6 +276,7 @@ test.endSection() test.startSection("Verify the minimum values in the vitals popup") + check_bp_cuff_enabled() td.td_operation_mode(TDOpModes.MODE_TREA.value, 0) td.td_tx_state(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value , 0 ,