Index: suite_leahi/tst_edit_parameters/test.py =================================================================== diff -u -re79975dc325f90441f70e114390d1adf4e7d58f9 -r7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a --- suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision e79975dc325f90441f70e114390d1adf4e7d58f9) +++ suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision 7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a) @@ -43,15 +43,16 @@ import squish import can from leahi_dialin.ui import utils -from configuration import utility,config,navigation -from configuration import config +from configuration import utility,config,navigation,application_init 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.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.utils import conversions from leahi_dialin.protocols import CAN +from configuration.getrejectiontext import ScopedRejectionRepository + td = TD_Messaging() can_interface = td.can_interface ArterialWindow = None @@ -68,17 +69,20 @@ durationvalue = 0 durationconfirm = None -PRESSURE_TREATEMENT_OBJ = [names.o_arterialWindow_LabelUnitValueAdjuster, +PRESSURE_TREATEMENT_OBJ = [names.o_arterialWindow_LabelUnitValueAdjuster, names.o_venousWindow_LabelUnitValueAdjuster, names.o_venousAsymmetricWindow_LabelUnitValueAdjuster, names.o_tmpWindow_LabelUnitValueAdjuster] -PRESCRIPTION_SETTINGS_OBJ =[names.o_bloodFlowRate_LabelUnitValueAdjuster, +PRESCRIPTION_SETTINGS_OBJ =[names.o_bloodFlowRate_LabelUnitValueAdjuster, names.o_dialysateFlowRate_LabelUnitValueAdjuster, names.o_dialysateTemperature_LabelUnitValueAdjuster] +conf_path = application_init.configuration_folder_path() + "Alarms/Rejections.conf" +repo = ScopedRejectionRepository(path=conf_path) + def handle_saline_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @@ -219,15 +223,15 @@ tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) tmp_value =tmpwindow_value.value test.log(str(tmp_value)) - utility.set_value_based_on_target(names.o_arterialWindow_LabelUnitValueAdjuster,200) + utility.set_value_based_on_target(names.o_arterialWindow_LabelUnitValueAdjuster,70) arterialwindow_value = waitForObject(names.o_arterialWindow_LabelUnitValueAdjuster) change_arterialwindow_value =arterialwindow_value.value test.log(str(change_arterialwindow_value)) - utility.set_value_based_on_target(names.o_venousWindow_LabelUnitValueAdjuster,140) + utility.set_value_based_on_target(names.o_venousWindow_LabelUnitValueAdjuster,80) venouswindow_value = waitForObject(names.o_venousWindow_LabelUnitValueAdjuster) change_venouswindow_value =venouswindow_value.value test.log(str(change_venouswindow_value)) - utility.set_value_based_on_target(names.o_tmpWindow_LabelUnitValueAdjuster,100) + utility.set_value_based_on_target(names.o_tmpWindow_LabelUnitValueAdjuster,50) tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) change_tmpwindow_value =tmpwindow_value.value test.log(str(change_tmpwindow_value)) @@ -266,11 +270,10 @@ def check_saline_edit_maintreatment(): test.startSection("Saline data") td.td_saline( - 100 , # target_volume - 150 , # cumulative_volume - 75 , # bolus_volume - 0 - ) + 100, # target_volume + 150, # cumulative_volume + 75 , # bolus_volume + 0 ) mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) fluidbolusvolume_value = waitForObject(names.o_valueAdjuster_ValueAdjuster) @@ -289,7 +292,8 @@ parameters_payload= payload) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason, "[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) #rejection reason 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) @@ -441,7 +445,7 @@ message_id, handle_dialflow_request) - test.verify(waitFor( lambda: dialflow == changeddialflow+5, 3000), "Testing FW received dial flow Value in main treatment screen") + test.verify(waitFor( lambda: dialflow == changeddialflow+10, 3000), "Testing FW received dial flow Value in main treatment screen") dialysateflowdownarrowbutton = utility.findObjectById(dialysateflowuparrow,"_downArrowIcon") mouseClick(dialysateflowdownarrowbutton) @@ -454,7 +458,7 @@ message_id, handle_dialflow_request) - test.verify(waitFor( lambda: dialflow == changeddialflow-20, 3000), "Testing FW received dial flow Value in main treatment screen") + test.verify(waitFor( lambda: dialflow == changeddialflow-10, 3000), "Testing FW received dial flow Value in main treatment screen") dialysatetmpuparrow = waitForObject(names.o_dial_tmp_value) @@ -484,7 +488,6 @@ test.verify(waitFor( lambda: dialtemperature == changeddialtmp-0.5, 3000), "Testing FW received dial tmp Value in main treatment screen") - #rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) @@ -495,9 +498,10 @@ has_parameters = True, parameters_payload= payload) - rejectionReason = utility.get_object_from_names(names.o_treatmentHome_notification_NotificationBarSmall) - test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + rejectionReason = waitForObjectExists(names.o_treatmentHome_notification_NotificationBarSmall) + test.compare(rejectionReason.text,"[1] "+ REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason.text)) #rejection reason is 0 payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) @@ -589,7 +593,8 @@ vUFRate= 0.0) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason,"[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) td.td_duration_validate_response(vRejectionReason =0, vDuration= 78, vHeparinDuration = 0, @@ -611,7 +616,8 @@ parameters_payload= payload) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason,"[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) #rejection reason is 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1)