Index: shared/scripts/names.py =================================================================== diff -u -r59636301fab15c81ae50b7ea7546b79e494189f8 -r92a813d62f26a3e5ddf77b3b58b5c965fadeffb5 --- shared/scripts/names.py (.../names.py) (revision 59636301fab15c81ae50b7ea7546b79e494189f8) +++ shared/scripts/names.py (.../names.py) (revision 92a813d62f26a3e5ddf77b3b58b5c965fadeffb5) @@ -12,7 +12,9 @@ # author Behrouz NematiPour # -o_QQuickView = {"type": "QQuickView", "unnamed": 1, "visible": True} +# Top Parents +o_QQuickView = { "type": "QQuickView"} +o_Overlay = {"container": o_QQuickView, "type": "Overlay" } # Home Screen o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} @@ -35,7 +37,6 @@ o_settingsHome_background = {"container": o_settingsHome, "id": "_backgroundRect", "type": "Rectangle" , "unnamed": 1, "visible": True} # Modal Dialog -o_Overlay = {"container": o_QQuickView , "type": "Overlay" , "unnamed": 1, "visible": True} o_modalDialog = {"container": o_Overlay , "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} # Power off @@ -100,42 +101,41 @@ o_treatmentStart_START_BOLUS_100_mL_Text = {"container": o_treatmentStart_TreatmentStart, "text": "START BOLUS (100 mL)", "type": "Text", "unnamed": 1, "visible": True} -# Ultrafilration Adjustment -o_Ultrafilration_Adjustment_StartScreen = {"container": o_Overlay,"objectName": "TreatmentAdjustmentUltrafiltrationStart", "type": "TreatmentAdjustmentBase", "id": "_treatmentAdjustmentUltrafiltrationStart"} -o_Ultrafilration_Adjustment_PauseButton = {"container": o_Overlay, "type": "TouchRect", "id": "_pauseButton", "unnamed": 1, "visible": True} -note_Ultrafiltration_needs_to_be_paused_to_edit_the_volume_Text = {"container": o_Overlay, "text": "Note: Ultrafiltration needs to be paused to edit the volume.", "type": "Text", "unnamed": 1, "visible": True} -notificationBar_NotificationBar = {"container": o_Overlay, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +# Reviewed Objects -o_pauseNotificationBar_NotificationBar = {"container": o_Overlay, "id":"_pausedNotification", "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} -o_pauseButton_TouchRect = {"container": o_Overlay, "id": "_pauseButton" , "type": "TouchRect" , "unnamed": 1, "visible": True} -o_editButton_TouchRect = {"container": o_Overlay, "id": "_editButton" , "type": "TouchRect" , "unnamed": 1, "visible": True} -o_resumeButton_TouchRect = {"container": o_Overlay, "id": "_resumeButton", "type": "TouchRect" , "unnamed": 1, "visible": True} -o_nextButton_TouchRect = {"container": o_Overlay, "id": "_nextButton" , "type": "TouchRect" , "unnamed": 1, "visible": True} -o_backButton_BackButton = {"container": o_Overlay, "id": "_backButton" , "type": "BackButton" , "unnamed": 1, "visible": True} -o_closeButton = {"container": o_Overlay, "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} +# Global Objects +o_backButton = {"container": o_Overlay, "id": "_backButton" , "type": "BackButton" } +o_closeButton = {"container": o_Overlay, "id": "_closeButton", "type": "CloseButton" } -o_textVolume_Text = {"container": o_Overlay, "id": "_textVolume", "type": "Text", "unnamed": 1, "visible": True} +# Treatment Adjustment Ultrafiltration +## Start Screen +o_treatmentAdjustmentUltrafiltrationStart_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationStart" , "type": "ContentItem" } +o_treatmentAdjustmentUltrafiltrationStart_VolumeProgress = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id": "_progressbarex" , "type": "ProgressBarEx" } +o_treatmentAdjustmentUltrafiltrationStart_PauseButton = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id": "_pauseButton" , "type": "TouchRect" } +o_treatmentAdjustmentUltrafiltrationStart_InformationText = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id": "_informationText" , "type": "Text" } +o_treatmentAdjustmentUltrafiltrationStart_NotificationBar = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id": "_notification" , "type": "NotificationBar" } -o_volumeSlider_Slider = {"container": o_Overlay, "id": "_volumeSlider", "type": "Slider", "unnamed": 1, "visible": True} -o_treatmentStart_NotificationBar_NotificationBar = {"container": o_treatmentStart_TreatmentStart, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} -o_treatmentStart_0_000_Text = {"container": o_treatmentStart_TreatmentStart, "occurrence": 2, "text": "0.000", "type": "Text", "unnamed": 1, "visible": True} -increase_UF_Rate_Text = {"container": o_Overlay, "text": "Increase UF Rate", "type": "Text", "unnamed": 1, "visible": True} -increase_Treatment_Duration_Text = {"container": o_Overlay, "text": "Increase Treatment Duration", "type": "Text", "unnamed": 1, "visible": True} -o_image_Image_2 = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClock+", "type": "Image", "unnamed": 1, "visible": True} -o_image_Image = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iWave+", "type": "Image", "unnamed": 1, "visible": True} -treatmentAdjustmentUltrafiltrationConfirm_TitleText_Text = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationConfirm_TitleText", "type": "Text", "visible": True} +## Paused Screen +o_treatmentAdjustmentUltrafiltrationPaused_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationPaused" , "type": "ContentItem" } +o_treatmentAdjustmentUltrafiltrationPaused_EditButton = {"container": o_treatmentAdjustmentUltrafiltrationPaused_Screen, "id": "_editButton" , "type": "TouchRect" } +o_treatmentAdjustmentUltrafiltrationPaused_ResumeButton = {"container": o_treatmentAdjustmentUltrafiltrationPaused_Screen, "id": "_resumeButton" , "type": "TouchRect" } +o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar = {"container": o_treatmentAdjustmentUltrafiltrationPaused_Screen, "id": "_notification" , "type": "NotificationBar" } +o_treatmentAdjustmentUltrafiltrationPaused_PausedText = {"container": o_treatmentAdjustmentUltrafiltrationPaused_Screen, "id": "_pausedNotification", "type": "NotificationBar" } -# Treatment Adjustment Ultrafiltration -## Start Screen -o_treatmentAdjustmentUltrafiltrationStart_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationStart" , "type": "ContentItem" } -o_treatmentAdjustmentUltrafiltrationStart_VolumeProgress = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id" : "_progressbarex" , "type": "ProgressBarEx"} -o_treatmentAdjustmentUltrafiltrationStart_PauseButton = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id" : "_pauseButton" , "type": "TouchRect" } -o_treatmentAdjustmentUltrafiltrationStart_InformationText = {"container": o_treatmentAdjustmentUltrafiltrationStart_Screen, "id" : "_informationText" , "type": "Text" } +## Edit Screen +o_treatmentAdjustmentUltrafiltrationEdit_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationEdit" , "type": "ContentItem" } +o_treatmentAdjustmentUltrafiltrationEdit_NextButton = {"container": o_treatmentAdjustmentUltrafiltrationEdit_Screen, "id": "_nextButton" , "type": "TouchRect" } +o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar = {"container": o_treatmentAdjustmentUltrafiltrationEdit_Screen, "id": "_notification" , "type": "NotificationBar" } +o_treatmentAdjustmentUltrafiltrationEdit_PausedText = {"container": o_treatmentAdjustmentUltrafiltrationEdit_Screen, "id": "_pausedNotification", "type": "NotificationBar" } +o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider = {"container": o_treatmentAdjustmentUltrafiltrationEdit_Screen, "id": "_volumeSlider" , "type": "Slider" } ## Confirm Screen o_treatmentAdjustmentUltrafiltrationConfirm_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentUltrafiltrationConfirm" , "type": "ContentItem" } -o_treatmentAdjustmentUltrafiltrationConfirm_Title = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id" : "_titleText" , "type": "Text" } +o_treatmentAdjustmentUltrafiltrationConfirm_Title = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_titleText" , "type": "Text" } +o_treatmentAdjustmentUltrafiltrationConfirm_ConfirmButton = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_confirmButton" , "type": "TouchRect" } +o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_notification" , "type": "NotificationBar" } +o_treatmentAdjustmentUltrafiltrationConfirm_PausedText = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_pausedNotification" , "type": "NotificationBar" } o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_rateAdjustmentButton" , "type": "UltrafiltrationButton"} o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration = {"container": o_treatmentAdjustmentUltrafiltrationConfirm_Screen, "id": "_durationAdjustmentButton", "type": "UltrafiltrationButton"} ### Rate Option @@ -152,3 +152,4 @@ + Index: tst_Treatment_Adjustment_Ultrafiltration/test.py =================================================================== diff -u -r59636301fab15c81ae50b7ea7546b79e494189f8 -r92a813d62f26a3e5ddf77b3b58b5c965fadeffb5 --- tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision 59636301fab15c81ae50b7ea7546b79e494189f8) +++ tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision 92a813d62f26a3e5ddf77b3b58b5c965fadeffb5) @@ -12,33 +12,30 @@ # author Behrouz NematiPour # -import squish -import test - import utils import denaliMessages from names import * -eInvalid = 0 -eIncrease = 1 -eDecrease = 2 -stringInvalid = "Invalid" -stringInvalidDetail = "Due to out of range adjustment, this option\nis disabled." +eInvalid = 0 +eIncrease = 1 +eDecrease = 2 +stringInvalid = "Invalid" +stringInvalidTxt= "Due to out of range adjustment, this option\nis disabled." -stringIncrease = "Increase" -stringDecrease = "Decrease" +stringIncrease = "Increase" +stringDecrease = "Decrease" stringIncreases = "increases" stringDecreases = "decreases" -_Accepted = 0 -_Reason = 0 -_Volume = 0 -_Duration = 0 -_DurationDiff = 0 -_Rate = 0 -_RateDiff = 0 -_RateOld = 0 +_Accepted = 0 +_Reason = 0 +_Volume = 0 +_Duration = 0 +_DurationDiff = 0 +_Rate = 0 +_RateDiff = 0 +_RateOld = 0 def InDeCreaseS(vIncrease, vInvalid, vSingular): if vInvalid: @@ -55,42 +52,42 @@ return stringDecrease return "" - +# --------------- Main Treatment def gotoScreenNtest_Contains_Ultrafiltration(): - squish.mouseClick(squish.waitForObject(o_treatmentHome_startTreatment)) - test.compare(squish.waitForObjectExists(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).visible, True) + mouseClick(waitForObject(o_treatmentHome_startTreatment)) + test.compare(waitForObjectExists(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).visible, True) def startNTestTreatmentUltrafiltration(vMinUF, vMaxUF): for i in range(vMinUF, vMaxUF+1, 10): denaliMessages.setTreatmentUltrafiltration(vMaxUF, i, 1, 1, 1, 1, 1) - test.compare(utils.l2ml(squish.waitForObjectExists(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), i) + test.compare(utils.l2ml(waitForObjectExists(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), i) - + def gotoScreen_UltrafiltrationAdjustment(): # [Section Click] - squish.mouseClick(squish.waitForObject(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration)) + mouseClick(waitForObject(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration)) utils.waitForGUI(1) +# --------------- Start Screen def testScreen_Start_Ultrafiltration(): # [Start Screen] - test.compare(squish.waitForObjectExists(o_treatmentAdjustmentUltrafiltrationStart_Screen).visible, True) + test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationStart_Screen ).visible , True ) ## Pause Button - test.compare(str(squish.waitForObjectExists(o_pauseButton_TouchRect).text.text), "PAUSE ULTRAFILTRATION") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationStart_PauseButton).text.text), "PAUSE ULTRAFILTRATION") - + def pause_Request(): # [Request Pause] - squish.mouseClick(squish.waitForObject(o_pauseButton_TouchRect)) + mouseClick(waitForObject(o_treatmentAdjustmentUltrafiltrationStart_PauseButton)) def pause_RejectNTest(): # [Reject Pause] denaliMessages.setTreatmentAdjustUltrafiltrationRejected() - # [Reject Notification] - test.compare(str(squish.waitForObjectExists(notificationBar_NotificationBar).text), "Unable to Pause Ultrafiltration or already paused") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationStart_NotificationBar).text), "Unable to Pause Ultrafiltration or already paused") def pause_Accept(): @@ -99,26 +96,28 @@ utils.waitForGUI(1) +# --------------- Paused Screen def testScreen_Paused_Ultrafiltration(): # [Paused Screen] - # # Edit Button - test.compare(str(squish.waitForObjectExists(o_editButton_TouchRect).text.text), "EDIT ULTRAFILTRATION VOLUME") - # # Resume Button - test.compare(str(waitForObjectExists(o_resumeButton_TouchRect).text.text), "RESUME ULTRAFILTRATION") - # # Paused Notification - test.compare(str(waitForObjectExists(o_pauseNotificationBar_NotificationBar).text), "Ultrafiltration is paused.") + test.compare(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationPaused_Screen).visible, True) + ## Edit Button + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationPaused_EditButton).text.text), "EDIT ULTRAFILTRATION VOLUME") + ## Resume Button + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationPaused_ResumeButton).text.text), "RESUME ULTRAFILTRATION") + ## Paused Notification + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationPaused_PausedText).text), "Ultrafiltration is paused.") def resume_Request(): # [Request Resume] - mouseClick(waitForObject(o_resumeButton_TouchRect)) + mouseClick(waitForObject(o_treatmentAdjustmentUltrafiltrationPaused_ResumeButton)) def resume_RejectNTest(): # [Reject Resume] denaliMessages.setTreatmentAdjustUltrafiltrationRejected() # [Reject Notification] - test.compare(str(waitForObjectExists(notificationBar_NotificationBar).text), "Unable to Resume Ultrafiltration or already running") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), "Unable to Resume Ultrafiltration or already running") def resume_Accept(): @@ -134,75 +133,115 @@ def testScreen_Paused_Notification(): # [Section Paused Notification] - test.compare(str(waitForObjectExists(o_treatmentStart_NotificationBar_NotificationBar).text), "Ultrafiltration Paused") - test.compare(str(waitForObjectExists(o_treatmentStart_0_000_Text).color.name), "#696969") + test.compare(str(waitForObjectExists(o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).notification.text), "Ultrafiltration Paused") def edit_Clicked(): - mouseClick(waitForObject(o_editButton_TouchRect)) + mouseClick(waitForObject(o_treatmentAdjustmentUltrafiltrationPaused_EditButton)) utils.waitForGUI(1) def testScreen_Edit_Ultrafiltration(): - test.compare(str(waitForObjectExists(o_nextButton_TouchRect).text.text), "NEXT") - test.compare(str(waitForObjectExists(notificationBar_NotificationBar).text), "Ultrafiltration is paused.") - test.compare(str(waitForObjectExists(o_backButton_BackButton).text.text), "BACK") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_NextButton).text.text), "NEXT") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_PausedText).text), "Ultrafiltration is paused.") + test.compare(str(waitForObjectExists(o_backButton).text.text), "BACK") def back_Clicked(): - mouseClick(waitForObject(o_backButton_BackButton)) + mouseClick(waitForObject(o_backButton)) def edit_RejectNTest(): denaliMessages.setTreatmentAdjustUltrafiltrationEditRejected(12) - test.compare(waitForObjectExists(notificationBar_NotificationBar).visible, True) + test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).visible, True) #this error message needs to be changed later when translated. - test.compare(str(waitForObjectExists(notificationBar_NotificationBar).text), "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).text), "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE") -def next_Clicked(vAccepted, vReason, vVolume, vDuration, vDurationDiff, vRate, vRateDiff, vRateOld): - global _Accepted - global _Reason - global _Volume - global _Duration - global _DurationDiff - global _Rate - global _RateDiff - global _RateOld - _Accepted = vAccepted - _Reason = vReason - _Volume = vVolume - _Duration = vDuration - _DurationDiff = vDurationDiff - _Rate = vRate - _RateDiff = vRateDiff - _RateOld = vRateOld +def update_Adjustment_Ranges(): + # HD sends Ultrafiltration ranges + denaliMessages.setTreatmentParamRanges(0, 0, 100, 4800, 0, 0) + + +def user_Adjusted(): + # Edit Screen updates Ultrafiltration ranges on Slider upon Receiving Ranges + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).minText.text), "0.100") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).maxText.text), "4.800") + # Edit Screen updated the adjusted Ultrafiltration value + mouseClick(waitForObject(o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider), 430, 1, Qt.LeftButton) + + +def adjustmentResponse(): denaliMessages.setTreatmentAdjustUltrafiltrationEditResponse(_Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld) + + +def next_Accepted(vVolume, vRateState, vDurationState): + global _Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld + _Accepted = 1; _Reason = 0; + _RateOld = 10; _Volume = vVolume + mDurationOld = 60 # minute + + if vRateState == eIncrease: + _Rate = 30 # mL/Min + _RateDiff = _Rate - _RateOld + + if vRateState == eDecrease: + _Rate = 5 # mL/Min + _RateDiff = _Rate - _RateOld + + if vRateState == eInvalid: + _Rate = 0 + _RateDiff = 0 + + if vDurationState == eIncrease: + _Duration = 1800 # minute + _DurationDiff = _Duration - mDurationOld + + if vDurationState == eDecrease: + _Duration = 30 # minute + _DurationDiff = _Duration - mDurationOld + if vDurationState == eInvalid: + _Duration = 0 + _DurationDiff = 0 + adjustmentResponse () + testScreen_Confirm_Ultrafiltration() + testScreen_Confirm_OptionRate (vRateState ) + testScreen_Confirm_OptionDuration (vDurationState) + + def testScreen_Confirm_Ultrafiltration(): + #[Confrim Screen] test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_Screen).visible, True) + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_PausedText).text), "Ultrafiltration is paused.") + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_ConfirmButton).text.text), "CONFIRM") + test.compare(str(waitForObjectExists(o_backButton).text.text), "BACK") + #[Confirm Title / Ultrafiltration Volume] test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_Title ).text), "To confirm new UF Volume ({:.3f}),\nselect a treatment adjustment:".format(utils.ml2l(_Volume))) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate ).selected , False) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).selected , False) -def testScreen_Confirm_OptionRate(): +def testScreen_Confirm_OptionRate(vIncrease): # Rate Option mInvalid = _Rate == 0 and _RateDiff == 0 mIncrease = _RateDiff > 0 mInDeCrease = InDeCreaseS(mIncrease, mInvalid, False) mInDeCreases = InDeCreaseS(mIncrease, mInvalid, True ) + test.compare(mIncrease, vIncrease == eIncrease) + test.compare(mInvalid , vIncrease == eInvalid ) + test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).visible , True ) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).disabled , mInvalid) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).isIncrease , mIncrease) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate_Title ).visible , True) test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).title ), "{} UF Rate".format(mInDeCrease)) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate_Description ).visible , True) if mInvalid: - test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).description ),stringInvalidDetail) + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).description ),stringInvalidTxt) else: test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate).description ), "The rate {} by {} mL/min,\nthe treatment duration remains the same.".format(mInDeCreases, abs(_RateDiff))) @@ -212,20 +251,23 @@ test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonRate_DiffImageClock).visible , False) -def testScreen_Confirm_OptionDuration(): +def testScreen_Confirm_OptionDuration(vIncrease): mInvalid = _Duration == 0 and _DurationDiff == 0 mIncrease = _DurationDiff > 0 mInDeCrease = InDeCreaseS(mIncrease, mInvalid, False) mInDeCreases = InDeCreaseS(mIncrease, mInvalid, True ) + test.compare(mIncrease, vIncrease == eIncrease) + test.compare(mInvalid , vIncrease == eInvalid ) + test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).visible , True ) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).disabled , mInvalid) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).isIncrease , mIncrease ) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration_Title ).visible , True ) test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).title ), "{} Treatment Duration".format(mInDeCrease)) test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration_Description ).visible , True ) if mInvalid: - test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).description ),stringInvalidDetail) + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).description ),stringInvalidTxt) else: test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration).description ), "The rate remains, the treatment\nduration {} by {} minutes.".format(mInDeCreases, abs(_DurationDiff))) @@ -235,10 +277,20 @@ test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_AdjustmentButtonDuration_DiffImageWave ).visible , False) +def confirm_RejectNTest(): + denaliMessages.setTreatmentAdjustUltrafiltrationConfirmRejected(2) + test.compare( waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).visible, True) + test.compare(str(waitForObjectExists(o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).text ), "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM") + + +def confirm_Accept(vVolume, vDuration, vRate): + denaliMessages.setTreatmentAdjustUltrafiltrationConfirmResponse(1, 0, vVolume, vDuration, vRate) + + def main(): utils.tstStart() - startApplication("denali") + startApplication("denali") # denaliSquish utils.waitForGUI(1) gotoScreenNtest_Contains_Ultrafiltration() @@ -248,6 +300,11 @@ # Start Screen upon User touch while IS NOT PAUSED testScreen_Start_Ultrafiltration() + closeScreen() # Back to main + + gotoScreen_UltrafiltrationAdjustment() + + testScreen_Start_Ultrafiltration() pause_Request() pause_RejectNTest() # Test Notification pause_Accept() @@ -293,58 +350,86 @@ # Edit Screen upon Used Edit Button edit_Clicked() - # HD sends Ultrafiltration ranges - denaliMessages.setTreatmentParamRanges(0, 0, 100, 4800, 0, 0) + update_Adjustment_Ranges() + + user_Adjusted() - # Edit Screen updates Ultrafiltration ranges on Slider upon Receiving Ranges - test.compare(str(waitForObjectExists(o_volumeSlider_Slider).minText.text), "0.100") - test.compare(str(waitForObjectExists(o_volumeSlider_Slider).maxText.text), "4.800") + next_Accepted(2400, eIncrease, eIncrease) + back_Clicked() - # Edit Screen updated the adjusted Ultrafiltration value - mouseClick(waitForObject(o_volumeSlider_Slider), 430, 1, Qt.LeftButton) - - test.compare(str(waitForObjectExists(o_textVolume_Text).text), "2.400") - mouseClick(waitForObject(o_nextButton_TouchRect)) - # Edit Rejected edit_RejectNTest() + # Some of this test may never happen but GUI should work as developed + # So Volume is not necessarily correct - # Rate : Increate , Durtation : Increate - # Edit Accepted - next_Clicked(1, 0, 2400, 3 * 60, 2 * 60, 30, 20, 10) - testScreen_Confirm_Ultrafiltration() - testScreen_Confirm_OptionRate () - testScreen_Confirm_OptionDuration () - + + # ----- Rate Inc + next_Accepted(2400, eIncrease, eIncrease) back_Clicked() - # Rate : Decrease , Durtation : Decrease - # Edit Accepted - next_Clicked(1, 0, 300, 30, -30, 5, -5, 10) - testScreen_Confirm_Ultrafiltration() - testScreen_Confirm_OptionRate () - testScreen_Confirm_OptionDuration () - + next_Accepted(2400, eIncrease, eDecrease) back_Clicked() - # Rate : Disable , Durtation : Increase - # Edit Accepted - next_Clicked(1, 0, 4800, 8 * 60, 7 * 60, 0, 0, 10) - testScreen_Confirm_Ultrafiltration() - testScreen_Confirm_OptionRate () - testScreen_Confirm_OptionDuration () - + next_Accepted(2400, eIncrease, eInvalid ) back_Clicked() + + # ----- Rate Dec + next_Accepted( 300, eDecrease, eIncrease) + back_Clicked() + + next_Accepted( 300, eDecrease, eDecrease) + back_Clicked() + + next_Accepted( 300, eDecrease, eInvalid ) + back_Clicked() + + # ----- Rate Inv + next_Accepted( 0, eInvalid , eIncrease) + back_Clicked() + + next_Accepted( 0, eInvalid , eDecrease) + back_Clicked() + + next_Accepted( 0, eInvalid , eInvalid ) + back_Clicked() + + # ----- Coverage - Duration Duplicate + next_Accepted(2400, eIncrease, eIncrease) + back_Clicked() + + # ----- Duration Inc + next_Accepted(2400, eIncrease, eIncrease) + back_Clicked() + + next_Accepted(2400, eDecrease, eIncrease) + back_Clicked() + + next_Accepted(2400, eInvalid , eIncrease) + back_Clicked() + + # ----- Duration Dec + next_Accepted( 300, eIncrease, eDecrease) + back_Clicked() + + next_Accepted( 300, eDecrease, eDecrease) + back_Clicked() + + next_Accepted( 300, eInvalid , eDecrease) + back_Clicked() + + # ----- Duration Inv + next_Accepted( 0, eIncrease, eInvalid ) + back_Clicked() + + next_Accepted( 0, eDecrease, eInvalid ) + back_Clicked() + + next_Accepted( 0, eInvalid , eInvalid ) - # Rate : Disable , Durtation : Increase - # Edit Accepted - next_Clicked(1, 0, 2400, 0, 0, 30, 20, 10) - testScreen_Confirm_Ultrafiltration() - testScreen_Confirm_OptionRate () - testScreen_Confirm_OptionDuration () + confirm_RejectNTest() - #confirm_Clicked() + confirm_Accept(1200, 2 *60, 20) utils.tstDone()