Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -rd94d75c2c397752dfee66870ad4cee7dd913651d -rccc837e1c29f80a5c280de09ff637e280bd9333c --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision d94d75c2c397752dfee66870ad4cee7dd913651d) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision ccc837e1c29f80a5c280de09ff637e280bd9333c) @@ -63,3 +63,38 @@ "ALARM_PRIORITY_HIGH" : "#c53b33" } ALARM_REJECT_NOTIFICATION_TEMPLATE = "No Active Alarm List [{}]" + +#Create Rx +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"] + +#Heparin +heparin_off = { "Heparin Type" :"OFF", + "Dispensing Rate" :"OFF", + "Bolus Volume" :"OFF", + "Stop Time" :"OFF"} + +heparin_values = { "Heparin Type" :"Unfractionated 1,000", + "Dispensing Rate" :"0.5", + "Bolus Volume" :"0.4", + "Stop Time" :"60"} + +PAUSE = 'Pause' +ACTIVE = 'Active' +RESUME = 'Resume' +COMPLETE = 'Complete' +HEPARIN = "Heparin" +CREATERX = "Rx" +VALIDATE = "VALIDATE" +CONFIRM = "CONFIRM" +NEXT ="Next" +SYSTOLIC = "Systolic" +DIASTOLIC = "Diastolic" +HEARTRATE = "Heart Rate" + +MIN_SYSTOLIC = "60" +MIN_DIASTOLIC = "40" +MIN_HEARTRATE = "40" + Index: suite_leahi/shared/scripts/configuration/navigation.py =================================================================== diff -u -r4e2b2a08fb10fb528e782a505eaab19f63874cc4 -rccc837e1c29f80a5c280de09ff637e280bd9333c --- suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision 4e2b2a08fb10fb528e782a505eaab19f63874cc4) +++ suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision ccc837e1c29f80a5c280de09ff637e280bd9333c) @@ -32,4 +32,28 @@ "{} screen is displayed and Comparison of Device Settings Screen Title text".format( config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT ), - ) \ No newline at end of file + ) + +def navigation_pageIndicator_step(vStep_name): + """ + Navigate to the specified page using the step indicator component. + + This method selects the given step from the page step indicator + Args: + vStep_name (str): The name of the step to navigate to as displayed + in the step indicator. + + """ + test.startSection("Method to navigation in the pretreatment page ") + stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) + values = utility.findAllObjectsById(stepId, "_text") + for index, input_field in enumerate(values[2:]): + test.log(str(index)); + test.log(str(input_field.text)) + if str(input_field.text) == vStep_name: + test.log("Reached the target step") + break + else: + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(Nextbutton) + test.endSection() \ No newline at end of file Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rd94d75c2c397752dfee66870ad4cee7dd913651d -rccc837e1c29f80a5c280de09ff637e280bd9333c --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision d94d75c2c397752dfee66870ad4cee7dd913651d) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision ccc837e1c29f80a5c280de09ff637e280bd9333c) @@ -2,10 +2,12 @@ import test import object import names -from squish import * from leahi_dialin.ui import utils from builtins import int as pyInt - +from configuration import config,navigation +from leahi_dialin.ui.td_messaging import TD_Messaging +td =TD_Messaging() + def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ To get an object with try..except catching to prevent script errors when the object is not found on the GUI @@ -84,35 +86,37 @@ target_value: integer or string number, e.g. 220 """ + target_value = target_value + + # Wait for all objects parent_obj = squish.waitForObjectExists(obj) + # change range as per your screen count + left_arrow = findObjectById(parent_obj, "_leftArrow") right_arrow =findObjectById(parent_obj, "_rightArrow") - try: - current_value = round(float(findObject(obj).value),1) - except LookupError: - current_value = float(findObject(obj).property("value")) - + # Read current value (supports invisible text too) + + current_value = round(float(squish.findObject(obj).value),1) + # Determine direction while current_value != float(target_value): if current_value < float(target_value): squish.mouseClick(squish.waitForObject(right_arrow)) elif current_value > float(target_value): squish.mouseClick(squish.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")) - + + current_value = round(float(squish.findObject(obj).value),1) + test.log(f"Updated value: {current_value}") test.log(f"✅ Target value reached: {current_value}") def select_different_dropdown(object,type,whichTypeIndex): """ - Method selects the option based on index from the dropdown + Selects a value from a dropdown using a doc string. + """ type_combo_box = get_object_from_names(object, error_message="Combo box object is missing") if type_combo_box is not None: @@ -208,3 +212,64 @@ except LookupError: test.fail("ERROR : " + error_message) return None + +def verify_create_treatment_parameters(): + test.startSection("Pre treatment parameters") + navigation.navigation_pageIndicator_step(config.CREATERX) + squish.mouseClick(squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) + squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 60) + set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, 75) + set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 75) + 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, 60) + select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) + set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,37.0) + select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) + set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 200) + select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,config.VITALS,1) + select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) + Validatebutton = setObjectText(obj = names.o_preTreatmentStack_Text, text =config.VALIDATE) + squish.mouseClick(squish.waitForObject(Validatebutton)) + 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, + vTransmembranePressureLimitWindowRejectReason = 0, + vDialysateTempRejectReason = 0, + vHeparinDispensingRateRejectReason = 0, + vHeparinBolusVolumeRejectReason = 0 + ) + confirmButton = setObjectText(obj = names.o_preTreatmentStack_Text,text = config.CONFIRM ) + squish.mouseClick(squish.waitForObject(confirmButton)) + test.endSection() + +def findAllObjectsById(parent, target_id): + """ + Recursively finds all child objects by their id property. + Returns a list of all matching objects found. + """ + results = [] + + # Use hasattr to safely check for 'id' property + if hasattr(parent, 'id') and str(parent.id) == target_id: + results.append(parent) + + # Recurse through all children to collect all instances + for child in object.children(parent): + results.extend(findAllObjectsById(child, target_id)) + + return results Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -rd0541e8a1e64248961d52dd9492e92fd79b5177a -rccc837e1c29f80a5c280de09ff637e280bd9333c --- suite_leahi/shared/scripts/names.py (.../names.py) (revision d0541e8a1e64248961d52dd9492e92fd79b5177a) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision ccc837e1c29f80a5c280de09ff637e280bd9333c) @@ -195,3 +195,47 @@ o_preTreatmentStack_PreTreatmentBase_PreTreatmentBase = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentBase", "type": "PreTreatmentBase" } o_PreTreatmentBase_instructionView_InstructionView = {"container": o_preTreatmentStack_PreTreatmentBase_PreTreatmentBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1 } +#end of treatment +o_createTreatmentRect_TouchRect = {"container": o_standByScreen_MainHome, "id": "_createTreatmentRect", "type": "TouchRect", "unnamed": 1 } +o_option_combo_box = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_preTreatmentStack_PreTreatmentStack = {"container": o_Gui_MainView, "id": "_preTreatmentStack", "type": "PreTreatmentStack", "unnamed": 1 } +o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate" } +o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_pretreatmentPatientIDEntry", "type": "TextEntry", "unnamed": 1 } +o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_durationControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_durationControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinStopTimeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialysateTemperatureControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_salineBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox= {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bicarbonateConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatment_vitalsCombobox_BaseCombobox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_acidConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_dialyzerTypeComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_pretreatmentPatientIDEntry", "type": "TextEntry", "unnamed": 1 } +o_preTreatmentStack_Text = {"container": o_preTreatmentStack_PreTreatmentStack, "type": "Text", "unnamed": 1 } +o_preTreatmentStack_stepIndicator_StepIndicator = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "_stepIndicator", "type": "StepIndicator", "unnamed": 1 } +o_cancelTouch_TouchRect = {"container": o_Overlay, "id": "_cancelTouch", "type": "TouchRect", "unnamed": 1 } +o_treatmentCompleteButton_TreatmentCompleteButton = {"container": o_Gui_MainView, "id": "_treatmentCompleteButton", "type": "TreatmentCompleteButton", "unnamed": 1 } +o_treatmentHome_iconImage_Image = {"container": mainTreatmentScreen, "id": "_iconImage", "source": "qrc:/images/iEditDisabled", "type": "Image", "unnamed": 1 } +o_treatmentHome_editButton_IconButton = {"container": mainTreatmentScreen, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +o_vitalsButton_VitalsButton = {"container": o_Gui_MainView, "id": "_vitalsButton", "type": "VitalsButton", "unnamed": 1 } +o_isolatedUfButton_TouchRect = {"container": o_Overlay, "objectName": "_isolatedUfButton", "type": "TouchRect" } +o_pauseResumeButton_TouchRect = {"container": o_Overlay, "objectName": "_pauseResumeButton", "type": "TouchRect" } +o_treatmentHome_editButton_IconButton_2 = {"container": mainTreatmentScreen, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +o_image_Image = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1 } +o_treatmentHome_upArrowIcon_ArrowButton = {"container": mainTreatmentScreen, "objectName": "upArrowIcon", "type": "ArrowButton" } +o_treatmentHome_downArrowIcon_ArrowButton = {"container": mainTreatmentScreen, "objectName": "downArrowIcon", "type": "ArrowButton" } +o_confirmTouch_ConfirmButton = {"container": o_Overlay, "id": "_confirmTouch", "type": "ConfirmButton", "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_heartRate_TextEntry = {"container": o_Overlay, "id": "_heartRate", "type": "TextEntry", "unnamed": 1 } +o_confirm_button = {"container": o_Overlay, "id": "_confirmButton", "type": "ConfirmButton", "unnamed": 1 } +keyboard_input = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_treatmentHome_bloodPressure_LabelValue = {"container": mainTreatmentScreen, "id": "_bloodPressure", "type": "LabelValue", "unnamed": 1 } +o_treatmentHome_heartBeat_LabelValue = {"container": mainTreatmentScreen, "id": "_heartBeat", "type": "LabelValue", "unnamed": 1 } + + + + Index: suite_leahi/tst_end_of_treatment/test.py =================================================================== diff -u --- suite_leahi/tst_end_of_treatment/test.py (revision 0) +++ suite_leahi/tst_end_of_treatment/test.py (revision ccc837e1c29f80a5c280de09ff637e280bd9333c) @@ -0,0 +1,175 @@ +# Subject/Title: LDT -3016 End of Treatment - SW - 02 - Q&R - 15: SIT - Software Integration Tests - Squish Qt +# +# Functionalities: Testing all functionalities of End of Treatment +# +# Steps: +# Create Rx validate and confirm and Navigate to main treatment +# In Main Treatment set the treatment state to TREATMENT_END_STATE from the simulator +# Verify Dialysis Treatment Complete popup is visible +# Test first the Stay on Treatment button +# Verify the following: +# A new headerbar icon is available (This brings up that same Complete popup) +# Treatment time edit is disabled +# Saline Start Bolus is enabled +# Vitals is enabled - Enter vitals and confirm you can take a reading +# Pressures edit is enabled +# Ultrafiltration edit is enabled but when opened +# ONLY Isolated UF is enabled and all other options disabled +# Treatment parameters Edit button is disabled +# User canm only edit bloodflow. other parameters are disabled. +# Open the popup and press end treatment +# Check request message from UI and change the treatment state to rinseback + +import names +import can +from leahi_dialin.ui import utils +from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.ui.td_messaging import TD_Messaging +from configuration import utility, config +from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates +from leahi_dialin.protocols import CAN +td =TD_Messaging() + +endTreatmentState = "-1" + + +def change_treatmentstates(state): + test.startSection("Change the treatment parameter") + td.td_tx_state( state, + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0 , + 0) + test.endSection() + +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(utility.setObjectText(text = title_name,obj =names.o_title_Text)) + 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.2) + mouseClick(waitForObjectExists(keyboard_value)) + utils.waitForGUI(0.2) + + 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 handle_end_of_treatment_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 + state,index = conversions.bytearray_to_integer( message, index) + global endTreatmentState + endTreatmentState = str(state) + +def verify_stay_treatment_state(): + test.startSection("Check the UI behavior state when user is in stay on treatment") + stay_on_treatment = waitForObject(names.o_cancelTouch_TouchRect) + mouseClick(stay_on_treatment) + complete_popup = waitForObject(names.o_treatmentCompleteButton_TreatmentCompleteButton) + test.compare(complete_popup.visible,True, "Dialysis Treatment Complete popup is visible") + treatment_time_edit = waitForObjectExists(names.o_treatmentHome_iconImage_Image) + test.compare(not treatment_time_edit.enabled,True,"Treatment time edit is disabled") + saline_edit =waitForObjectExists(names.o_treatmentHome_editButton_IconButton) + test.compare(saline_edit.enabled,True,"Saline bolus edit button is enabled") + patient_vitals =waitForObjectExists(names.o_vitalsButton_VitalsButton) + test.compare(patient_vitals.enabled,True,"Patient vitals button is enabled") + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.MIN_SYSTOLIC,config.MIN_SYSTOLIC) + verify_valid_vitals_through_keypad(config.DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,config.MIN_DIASTOLIC,config.MIN_DIASTOLIC) + verify_valid_vitals_through_keypad(config.HEARTRATE, names.o_heartRate_TextEntry, config.MIN_HEARTRATE, config.MIN_HEARTRATE) + mouseClick(waitForObject(names.o_confirm_button)) + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText + test.compare(config.MIN_SYSTOLIC+"/"+config.MIN_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(config.MIN_SYSTOLIC+"/"+config.MIN_DIASTOLIC)) + heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText + test.compare(config.MIN_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(config.MIN_HEARTRATE)) + ultrafiltration_edit =waitForObjectExists(names.o_editButton_ultrafiltration_IconButton) + test.compare(ultrafiltration_edit.enabled,True,"Ultrafiltration edit button is enabled") + mouseClick(waitForObject(names.o_editButton_ultrafiltration_IconButton)) + #check isolated,pause uf and edit uf button state + isolateduf_button = waitForObjectExists(names.o_isolatedUfButton_TouchRect) + test.compare(isolateduf_button.enabled,True,"Isolated UF button is enabled") + edituf_button =waitForObjectExists(names.o_editButton_TouchRect) + test.compare(not edituf_button.enabled,True,"Edit UF button is disabled") + pauseuf_button = waitForObjectExists(names.o_pauseResumeButton_TouchRect) + test.compare(not pauseuf_button.enabled,True,"Pause UF button is disabled") + mouseClick(names.o_image_Image) + treatment_parameters_edit = waitForObjectExists(names.o_treatmentHome_editButton_IconButton_2) + test.compare(treatment_parameters_edit.enabled,True,"Treatment parameters edit button is disabled") + td.td_treatment_set_points (blood_flow = 51, + dialysate_flow = 0, + dialysate_temp = 0) + bloodflow_uparrow = waitForObjectExists(names.o_treatmentHome_upArrowIcon_ArrowButton) + test.compare(bloodflow_uparrow.enabled,True,"Blood flow up arrow is enabled") + bloodflow_downarrow = waitForObjectExists(names.o_treatmentHome_downArrowIcon_ArrowButton) + test.compare(bloodflow_downarrow.enabled,True,"Blood flow down arrow is enabled") + test.endSection() + + +def main(): + utils.tstStart(__file__) + + can_interface = td.can_interface + global endTreatmentState + + # handle sent messages from UI + if can_interface is not None: + channel_id = CAN.DenaliChannels.ui_to_td_ch_id + message_id = MsgIds.MSG_ID_TD_END_TREATMENT_REQUEST.value + can_interface.register_receiving_publication_function(channel_id, + message_id, + handle_end_of_treatment_request) + + + startApplication(config.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_PRET.value) + td.td_blood_set_auto_load_response(vRejectionReason = 0) + utility.verify_create_treatment_parameters() + change_treatmentstates(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value) + change_treatmentstates(TDTreatmentStates.TREATMENT_END_STATE.value) + test.startSection("Check the button state when user enter stay on treatment state") + verify_stay_treatment_state() + test.endSection() + + test.startSection("Check the values when user in end treatment state") + mouseClick(waitForObject(names.o_treatmentCompleteButton_TreatmentCompleteButton)) + mouseClick(waitForObject(names.o_confirmTouch_ConfirmButton)) + test.verify(waitFor("'endTreatmentState == 6'", 5000), "Testing UI -> TD message end state") + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value) + test.endSection() + +