Index: shared/scripts/configuration/config.py =================================================================== diff -u -r6008f9330e1369fc6389162dabaf752b4ca704f8 -ref981744e6899b22a40fef4a8d74db9a4e930575 --- shared/scripts/configuration/config.py (.../config.py) (revision 6008f9330e1369fc6389162dabaf752b4ca704f8) +++ shared/scripts/configuration/config.py (.../config.py) (revision ef981744e6899b22a40fef4a8d74db9a4e930575) @@ -137,12 +137,11 @@ "duration" : [60, 15, 26.6], "heparin_dispensing_rate" : [0.2, 0.1, 93], "heparin_bolus_volume" : [0.2, 0.1, 41], - "heparin_stop_time" : [0, 10, 15.5], - "saline_bolus" : [100, 100, 375], + "heparin_stop_time" : [0, 10, 15.75], + "saline_bolus" : [100, 100, 425], "dialysate_temperature" : [35, 0.5, 187.5], "arterial_pressure_limit_high" : [20, 10, 11.931], - "blood_pressure_measurement_interval" : [0, 5, 62], - "rinseback_flow_rate" : [50, 25, 187], + "blood_pressure_measurement_interval" : [0, 5, 50], } #Alarms location Index: shared/scripts/configuration/strings.py =================================================================== diff -u -rf24d9f0bfc30fa024ceef73cb8b25efb86a70f70 -ref981744e6899b22a40fef4a8d74db9a4e930575 --- shared/scripts/configuration/strings.py (.../strings.py) (revision f24d9f0bfc30fa024ceef73cb8b25efb86a70f70) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision ef981744e6899b22a40fef4a8d74db9a4e930575) @@ -301,7 +301,8 @@ #post treatment review TREATMENT_REVIEW_TITLE_TEXT = "Treatment Review" HEPARIN_TYPE = "UFH 1,000 IU/mL" -ACID_CONCENTRATE = ["08-1251-1", "08-2251-0", "08-3251-9"] +#ACID_CONCENTRATE = ["08-1251-1", "08-2251-0", "08-3251-9"] +ACID_CONCENTRATE = ["1.0 K 2.5 Ca", "2.0 K 2.5 Ca", "3.0 K 2.5 Ca"] BICARBONATE_CONCENTRATE = "Fres. Centrisol" DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe", "F Optiflux F200NRe"] CODE_TEXT = "Code: " Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7883bcc9c71da71d09d48d8998a99a9b8ad0640a -ref981744e6899b22a40fef4a8d74db9a4e930575 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7883bcc9c71da71d09d48d8998a99a9b8ad0640a) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision ef981744e6899b22a40fef4a8d74db9a4e930575) @@ -169,33 +169,34 @@ test.compare(str(input_field.text), "", "Input field should be empty") test.endSection() -def scroll_to_zone(zone=None, screen_object=None, direction = None): +def scroll_to_zone(targetObject=None, screen_object=None, direction = None, yDegreeScrollDisplace = 20): """ scroll to the to the value if object is hidden - @param value - (obj) value object - @param container - (obj) Container of the value + @param targetObject - (obj) value object + @param screen_object - (obj) Container of the value + @param direction: None indicate a horizontal direction, anything else a vertical direction + @param yDegreeScrollDisplace: The amount of degrees in the y direction to scroll @return boolean true and false """ counter = 0 + + # Figure out the screen's dimensions + ScreenObj = squish.findObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + while counter <= 100: - try: - counter += 1 - squish.findObject(zone) - squish.snooze(0.5) - if check_if_object_is_within_the_container(obj=zone, container=screen_object): - return True - else: - raise RuntimeError - except RuntimeError: - ScreenObj = squish.findObject(screen_object) - screenHeight = pyInt(ScreenObj.height) - screenWidth = pyInt(ScreenObj.width) + counter += 1 + squish.findObject(targetObject) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=targetObject, container=screen_object): + return True + else: if direction is None: - squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -(screenHeight-460), squish.Qt.NoModifier) + squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -yDegreeScrollDisplace, squish.Qt.NoModifier) else: - squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) - - raise LookupError("zone object is not in view to the user after trying 100 times") + squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, yDegreeScrollDisplace, squish.Qt.NoModifier) + raise LookupError("targetObject object is not in view to the user after trying 100 times") def get_alarm_id_obj(id): Index: shared/scripts/names.py =================================================================== diff -u -rf24d9f0bfc30fa024ceef73cb8b25efb86a70f70 -ref981744e6899b22a40fef4a8d74db9a4e930575 --- shared/scripts/names.py (.../names.py) (revision f24d9f0bfc30fa024ceef73cb8b25efb86a70f70) +++ shared/scripts/names.py (.../names.py) (revision ef981744e6899b22a40fef4a8d74db9a4e930575) @@ -449,6 +449,10 @@ o_PreTreatmentCreate_rangeRect_RangeRect_Venous = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rangeRect", "occurrence": 2, "type": "RangeRect", "unnamed": 1, "visible": True} o_PreTreatmentCreate_rangeRect_RangeRect_Artery = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rangeRect", "occurrence": 1, "type": "RangeRect", "unnamed": 1, "visible": True} o_PreTreatmentCreate_Heparin_Type_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Heparin Type", "type": "Text", "unnamed": 1, "visible": True} + +o_PreTreatmentCreate_DecrementButton = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id":"_decrementValueButton", "type": "TouchRect", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_IncrementButton = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id":"_incrementValueButton", "type": "TouchRect", "unnamed": 1, "visible": True} + # operating parameters object property's o_PreTreatmentCreate_heparinTypeRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinTypeRect0", "type": "TouchRect", "visible": True} o_PreTreatmentCreate_acidConcentrateRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect0", "type": "TouchRect", "visible": True} @@ -690,25 +694,37 @@ o_PreTreatmentBase_swipeview_SwipeView_WaterSample = {"container": o_preTreatmentWaterSampleStack_PreTreatmentBase_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView"} o_PreTreatmentBase_swipeview_SwipeView_Consumables = {"container": o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView"} -o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesCartridgeInstallation"} +o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase"} o_preTreatmentDisposablesCartridgeInstallation_swipeview_SwipeView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView"} -o_next_button_cartridge_installation = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase, "text": "NEXT", "type": "Text"} -o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesCartridgeConnetion", "type": "TreatmentFlowBase"} -o_preTreatmentDisposablesCartridgeConnetion_swipeview_SwipeView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView"} -o_next_button_cartridge_connection = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase, "text": "NEXT", "type": "Text"} + +o_next_button_cartridge_installation = {"container": {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesCartridgeInstallation", "type": "PreTreatmentBase"}, "type":"ConfirmButton", "id":"_confirmButton"} +o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "id":"_preTreatmentDisposablesCartridgeConnetion", "objectName": "_PreTreatmentBase", "type": "PreTreatmentBase"} +#PreTreatment Disposables stack +o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_PreTreatmentBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesCartridgeConnetion", "type": "PreTreatmentBase", "visible": True} +o_preTreatmentDisposablesStack_swipeView = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "id": "_swipeview", "type": "SwipeView"} +o_preTreatmentDisposablesCartridgeConnection_instrView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_PreTreatmentBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1, "visible": True} + +o_next_button_cartridge_connection = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_PreTreatmentBase, "objectName": "_confirmButton", "type": "ConfirmButton", "visible": True} o_next_button_heparinsyringe = {"container": o_Gui_MainView, "text": "NEXT", "type": "Text", "unnamed": 1, "visible": True} + o_preTreatmentDisposablesStack_preTreatmentDisposablesSalineBag_TreatmentFlowBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesSalineBag", "type": "TreatmentFlowBase"} +o_preTreatmentDisposablesSalineBag_TreatmentFlowBase_instrView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesSalineBag_TreatmentFlowBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1, "visible": True} o_preTreatmentDisposablesSalineBag_swipeview_SwipeView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesSalineBag_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView"} -o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase"} -o_PreTreatmentBase_swipeview_SwipeView_3 = {"container": o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} + +o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack, "id": "_preTreatmentPatientConnection", "type": "PreTreatmentBase"} +o_PreTreatmentBaseConnection_instrView = {"container": o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1, "visible": True} +o_PreTreatmentBaseStartTx_flowBase = {"container": o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack, "type": "PreTreatmentBase", "visible": True} +o_PreTreatmentBaseStartTx_instrView = {"container": o_PreTreatmentBaseStartTx_flowBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1, "visible": True} o_skip_button = {"container": o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase, "text": "SKIP", "type": "Text", "unnamed": 1, "visible": True} o_interval_obj = {"container":o_treatmentStack_treatmentHome_TreatmentHome, "id": "_text", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "Rectangle", "unnamed": 1, "visible": True} o_PreTreatmentCreate_heparinDispensingRateSwitch_Switch = {"checkable": True, "container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinDispensingRateSwitch", "type": "Switch", "unnamed": 1, "visible": True} o_PreTreatmentCreate_heparinBolusVolumeSwitch_Switch = {"checkable": True, "container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_heparinBolusVolumeSwitch", "type": "Switch", "unnamed": 1, "visible": True} o_PreTreatmentCreate_OFF_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "OFF", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_OFF_Text_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "occurrence": 2, "text": "OFF", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_BPInterval_Switch = {"checkable": True, "container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodPressureIntervalSwitch", "type": "Switch", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_BPInterval_OFF_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "OFF", "type": "Text", "unnamed": 1, "visible": True} # instructions for rinseback setup o_EndTreatmentRinsebackInit_swipeview_SwipeView = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} @@ -730,9 +746,10 @@ o_disposablesRemovalConfirm_swipeview_SwipeView = {"container": o_PostTreatmentStack_disposablesRemovalConfirm_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} # instructions for recirculate screen -o_EndTreatmentRecirculateStack_EndTreatmentRecirculateStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRecirculateStack", "type": "EndTreatmentRecirculateStack", "visible": True} -o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase = {"container": o_EndTreatmentRecirculateStack_EndTreatmentRecirculateStack, "objectName": "_EndTreatmentBase", "type": "EndTreatmentBase", "visible": True} +o_EndTreatmentRecirculateStack_EndTreatmentRecirculateStack = {"container": o_Gui_MainView, "objectName": "_recirculateRecirculateStack", "type": "EndTreatmentRecirculateStack", "visible": True} +o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase = {"container": o_EndTreatmentRecirculateStack_EndTreatmentRecirculateStack, "objectName": "_EndTreatmentBase", "type": "RecirculateBase", "visible": True} o_EndTreatmentBase_swipeview_SwipeView = {"container": o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} + o_instruction = {"type": "Text", "unnamed": 1, "visible": True} o_right_arrow = {"id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} o_image_path = {"type": "Image", "id": "_image"} @@ -1054,4 +1071,6 @@ o_SettingsBase_Failed_to_set_subnet_mask_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "Failed to set subnet mask.", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_Failed_to_set_DNS_Text = {"container": o_SettingsBase_SettingsWiFi, "text": "Failed to set DNS.", "type": "Text", "unnamed": 1, "visible": True} o_SettingsBase_TextField = {"container": o_SettingsBase_SettingsExportLogs, "echoMode": 0, "type": "TextField", "unnamed": 1, "visible": True} +o_preTreatmentDisposablesStack_preTreatmentDisposablesHeparinSyringe_PreTreatmentBase = {"container": o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, "objectName": "_preTreatmentDisposablesHeparinSyringe", "type": "PreTreatmentBase", "visible": True} +o_preTreatmentDisposablesHeparinSyringe_instructionView_InstructionView = {"container": o_preTreatmentDisposablesStack_preTreatmentDisposablesHeparinSyringe_PreTreatmentBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1, "visible": True} Index: tst_instructions_poc/test.py =================================================================== diff -u -r2e73714b63ae5fd2ef8b5acca5043e136454feff -ref981744e6899b22a40fef4a8d74db9a4e930575 --- tst_instructions_poc/test.py (.../test.py) (revision 2e73714b63ae5fd2ef8b5acca5043e136454feff) +++ tst_instructions_poc/test.py (.../test.py) (revision ef981744e6899b22a40fef4a8d74db9a4e930575) @@ -14,12 +14,13 @@ import names import os +import re from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from configuration import config from configuration import utility -from dialin.common.hd_defs import PreTreatmentSubModes, HDOpModes, HDStandbyStates, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates, PreTreatmentWetSelfTestStates +from dialin.common.hd_defs import PreTreatmentSubModes, HDOpModes, HDStandbyStates, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates, PreTreatmentWetSelfTestStates, TreatmentStates, UFStates, SalineBolusStates, HeparinStates,TreatmentRinsebackStates,PreTreatmentRecircStates,TreatmentBloodPrimeStates,TreatmentEndStates,TreatmentStopStates,TreatmentDialysisStates,HDInitStates from dialin.hd.reservoirs import HDReservoirStates from dialin.ui.utils import waitForGUI @@ -37,9 +38,39 @@ title_count_dict = {} IMAGE_READY = 1 image_list_from_location = os.listdir(config.EXPECTED_IMAGE_LOCATION) -text_obj_names = [names.o_PreTreatmentBase_swipeview_SwipeView_WaterSample,names.o_PreTreatmentBase_swipeview_SwipeView_Consumables,names.o_preTreatmentDisposablesCartridgeInstallation_swipeview_SwipeView,names.o_preTreatmentDisposablesCartridgeConnetion_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView,names.o_preTreatmentDisposablesSalineBag_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView_3,names.o_EndTreatmentRinsebackInit_swipeview_SwipeView,names.o_EndTreatmentRinsebackComplete_swipeview_SwipeView,names.o_patientDisconnectionConfirm_swipeview_SwipeView,names.o_disposablesRemovalConfirm_swipeview_SwipeView,names.o_EndTreatmentBase_swipeview_SwipeView] -rightarrow_obj_names = [names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase,names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack,names.o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase,names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit,names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase,names.o_PostTreatmentStack_disposablesRemovalConfirm_TreatmentFlowBase,names.o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase] +# The instruction titles' object name +text_obj_names = [names.o_PreTreatmentBase_swipeview_SwipeView_WaterSample, # Sample ^ Water Sample + names.o_PreTreatmentBase_swipeview_SwipeView_Consumables, # Consumables ^ Consumable Installation + names.o_preTreatmentDisposablesCartridgeInstallation_swipeview_SwipeView, # Disposables ^ Cartridge Installation + names.o_preTreatmentDisposablesStack_swipeView, # PreTreatment Create Screen's title + names.o_preTreatmentDisposablesCartridgeConnection_instrView, # Disposables ^ Cartridge Connection + names.o_preTreatmentDisposablesHeparinSyringe_instructionView_InstructionView, # Heparin Syringe + names.o_preTreatmentDisposablesSalineBag_TreatmentFlowBase_instrView, # Disposables ^ Saline Bag + names.o_PreTreatmentBaseConnection_instrView, # Connection ^ Patient Connection + names.o_PreTreatmentBaseStartTx_instrView, # Start Treatment + names.o_EndTreatmentRinsebackInit_swipeview_SwipeView, # Rinseback setup + names.o_EndTreatmentRinsebackComplete_swipeview_SwipeView, # Rinseback Complete + names.o_patientDisconnectionConfirm_swipeview_SwipeView, # Disconnect Confirm + names.o_disposablesRemovalConfirm_swipeview_SwipeView, # Disposables ^ Disposable Removal + names.o_EndTreatmentBase_swipeview_SwipeView] # End Treatment + +# These are the object names for the instruction view right arrow, None are for the screens that does not have an arrow +rightarrow_obj_names = [names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase, + names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase, + names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase, + names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, + names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, + names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, + names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack, + names.o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, + None, + names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, + None, + names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase, + names.o_PostTreatmentStack_disposablesRemovalConfirm_TreatmentFlowBase, + names.o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase] + def get_text_obj(screen_obj,text): """ To obtain a text object based on text provided @@ -90,7 +121,7 @@ continue elif "#" not in line: conf_data = line.split("=") - print(f"~~~{conf_data}~~~") + print(f"~{count}~~{conf_data}~~~") if length > 2: count += 1 instructions.append(conf_data[0]) @@ -103,36 +134,64 @@ count = 0 title_count_dict.update(dict(zip(title_list,count_of_instructions))) -def verify_instruction_and_image(title,index): +def verify_instruction_and_image(title,index,textObjectName, rightArrowObject): """ This method is used to verify the instruction and image on present screen @param - (str) title: screen title @param - (int) index: index of data from Instructions.conf file @return - (int) index """ - test.startSection("Verifying instruction and image from" +title+ "screen") + test.startSection("Verifying instruction and image from " +title+ " screen") for count in range(title_count_dict.get(title)): - test.log(f"********************{title_count_dict.get(title)}") + test.log(f"********************Instr Page count {title_count_dict.get(title)}") instruction_text = instructions[index] image_text = image_names[index] instruction_text = instruction_text.replace('\\n','\n') index += 1 #to remove last empty character from the string if instruction_text[-1] == " ": instruction_text = instruction_text.rstrip() - test.log(str(text_obj_names[0])) - image_status = waitForObjectExists(get_img_obj(text_obj_names[0],"{}{}".format(config.IMAGE_LOCATION,image_text))).status + test.log(str(textObjectName)) + test.log(str(rightArrowObject)) + image_status = waitForObjectExists(get_img_obj(textObjectName,"{}{}".format(config.IMAGE_LOCATION,image_text))).status test.compare(str(image_status),str(IMAGE_READY),image_text + " - image title is valid and loaded on UI.") - test.compare(str(waitForObject(get_text_obj(text_obj_names[0],instruction_text)).text),instruction_text, "Instruction from" +title+ "screen is visible and matched") + test.compare(str(waitForObject(get_text_obj(textObjectName,instruction_text)).text),instruction_text, "Instruction from" +title+ "screen is visible and matched") if object.exists(names.o_next_button_ws): mouseClick(waitForObject(names.o_next_button)) if object.exists(names.o_fail_button_ws): mouseClick(waitForObject(names.o_fail_button)) - if object.exists(get_rightarrow_obj(rightarrow_obj_names[0])): - mouseClick(waitForObject(get_rightarrow_obj(rightarrow_obj_names[0]))) + if object.exists(get_rightarrow_obj(rightArrowObject)): + mouseClick(waitForObject(get_rightarrow_obj(rightArrowObject))) test.endSection() return index +def test_sliderArrows(sliderObject = None, occurenceIndex = 0, currentValue = 0, changeAmount = 0, valuesKey = "", configStr = ""): + """ + Method to test a slider's arrows (increment and decrement) effect on the slider's actual value + @param sliderObject: The slider object + @param currentValue: The slider's current value set when calling this method + @param valuesKey : the string key of this slider's value in the CREATE_TREATMENT_SLIDER_VALUES array + @param configStr : the configuration string + """ + # set the buttons to the index expected + names.o_PreTreatmentCreate_IncrementButton["occurrence"] = occurenceIndex + names.o_PreTreatmentCreate_DecrementButton["occurrence"] = occurenceIndex + + # increment slider value + mouseClick(waitForObject(names.o_PreTreatmentCreate_IncrementButton)) + test.compare(format(waitForObjectExists(sliderObject).value, '.2f'), format(currentValue+changeAmount, '.2f'), valuesKey+" slider value should set to "+str(currentValue+changeAmount)) + + # wait for GUi to update + utils.waitForGUI(0.2) + + # decrement slider value + mouseClick(waitForObject(names.o_PreTreatmentCreate_DecrementButton)) + test.compare(format(waitForObjectExists(sliderObject).value, '.2f'), format(currentValue, '.2f'), valuesKey+" slider value should set to "+str(currentValue)) + + #reset the index to 0 + names.o_PreTreatmentCreate_IncrementButton["occurrence"] = 0 + names.o_PreTreatmentCreate_DecrementButton["occurrence"] = 0 + def verify_create_custom_treatment_parameter(): """ Method to set create custom treatment slider value based on slider buffer @@ -141,60 +200,76 @@ test.compare(waitForObject(names.o_PreTreatmentCreate_Create_a_Custom_Treatment_Text).text, config.TREATMENT_TITLE, "Title text should be ->"+str(config.TREATMENT_TITLE)) test.compare(waitForObject(names.o_PreTreatmentCreate_PRESCRIPTION_Text).text, config.PRESCRIPTION_TITLE, "Title text should be ->"+str(config.PRESCRIPTION_TITLE)) + sliderCount = 0 + #set custom values for parameters + sliderCount+=1 test.startSection("verification of blood flow values") test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment).label, config.BLOOD_FLOW_RATE, "Parameter should be ->"+str(config.BLOOD_FLOW_RATE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, 100, config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) + test_sliderArrows(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, sliderCount, 100, 25, "blood_flow_rate", config.BLOOD_FLOW_RATE) test.endSection() test.startSection("verification of dialysate flow values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment).label, config.DIALYSATE_FLOW_RATE, "Parameter should be ->"+str(config.DIALYSATE_FLOW_RATE)) - test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, 250, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) + test_sliderArrows(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider,sliderCount, 250, 50, "dialysate_flow_rate", config.DIALYSATE_FLOW_RATE) test.endSection() test.startSection("verification of duration values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_duration_SliderCreateTreatment).label, config.DURATION, "Parameter should be -> "+str(config.DURATION)) test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, 60, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) + test_sliderArrows(names.o_PreTreatmentCreate_durationSlider_Slider, sliderCount, 60, 15, "duration", config.DURATION) test.endSection() - #scroll the screen to the title heparin bolus volume - parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) + #scroll the screen to the title heparin dispensing rate + parameter_object = set_parameter_type(text = config.HEPARIN_DISPENSING_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of heparin dispensing rate values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment).label, config.HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(config.HEPARIN_DISPENSING_RATE)) utils.waitForGUI(1) test.compare(waitForObject(names.o_PreTreatmentCreate_OFF_Text).text,"OFF", "Text should be -> "+"OFF") mouseClick(names.o_PreTreatmentCreate_heparinDispensingRateSwitch_Switch) mouseClick(names.o_PreTreatmentCreate_heparinDispensingRateSwitch_Switch) utils.waitForGUI(1) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, 0.8, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) - + test_sliderArrows(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider,sliderCount, 0.8, 0.1, "heparin_dispensing_rate", config.HEPARIN_DISPENSING_RATE) test.endSection() - test.startSection("verification of heparin bolus volume values") + #scroll the screen to the title heparin dispensing rate + parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of heparin bolus volume values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment).label, config.HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(config.HEPARIN_BOLUS_VOLUME)) mouseClick(names.o_PreTreatmentCreate_heparinBolusVolumeSwitch_Switch) mouseClick(names.o_PreTreatmentCreate_heparinBolusVolumeSwitch_Switch) utils.waitForGUI(1) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, 1.4, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) - + test_sliderArrows(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, sliderCount, 1.4, 0.1, "heparin_bolus_volume", config.HEPARIN_BOLUS_VOLUME) test.endSection() #scroll the screen to the title acid concentrate type parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - test.startSection("verification of heparin stop time values") + test.startSection("verification of heparin stop time values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment).label, config.HEPARIN_STOP_TIME, "Parameter should be -> "+str(config.HEPARIN_STOP_TIME)) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, 230, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) - + test_sliderArrows(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, sliderCount, 230, 10, "heparin_stop_time", config.HEPARIN_STOP_TIME) test.endSection() - test.startSection("verification of saline bolus values") + test.startSection("verification of saline bolus values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolus_SliderCreateTreatment).label, config.SALINE_BOLUS_TITLE, "Parameter should be -> "+str(config.SALINE_BOLUS_TITLE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, 100, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS_TITLE) + test_sliderArrows(names.o_PreTreatmentCreate_salineBolusSlider_Slider, sliderCount, 100, 100, "saline_bolus", config.SALINE_BOLUS_TITLE) test.endSection() #scroll the screen to the title acid concentrate type @@ -205,7 +280,7 @@ test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect_GridSelection).labels, config.HEPARIN_TYPE, "Parameter should be -> "+str(config.HEPARIN_TYPE)) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).text.text, config.HEPARIN_TYPE, "heparin text should be :"+ str(config.HEPARIN_TYPE)) - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.endSection() #scroll the screen to the title dialyste rectangle @@ -215,7 +290,7 @@ test.startSection("verification of acid concentrate type") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect_GridSelection).title, config.ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.ACID_CONCENTRATE_TITLE)) mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) - test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).text.text, config.ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) test.endSection() @@ -226,7 +301,7 @@ test.startSection("verification of bicarbonate concentrate rectangle") test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection).title, config.BICARBONATE_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.BICARBONATE_CONCENTRATE_TITLE)) mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) - test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).text.text, config.BICARBONATE_CONCENTRATE, "Bicarbonate concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) test.endSection() @@ -236,38 +311,34 @@ test.startSection("verification of dialysate rectangle") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect_GridSelection).title, config.DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(config.DIALYZER_TYPE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).text.text, config.DIALYZER_TYPE[1], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[1])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect) - test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).text.text, config.DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[0])) test.endSection() #scroll the screen to the title blood pressure measurement interval parameter_object = set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - test.startSection("verification of dialysate temperature values") + test.startSection("verification of dialysate temperature values") + sliderCount+=1 test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment).label, config.DIALYSATE_TEMPERATURE, "Parameter should be -> "+str(config.DIALYSATE_TEMPERATURE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, 35, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) + test_sliderArrows(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, sliderCount, 35, 0.5, "dialysate_temperature", config.DIALYSATE_TEMPERATURE) test.endSection() - - #scroll the screen to the title rinseback flow rate - parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) - utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - - set_arterial_low_and_high() - set_venous_low_and_high() - + test.startSection("verification of blood pressure measurement interval values") + sliderCount+=1 + test.compare(waitForObject(names.o_PreTreatmentCreate_BPInterval_OFF_Text).text,"OFF", "Text should be -> "+"OFF") + mouseClick(waitForObject(names.o_PreTreatmentCreate_BPInterval_Switch)) + mouseClick(names.o_PreTreatmentCreate_BPInterval_Switch) + utils.waitForGUI(1) test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, 25, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) - - test.endSection() - - test.startSection("verification of rinseback flow rate values") - test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) - test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, 50, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) - test.endSection() - + test_sliderArrows(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, sliderCount, 25, 5, "blood_pressure_measurement_interval", config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.endSection() def set_arterial_low_and_high(): @@ -315,80 +386,109 @@ width_buffer = slider_parameter[2] slider_width = ((value - minimum_slider_value)/slider_buffer) * width_buffer utils.waitForGUI(0.3) + waitForObject(slider_object) mouseClick(findObject(slider_object), float(slider_width) , 3, Qt.LeftButton) test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+"slider value should set to"+str(value)) def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) read_data_from_conf_file() - hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value) - + hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,HDStandbyStates.STANDBY_WAIT_FOR_TREATMENT_STATE.value) + + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Pre-Treatment Sample screen") - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_TREATMENT_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_WATER_SAMPLE_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_WAIT_FOR_USER_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE.value, wet_selftests_state=PreTreatmentWetSelfTestStates.WET_SELF_TESTS_START_STATE.value, pretreatment_rsrvr_state=HDReservoirStates.TREATMENT_RESERVOIR_MGMT_START_STATE.value ) - index = verify_instruction_and_image("Water Sample",index = 0) - index = verify_instruction_and_image("Water Sample Result",index = index) - index = verify_instruction_and_image("Water Sample Result Failed",index = index) - text_obj_names.pop(first_index) + index = verify_instruction_and_image("Water Sample",index = 0, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) + index = verify_instruction_and_image("Water Sample Result",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) + index = verify_instruction_and_image("Water Sample Result Failed",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() - + + + # advance the title object + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Pre-Treatment Consumables screen") - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_DISINFECT_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, - no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_SELF_TEST_CONSUMABLE_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_WAIT_FOR_USER_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE.value, wet_selftests_state=PreTreatmentWetSelfTestStates.WET_SELF_TESTS_START_STATE.value, pretreatment_rsrvr_state=HDReservoirStates.TREATMENT_RESERVOIR_MGMT_START_STATE.value) - index = verify_instruction_and_image("Consumables Installation",index = index) - rightarrow_obj_names.pop(first_index) + index = verify_instruction_and_image("Consumables Installation",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() - test.startSection("Method to navigate to create custom treatment to set all parameters") + # advance the title object + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) + test.startSection("Method to navigate to create custom treatment to set all parameters") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TPAR.value , sub_mode = HDStandbyStates.STANDBY_START_STATE.value) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), "abcd") mouseClick(waitForObject(names.o_continue_button)) verify_create_custom_treatment_parameter() test.endSection() - + + # advance the title object + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Pre-Treatment Disposables screen") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_PRET.value , sub_mode = HDStandbyStates.STANDBY_START_STATE.value) - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_DG_FLUSH_TO_START_STATE.value, + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_CART_INSTALL_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value, consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, - no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_START_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE.value, installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_WAIT_FOR_USER_START_STATE.value, recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE.value, wet_selftests_state=PreTreatmentWetSelfTestStates.WET_SELF_TESTS_START_STATE.value, pretreatment_rsrvr_state=HDReservoirStates.TREATMENT_RESERVOIR_MGMT_START_STATE.value) - text_obj_names.pop(first_index) - index = verify_instruction_and_image("Cartridge Installation",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + + index = verify_instruction_and_image("Cartridge Installation",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) + + # advance the title and arrow name + # instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) + instructionScreenObject = text_obj_names.pop(first_index) test.log("Clicking on next button in Cartridge Installation instruction page") - mouseClick(waitForObjectExists(names.o_next_button_cartridge_installation)) - index = verify_instruction_and_image("Cartridge Connection",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + mouseClick(waitForObjectExists(names.o_next_button_cartridge_installation)) + index = verify_instruction_and_image("Cartridge Connection",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) + + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.log("Clicking on next button in Cartridge Connection instruction page") - mouseClick(waitForObjectExists(names.o_next_button_cartridge_connection)) - index = verify_instruction_and_image("Heparin Syringe",index = index) - text_obj_names.pop(first_index) + mouseClick(waitForObjectExists(names.o_next_button_cartridge_connection)) + + # Update instruction text to reflect expected value in instructions string + instructions[20] = re.sub("{.*?}", "0.1mL", instructions[20] ) + hd_simulator.cmd_send_heparin_response(syringePumpVolumeDelivered = 0.2, syringePumpVolumeRequired = 0.1) + index = verify_instruction_and_image("Heparin Syringe",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) + test.log("Clicking on next button in Heparin Syringe instruction page") - mouseClick(waitForObjectExists(names.o_next_button_heparinsyringe)) - index = verify_instruction_and_image("Saline Bag",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + mouseClick(waitForObjectExists(names.o_next_button_heparinsyringe)) + + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) + # index += title_count_dict.get("Heparin Syringe") #skipped Heparin Syringe instructions + index = verify_instruction_and_image("Saline Bag",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() - + + test.log("Navigating to Pre-Treatment Ultrafiltration screen") + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_PATIENT_CONNECTION_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, - no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_START_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE.value, installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_WAIT_FOR_USER_START_STATE.value, @@ -398,62 +498,72 @@ pretreatment_rsrvr_state=HDReservoirStates.TREATMENT_RESERVOIR_MGMT_START_STATE.value ) hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(accepted=True, reason=0) hd_simulator.cmd_send_uf_treatment_response(accepted = True, reason = 0, volume = 120) - test.log("Clicking on skip button in BP/HR screen") - mouseClick(waitForObject(names.o_skip_button)) + + # test.log("Clicking on skip button in BP/HR screen") + # mouseClick(waitForObject(names.o_skip_button)) test.startSection("Navigating to Pre-Treatment Patient Connection screen") - index = verify_instruction_and_image("Patient Connection",index = index) + index = verify_instruction_and_image("Patient Connection",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Pre-Treatment Start screen") hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(accepted=True, reason=0) - index = verify_instruction_and_image("Start Treatment",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + index = verify_instruction_and_image("Start Treatment",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) + test.startSection("Navigating to End Treatment Rinseback Setup screen") - hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_PAUSED_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) - index = verify_instruction_and_image("Rinseback Setup",index = index) - text_obj_names.pop(first_index) + index = verify_instruction_and_image("Rinseback Setup",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to End Treatment Rinseback Complete screen") - hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_PAUSED_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) - index = verify_instruction_and_image("Rinseback Complete",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + index = verify_instruction_and_image("Rinseback Complete",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Post Treatment Disconnection screen") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_POST.value , sub_mode = HDInitStates.POST_STATE_START.value) - index = verify_instruction_and_image("Patient Disconnection",index = index) + index = verify_instruction_and_image("Patient Disconnection",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) mouseClick(waitForObject(names.o_confirm_button_patient_disconnection)) mouseClick(waitForObject(names.o_next_button_review)) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) test.endSection() + # HD Response to confirm/next click + hd_simulator.cmd_send_confirm_post_tx_next(accepted = 1, reason=0) + + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to Post Treatment Disposables screen") - index = verify_instruction_and_image("Disposables Removal",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + index = verify_instruction_and_image("Disposables Removal",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() + # advance the title and arrow name + instructionScreenObject = text_obj_names.pop(first_index) + instructionRightArrow = rightarrow_obj_names.pop(first_index) test.startSection("Navigating to End Treatment Recirculate screen") - hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RECIRC_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, + hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RECIRC_STATE.value, uf_state = UFStates.UF_PAUSED_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) - - - index = verify_instruction_and_image("Recirculate",index = index) - text_obj_names.pop(first_index) - rightarrow_obj_names.pop(first_index) + index = verify_instruction_and_image("Recirculate Disconnect",index = index, textObjectName = instructionScreenObject, rightArrowObject = instructionRightArrow) test.endSection() #TODO :- Disinfect verification