# Subject/Title: LDT -3429 HDF - SW - 02 - Main-Tx HDF Tab - Graph - Q&R - 15: SIT - Software Integration Tests - Squish Qt # Functionalities: Testing all functionalities of MAin TX HDF tab in the main treatment screen # # Steps: #Main TX HDF Tab #1 Navigate to Main Treatment by changing OP mode to main treatement # - Change opmode to DIALYSiS #2.Navigate to HDF Tab # - Send pressures data # - Confirm Pressures component # - Wait 2 minutes ( The graph component plot graphs every 1 min) # - once a plot is present scrub the graph area and confirm the top area shows the current vertical line data #3.HDF Component # - verify pressure data in the popup # - verify edit popup and when user changes items and saves the main componenet reflects the changes import names from leahi_dialin.ui import utils from configuration import utility,config,navigation from configuration import config from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.ui_defs import TXStates from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates from leahi_dialin.utils import conversions from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions td =TD_Messaging() ART_LOW_VAL_MINUS_390 = -390 ART_HIGH_VAL_220 = 220 VENOUS_LOW_VAL_MINUS_90 = -90 VENOUS_HIGH_VAL_410 = 410 TMP_LOW_VAL_MINUS_640 = -640 TMP_HIGH_VAL_210 = 210 def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) test.startSection("Navigate to the HDF Page") td.td_operation_mode(TDOpModes.MODE_TREA.value) utils.waitForGUI(2) td.td_tx_state( TDTreatmentStates.TREATMENT_BLOOD_PRIME_STATE.value, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0) td.td_tx_state( TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0) waitForObject(names.o_listView_Item,1000) hdf = utility.setObjectText(text="HDF", obj=names.o_listView_Item) mouseClick(waitForObject(hdf)) td.td_pressure(H2_arterial_pressure = 160, H14_venous_pressure = 440 , limit_state = 0, H2_arterial_min = ART_LOW_VAL_MINUS_390, H2_arterial_max = ART_HIGH_VAL_220 , H14_venous_min = VENOUS_LOW_VAL_MINUS_90 , H14_venous_max = VENOUS_HIGH_VAL_410 , H2_arterial_long = 0 , H14_venous_long = 0 , tmp_pressure = 200 , tmp_min = TMP_LOW_VAL_MINUS_640 , tmp_max = TMP_HIGH_VAL_210) pressure_edit = waitForObject(names.o_treatmentHDF_treatmentPressures_TreatmentPressures) pressure_edit = utility.findObjectById(pressure_edit, "_editButton") mouseClick(waitForObject(pressure_edit)) mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) snooze(120) parent = waitForObject(names.o_treatmentHDF_currentDataRow_Row) time = utility.findObjectById(parent,"_timeText") test.log(str(time.text)) arterial_pressure = utility.findObjectById(parent,"_line1Text") test.compare(str(arterial_pressure.text),str(160),"Arterial_pressure value in the graph should be"+str(arterial_pressure.text)) venous_pressure = utility.findObjectById(parent ,"_line2Text") test.compare(str(venous_pressure.text),str(440),"Venous_pressure value in the graph should be"+str(venous_pressure.text)) tmp_pressure =utility.findObjectById(parent,"_line3Text") test.compare(str(tmp_pressure.text),str(200),"Temperature_pressure value in the graph should be"+str(tmp_pressure.text)) hdf_edit_button = waitForObject(names.o_treatmentHDF_treatmentHdfComponent_TreatmentHDFComponent) edit_hdf = utility.findObjectById(hdf_edit_button,"_editButton") mouseClick(edit_hdf) utility.set_value_based_on_target(names.o_valueAdjuster_ValueAdjuster, 1.1) mouseClick(names.o_confirmButton_ConfirmButton) prescribed_fluid_volume = waitForObject(names.o_treatmentHDF_prescribedFluidVolume_LabelUnitValueAdjuster,1000) prescribed_fluid_volume_value = round(prescribed_fluid_volume.value,1) test.compare(prescribed_fluid_volume_value, float(1.1), "Prescribed Fluid volume should be"+str(prescribed_fluid_volume_value)) utils.tstDone()