Index: tst_Treatment_Adjustment_Ultrafiltration/test.py =================================================================== diff -u -rab2ebd8c7b5c8df145c2b8cc06a397258ecf2f13 -r310f51a5ed4921f184572f90d07b350ec41c0bae --- tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision ab2ebd8c7b5c8df145c2b8cc06a397258ecf2f13) +++ tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision 310f51a5ed4921f184572f90d07b350ec41c0bae) @@ -13,9 +13,11 @@ # import names -from dialin.squish import utils, denaliMessages -from dialin.squish.denaliMessages import txStates +from dialin.ui import utils +from dialin import HDSimulator +from dialin.ui.hd_simulator import TXStates from dialin.common.msg_defs import RequestRejectReasons as rejectReason +HDSimulator = HDSimulator() eInvalid = 0 @@ -61,7 +63,7 @@ def startNTestTreatmentUltrafiltration(vMinUF, vMaxUF): for i in range(vMinUF, vMaxUF+1, 10): - denaliMessages.setTreatmentUltrafiltration(vMaxUF, i, 1, 1, 1, 1, 1) + HDSimulator.cmd_set_treatment_ultrafiltration_outlet_flow_data(vMaxUF, i, 1, 1, 1, 1, 1) test.compare(utils.l2ml(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), i) @@ -105,14 +107,14 @@ # [Normal Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationStart_NotificationBar).text), "") # [Reject Pause] - denaliMessages.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.value, txStates.UF_RUNNING_STATE) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_rejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.value, TXStates.UF_RUNNING_STATE) # [Reject Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationStart_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.name) def pause_Accept(): # [Accept Pause] - denaliMessages.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_PAUSED_STATE) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_accepted(TXStates.UF_PAUSED_STATE) # [Accept Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), "") utils.waitForGUI(1) @@ -139,14 +141,14 @@ # [Normal Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), "") # [Reject Resume] - denaliMessages.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.value, txStates.UF_PAUSED_STATE) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_rejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.value, TXStates.UF_PAUSED_STATE) # [Reject Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.name) def resume_Accept(): # [Accept Resume] - denaliMessages.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_RUNNING_STATE) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_accepted(TXStates.UF_RUNNING_STATE) utils.waitForGUI(1) @@ -177,15 +179,15 @@ def edit_RejectNTest(): - denaliMessages.setTreatmentAdjustUltrafiltrationEditRejected(rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.value) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_edit_rejected(rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.value) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).visible, True) #this error message needs to be changed later when translated. test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.name) def updateNTest_Adjustment_Ranges(vMinUFVolume, vMaxUFVolume): # HD sends Ultrafiltration ranges - denaliMessages.setTreatmentParamRanges(0, 0, vMinUFVolume, vMaxUFVolume, 0, 0) + HDSimulator.cmd_set_treatment_parameter_ranges(0, 0, vMinUFVolume, vMaxUFVolume, 0, 0) # Edit Screen updates Ultrafiltration ranges on Slider upon Receiving Ranges test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).minText.text), "{:.3f}".format(utils.ml2l(vMinUFVolume))) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).maxText.text), "{:.3f}".format(utils.ml2l(vMaxUFVolume))) @@ -201,7 +203,7 @@ def adjustmentResponse(): - denaliMessages.setTreatmentAdjustUltrafiltrationEditResponse(_Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_edit_response(_Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld) def next_Accepted(vVolume, vRateState, vDurationState): @@ -319,19 +321,19 @@ def confirm_RejectNTest(): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmRejected(rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.value) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_confirm_rejected(rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.value) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).visible, True) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).text ), rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.name) def confirm_RejectNTest_Unknow(): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmRejected(200) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_confirm_rejected(200) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).visible, True) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).text ), "[200] Unknown Error") def confirm_Accept(vVolume, vDuration, vRate): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmResponse(1, 0, vVolume, vDuration, vRate) + HDSimulator.cmd_set_treatment_adjust_ultrafiltration_confirm_response(1, 0, vVolume, vDuration, vRate) def main(): @@ -353,7 +355,7 @@ closeScreen() # Back to main # set the ultrafiltration to running state - denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_RUNNING_STATE, txStates.SALINE_BOLUS_STATE_IDLE, txStates.HEPARIN_STATE_OFF) + HDSimulator.cmd_set_treatment_states_data(TXStates.TREATMENT_DIALYSIS_STATE_NOT, TXStates.UF_RUNNING_STATE, TXStates.SALINE_BOLUS_STATE_IDLE, TXStates.HEPARIN_STATE_OFF) gotoScreen_UltrafiltrationAdjustment()