Index: shared/scripts/names.py =================================================================== diff -u -rec74ed46e9862a986f3a0c7e9c6520eefc056650 -r9fc49dcb5999a8def502d0a0984b35b9e67a8092 --- shared/scripts/names.py (.../names.py) (revision ec74ed46e9862a986f3a0c7e9c6520eefc056650) +++ shared/scripts/names.py (.../names.py) (revision 9fc49dcb5999a8def502d0a0984b35b9e67a8092) @@ -96,7 +96,6 @@ o_alarm_dialog = {"container": o_Overlay, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} o_okay_alarm = {"container": o_Overlay, "id": "_okay", "type": "TouchRect", "unnamed": 1, "visible": True} o_alarm_bar = {"container": o_qquickview_alarm, "objectName": "NotificationBar", "type": "NotificationBar"} -o_treatmentStart_SalineTouchArea_TreatmentFluid = {"container": o_treatmentStart_TreatmentStart, "id": "_SalineTouchArea", "type": "TreatmentFluid", "unnamed": 1, "visible": True} o_treatmentStart_heparinTouchArea_TreatmentFluid = {"container": o_treatmentStart_TreatmentStart, "id": "_heparinTouchArea", "type": "TreatmentFluid", "unnamed": 1, "visible": True} o_dismiss_alarm = {"container": o_Overlay, "id": "_dismiss", "type": "TouchRect", "unnamed": 1, "visible": True} o_treatmentStart_TimeText_TimeText = {"container": o_treatmentStart_TreatmentStart, "objectName": "_TimeText", "type": "TimeText", "visible": True} @@ -246,6 +245,13 @@ o_settingsHome_OutletFlowData_MotorCtlCurrent = {"container": o_settingsHome, "objectName": "_OutletFlowData5", "type": "Text"} o_settingsHome_OutletFlowData_PWMDtCycle = {"container": o_settingsHome, "objectName": "_OutletFlowData6", "type": "Text"} +# Saline Bolus +o_treatmentStart_SalineSection = {"container": o_treatmentStart_TreatmentStart, "id": "_SalineTouchArea" , "type": "TreatmentFluid" } +o_treatmentStart_SalineCumulative = {"container": o_treatmentStart_TreatmentStart, "id": "_cumulativeValue" , "type": "Text" } +o_treatmentStart_SalineDelivered = {"container": o_treatmentStart_TreatmentStart, "id": "_fluidValue" , "type": "Text" } +o_treatmentStart_SalineTarget = {"container": o_treatmentStart_TreatmentStart, "id": "_fluidTarget" , "type": "Text" } +o_treatmentStart_SalineStart = {"container": o_treatmentStart_TreatmentStart, "id": "_startFluidButton", "type": "TouchRect" } + # Setting CANBusFaultCountText o_settingsHome_canbusFaultCount = {"container": o_settingsHome, "id": "_canbusFaultCountText", "type": "Text" } Index: suite.conf =================================================================== diff -u -rf32e3b65bfcf747b049f76b3b5d2384ab37f4c4b -r9fc49dcb5999a8def502d0a0984b35b9e67a8092 --- suite.conf (.../suite.conf) (revision f32e3b65bfcf747b049f76b3b5d2384ab37f4c4b) +++ suite.conf (.../suite.conf) (revision 9fc49dcb5999a8def502d0a0984b35b9e67a8092) @@ -5,6 +5,6 @@ IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_Internals tst_HomeScreen tst_ServiceShutdown tst_TreatmentScreen tst_Treatment_Section_BloodDialysate tst_Treatment_BloodDialysateFlowRate tst_Treatment_Time tst_Treatment_Ultrafiltration tst_Treatment_PressureOcclusion tst_Treatment_ParametersRange tst_Treatment_Adjustment_BloodDialysate tst_Treatment_Adjustment_Duration tst_Treatment_Adjustment_Ultrafiltration tst_TreatmentStatesData tst_DGDrainPumpData tst_DGHeatersData tst_DGLoadCellReadingsData tst_DGPressureData tst_DGTemperaturesData tst_DGROPumpData tst_DGReservoirData tst_case2 tst_DGValvesStatesData tst_DGOperationMode tst_HDOperationModeData tst_HDOutletFlowData tst_HDPressureOcclusionData tst_CANBusFaultCount tst_DebugText tst_Alarm_Colors tst_AlarmStatusData tst_AlarmTriggered tst_AlarmCleared +TEST_CASES=tst_Internals tst_HomeScreen tst_ServiceShutdown tst_TreatmentScreen tst_Treatment_Section_BloodDialysate tst_Treatment_BloodDialysateFlowRate tst_Treatment_Time tst_Treatment_Ultrafiltration tst_Treatment_PressureOcclusion tst_Treatment_ParametersRange tst_Treatment_Adjustment_BloodDialysate tst_Treatment_Adjustment_Duration tst_Treatment_Adjustment_Ultrafiltration tst_Treatment_Adjustment_Saline tst_TreatmentSalineData tst_TreatmentStatesData tst_DGDrainPumpData tst_DGHeatersData tst_DGLoadCellReadingsData tst_DGPressureData tst_DGTemperaturesData tst_DGROPumpData tst_DGReservoirData tst_case2 tst_DGValvesStatesData tst_DGOperationMode tst_HDOperationModeData tst_HDOutletFlowData tst_HDPressureOcclusionData tst_CANBusFaultCount tst_DebugText tst_Alarm_Colors tst_AlarmStatusData tst_AlarmTriggered tst_AlarmCleared VERSION=3 WRAPPERS=Qt Index: tst_TreatmentSalineData/test.py =================================================================== diff -u --- tst_TreatmentSalineData/test.py (revision 0) +++ tst_TreatmentSalineData/test.py (revision 9fc49dcb5999a8def502d0a0984b35b9e67a8092) @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +## +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_TreatmentSalineBolusData +# date 2020/08/10 +# author Behrouz NematiPour +# + + +# # TreatmentSalineBolusData +# o_managerHome_TreatmentSalineBolusData_Target = {"container": o_managerHome, "objectName": "_TreatmentSalineBolusData0", "type": "Text"} +# o_managerHome_TreatmentSalineBolusData_Cumulitive = {"container": o_managerHome, "objectName": "_TreatmentSalineBolusData1", "type": "Text"} +# o_managerHome_TreatmentSalineBolusData_Delivered = {"container": o_managerHome, "objectName": "_TreatmentSalineBolusData2", "type": "Text"} + +import names +from dialin.protocols.CAN import DenaliMessage +if names.DIALIN_LINK: + from dialin.squish import utils, denaliMessages +else: + import utils + import denaliMessages + +def getUnit(): + global saline_unit + saline_unit = str(waitForObjectExists(names.o_treatmentStart_SalineSection).unit) + +def gotoScreenNtest_Contains_TreatmentSalineBolusData(): + mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "START BOLUS") + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).title ), "SALINE BOLUS") + test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True) + + +def test_values(vTarget, vCumulative, vDelivered): + test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueTarget , vTarget ) + test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueCumulative, vCumulative) + test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueDelivered , vDelivered ) + + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineTarget ).text), "({:.0f} {})".format(vTarget, saline_unit)) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineCumulative).text), "{:.0f}".format(vCumulative)) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineDelivered ).text), "{:.0f}".format(vDelivered )) + + +def main(): + utils.tstStart(__file__) + + startApplication(names.AUT_NAME) + utils.waitForGUI(1) + + gotoScreenNtest_Contains_TreatmentSalineBolusData() + utils.waitForGUI(1) + + getUnit() + + cumulitive = 0 + step = 1 + for target in [100, 200, 300]: + for value in range ( 0, target, step): + cumulitive += step + denaliMessages.setTreatmentSalineBolusData(target, cumulitive, value+1) # 0 is not a step + test_values (target, cumulitive, value+1) # 0 is not a step + + utils.tstDone() Index: tst_Treatment_Adjustment_Saline/test.py =================================================================== diff -u --- tst_Treatment_Adjustment_Saline/test.py (revision 0) +++ tst_Treatment_Adjustment_Saline/test.py (revision 9fc49dcb5999a8def502d0a0984b35b9e67a8092) @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +## +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_Treatment_Adjustment_Saline +# date 2020/08/10 +# author Behrouz NematiPour +# + + +import names +if names.DIALIN_LINK: + from dialin.squish import utils, denaliMessages +else: + import utils + import denaliMessages + +def gotoScreenNtest_Contains_TreatmentSalineBolusData(): + mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "START BOLUS") + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).title ), "SALINE BOLUS") + test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True) + + +def test_state(vAccept, vText): + mReason = 0 + if (not vAccept): + mReason = 16 + mouseClick(waitForObject(names.o_treatmentStart_SalineStart)) + denaliMessages.setSalineBolusResponse(vAccept, mReason, 50) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "{} BOLUS".format(vText)) + + +def test_Ultrafiltration(): + pass + +def main(): + utils.tstStart(__file__) + + startApplication(names.AUT_NAME) + utils.waitForGUI(1) + + #initially is stopped (Text => START) + gotoScreenNtest_Contains_TreatmentSalineBolusData() + utils.waitForGUI(1) + + # Init stopped, stopped =(accepted)=> running (Text => STOP ) + test_state(True , "STOP" ) + + # Now running, running =(rejected)== running (Text == STOP ) + test_state(False, "STOP" ) + + # Still running, running =(accepted)=> stopped (Text == START) + test_state(True , "START") + + # Now stopped, stopped =(rejected)== stopped (Text == START) + test_state(False, "START") + + # Now stopped, stopped =(accepted)=> running (Text == STOP ) + test_state(True , "STOP" ) + + # Still running, running =(accepted)=> stopped (Text == START) + test_state(True, "START") + + utils.tstDone()