Index: suite_leahi/tst_edit_parameters/test.py =================================================================== diff -u -rfd006d367dc5690c1cf4452d748f761c454e4293 -r3a5e8df68c2370134a53c29d7f8f47a8efb66f4d --- suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision fd006d367dc5690c1cf4452d748f761c454e4293) +++ suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision 3a5e8df68c2370134a53c29d7f8f47a8efb66f4d) @@ -1,4 +1,5 @@ -#Subject/Title: LDT-2819 Edit Treatment Parameters During Treatment - SW - 02 - Edit Treatment Parameters During Treatment - Q&R +#Subject/Title: LDT-2819 Edit Treatment Parameters During Treatment - SW - 02 - Edit Treatment Parameters During Treatment - Q&R +# LDT-4708 NON-FEATURE: SW Misc & Enhc - SW - 02 - Treatment adjustments - Vitals alarm limits - Q&R - 15: SIT - Software Integration Tests - Squish Qt # Functionalities: Testing all functionalities of Edit treatement parameter in the main treatment screen #Steps # Pressure Edit @@ -37,8 +38,12 @@ # 8 Verify the Duration Edit FW Response value reflect on the next screen # 9 Verify the rejection reason 1 and check the error message in the UI # 10 Verify the rejection reason 0 and check FW recieves the values +# Vital Settings +# 1 Click on Vital settings Edit ->Edit the parameters in the vitals popup and perform confirm +# 2 Send the rejection reasom from FW and verify the color border for parameters +# 3 Send the No Rejection from the FW and verify the popup closed and Fw recieved the values +# - import names import squish import can @@ -68,6 +73,10 @@ dialflow = 0 durationvalue = 0 durationconfirm = None +systolicLow = None +systolicHigh = None +heartRateLow = None +heartRateHigh = None PRESSURE_TREATEMENT_OBJ = [names.o_arterialWindow_LabelUnitValueAdjuster, names.o_venousWindow_LabelUnitValueAdjuster, @@ -184,6 +193,27 @@ global durationconfirm durationconfirm = state +def handle_vital_confirm_request(message,timestamp =0.0): + message = message['message'] + index = MsgFieldPositions.START_POS_FIELD_1 + + state,index = conversions.bytearray_to_integer( message, index) + global systolicLow + systolicLow = state + + state,index = conversions.bytearray_to_integer( message, index) + global systolicHigh + systolicHigh= state + + state,index = conversions.bytearray_to_integer( message, index) + global heartRateLow + heartRateLow = state + + state,index = conversions.bytearray_to_integer( message, index) + global heartRateHigh + heartRateHigh = state + + def check_pressure_edit_maintreatment(): test.startSection("Pressure Edit") td.td_tx_state( TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value, @@ -267,6 +297,7 @@ mouseClick(names.o_vitals_close_btn) test.endSection() + def check_saline_edit_maintreatment(): test.startSection("Saline data") td.td_saline( @@ -638,7 +669,66 @@ test.verify(waitFor( lambda: durationconfirm == 78, 5000), "Testing FW received duration Value in main treatment screen") treatmentpopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) test.compare(treatmentpopup, True, "Popup is not present") - test.endSection() + test.endSection() + +def check_vitals_edit_maintreatment(): + test.startSection("Check the vitals edit in the main treatment screen") + parent_obj = waitForObject(names.o_treatmentHome_treatmentVitals_TreatmentVitals) + edit_button = utility.findObjectById(parent_obj,"_editButton") + mouseClick(waitForObject(edit_button)) + test.log("Check the vitals") + parent_obj = waitForObject(names.o_controlLeftColumn_Column) + systolic_BP_low = utility.findObjectById(parent_obj, "_systolicLowAlarmLimit") + utility.set_value_based_on_target(systolic_BP_low, 80) + systolic_BP_High = utility.findObjectById(parent_obj, "_systolicHighAlarmLimit") + utility.set_value_based_on_target(systolic_BP_High, 150) + right_obj = waitForObject(names.o_controlRightColumn_Column) + heart_rate_low = utility.findObjectById(right_obj, "_heartRateLowAlarmLimit") + utility.set_value_based_on_target(heart_rate_low, 95) + heart_rate_high = utility.findObjectById(right_obj,"_heartRateHighAlarmLimit") + utility.set_value_based_on_target(heart_rate_high, 105) + mouseClick(names.o_confirm_button) + global systolicHigh + global systolicLow + global heartRateHigh + global heartRateLow + if can_interface is not None: + channel_id = CAN.CanChannels.ui_to_td_ch_id + message_id = MsgIds.MSG_ID_UI_VITALS_ADJUSTMENT_REQUEST.value + can_interface.register_receiving_publication_function(channel_id, + message_id, + handle_vital_confirm_request) + + test.verify(waitFor( lambda: systolicLow == 80 ,1000 ), "Testing FW received from UI") + test.verify(waitFor( lambda: systolicHigh == 150 ,1000 ), "Testing Fw received from UI") + test.verify(waitFor( lambda: heartRateHigh == 105 ,1000 ), "Testing Fw received from UI") + test.verify(waitFor( lambda: heartRateLow == 95 ,1000 ), "Testing Fw received from UI") + td.td_vitals_alarm_limits_adjustment_response( vAccepted = 0, + vSystolicBpLowAlarmLimitRejectionReson = 1, + vSystolicBpHighAlarmLimitRejectionReson = 1, + vHeartRateLowAlarmLimitRejectionReson = 1, + vHeartRateHighAlarmLimitRejectionReson = 1, + vVitalsIntervalRejectionReson = 1) + + parent_obj = waitForObject(names.o_controlLeftColumn_Column) + systolic_BP_low = utility.findObjectById(parent_obj, "_systolicLowAlarmLimit") + parameter_text = waitForObject(systolic_BP_low) + parameter_text_color = parameter_text.border.color.name + test.compare(config.COLOR_CODES, parameter_text_color, "Systolic Low Alarm limit field color should be ' \red for' " + str(parameter_text_color)) + systolic_BP_High = utility.findObjectById(parent_obj, "_systolicHighAlarmLimit") + parameter_text = waitForObject(systolic_BP_High) + parameter_text_color = parameter_text.border.color.name + test.compare(config.COLOR_CODES, parameter_text_color, "Systolic High Alarm limit field color should be ' \red for' " + str(parameter_text_color)) + td.td_vitals_alarm_limits_adjustment_response( vAccepted = 1, + vSystolicBpLowAlarmLimitRejectionReson = 0, + vSystolicBpHighAlarmLimitRejectionReson = 0, + vHeartRateLowAlarmLimitRejectionReson = 0, + vHeartRateHighAlarmLimitRejectionReson = 0, + vVitalsIntervalRejectionReson = 0) + + vitalsettingspopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) + test.compare(vitalsettingspopup, True, "Popup is not present") + test.endSection() def main(): utils.tstStart(__file__) @@ -653,4 +743,5 @@ check_saline_edit_maintreatment() check_treatement_edit_maintreatment() check_duration_edit_maintreatment() + check_vitals_edit_maintreatment() utils.tstDone() \ No newline at end of file