Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r477260ff9a68fb041c2a18cb105267ef315b7c01 -r526042224fcd8b7679060f7f82627a086bf5a92a --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 477260ff9a68fb041c2a18cb105267ef315b7c01) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 526042224fcd8b7679060f7f82627a086bf5a92a) @@ -85,11 +85,15 @@ ACTIVE = 'Active' RESUME = 'Resume' COMPLETE = 'Complete' -HEPARIN = "Heparin" -CREATERX = "Rx" -VALIDATE = "VALIDATE" -CONFIRM = "CONFIRM" -NEXT ="Next" +HEPARIN = 'Heparin' +CREATERX = 'Rx' +VALIDATE = 'VALIDATE' +CONFIRM = 'CONFIRM' +NEXT = 'Next' +AUTO_LOAD = 'Auto Load' +WATER_SAMPLE = 'Water Sample' +START = 'Start' +AUTO_EJECT = 'Auto Eject' # Settings Service DEFAULT_SERVICE_PASSWORD_RAW = "Atal.Matal.22leh" # TODO need to update if we ever change the default @@ -108,3 +112,9 @@ BLOOD_SET_AUTO_LOAD_REJECTION = "[1] Request is not allowed in the current operating mode" BLOOD_SET_AUTO_EJECT_REJECTION = "[1] Request is not allowed in the current operating mode" +#Device Settings +ADVANCED_MODE = "Advanced Mode" + +#Menu Bar +PRESCRIPTIONS = "Prescriptions" +TREATMENT = "Treatment" Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -r477260ff9a68fb041c2a18cb105267ef315b7c01 -r526042224fcd8b7679060f7f82627a086bf5a92a --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 477260ff9a68fb041c2a18cb105267ef315b7c01) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 526042224fcd8b7679060f7f82627a086bf5a92a) @@ -50,7 +50,7 @@ names.o_text_object["text"] = txt return names.o_text_object -def setObjectText(text,obj): +def setObjectText(obj,text): """ Method to set object property based on text @param text : (string) treatment parameter text Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r477260ff9a68fb041c2a18cb105267ef315b7c01 -r526042224fcd8b7679060f7f82627a086bf5a92a --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 477260ff9a68fb041c2a18cb105267ef315b7c01) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 526042224fcd8b7679060f7f82627a086bf5a92a) @@ -258,4 +258,4 @@ o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom= {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1 } o_preTreatmentStack_confirmButton_ConfirmButton = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_confirmButton", "type": "ConfirmButton", "visible": True } o_PostTreatmentStack_PostTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PostTreatmentStack", "type": "PostTreatmentStack", } - + \ No newline at end of file Index: suite_leahi/tst_blood_set_auto/test.py =================================================================== diff -u -r477260ff9a68fb041c2a18cb105267ef315b7c01 -r526042224fcd8b7679060f7f82627a086bf5a92a --- suite_leahi/tst_blood_set_auto/test.py (.../test.py) (revision 477260ff9a68fb041c2a18cb105267ef315b7c01) +++ suite_leahi/tst_blood_set_auto/test.py (.../test.py) (revision 526042224fcd8b7679060f7f82627a086bf5a92a) @@ -26,16 +26,29 @@ td_simulator = TD_Messaging() # handler for messages from UI to FW -def handle_blood_set_auto_request(message, timestamp=0.0): +def handle_blood_set_auto_load_request(message, timestamp=0.0): """ Called when the user requests to firmware from UI @return: None """ message = message["message"] index = MsgFieldPositions.START_POS_FIELD_1 state, index = conversions.bytearray_to_integer(message, index) + global bloodSetAutoLoad + bloodSetAutoLoad = str(state) + +# handler for messages from UI to FW +def handle_blood_set_auto_eject_request(message, timestamp=0.0): + """ + Called when the user requests to firmware from UI + @return: None + """ + message = message["message"] + index = MsgFieldPositions.START_POS_FIELD_1 + state, index = conversions.bytearray_to_integer(message, index) + global bloodSetAutoEject + bloodSetAutoEject = str(state) - def main(): utils.tstStart(__file__) test.startSection("Blood Set Auto Load and Eject") @@ -49,15 +62,15 @@ channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST.value can_interface.register_receiving_publication_function( - channel_id, message_id, handle_blood_set_auto_request + channel_id, message_id, handle_blood_set_auto_load_request ) # handle bloodSetAutoEject sent messages from UI if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST.value can_interface.register_receiving_publication_function( - channel_id, message_id, handle_blood_set_auto_request + channel_id, message_id, handle_blood_set_auto_load_request ) application_init.update_advanced_mode_back_to_default() @@ -69,8 +82,9 @@ pre_treatment = waitForObjectExists( names.o_preTreatmentStack_PreTreatmentStack, 3000 ) - mouseClick(utility.findChildByText(pre_treatment, "Next")) - mouseClick(utility.findChildByText(pre_treatment, "Auto Load")) + mouseClick(utility.findChildByText(pre_treatment, config.NEXT)) + + mouseClick(utility.setObjectText(names.o_preTreatmentStack_Text, config.AUTO_LOAD)) test.verify( waitFor("'bloodSetAutoLoad == 1'", 5000), "Testing UI -> TD message Auto Load" ) @@ -95,7 +109,7 @@ values = utility.findAllObjectsById(stepId, "_text") if stepcount.count == 9: for input_field in values[3:]: - if str(input_field.text) == "Water Sample": + if str(input_field.text) == config.WATER_SAMPLE: mouseClick( waitForObject(names.o_PreTreatmentSampleStack_button_TouchRect) ) @@ -109,7 +123,7 @@ else: for input_field in values[3:]: test.log(str(input_field.text)) - if str(input_field.text) == "Water Sample": + if str(input_field.text) == config.WATER_SAMPLE: mouseClick( waitForObject(names.o_PreTreatmentSampleStack_button_TouchRect) ) @@ -122,12 +136,6 @@ ) mouseClick(Nextbutton) - mouseClick( - waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry) - ) - waitForObject( - names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry - ).text = "abcd" utility.set_value_based_on_target( names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 50 ) @@ -171,30 +179,32 @@ 0, ) - pre_treatment = waitForObjectExists( - names.o_preTreatmentStack_PreTreatmentStack, 3000 + mouseClick( + waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton, 3000) ) - validate_button = utility.findChildByText(pre_treatment, "Validate") - mouseClick(validate_button) + td_simulator.td_Treatment_Parameters_Validation(vAccepted=1) - mouseClick( waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton, 3000) ) - mouseClick(utility.findChildByText(pre_treatment, "Next")) - mouseClick(utility.findChildByText(pre_treatment, "Start")) + + mouseClick(utility.setObjectText(names.o_preTreatmentStack_Text, config.NEXT)) + mouseClick(utility.setObjectText(names.o_preTreatmentStack_Text, config.START)) + td_simulator.td_operation_mode(TDOpModes.MODE_TREA.value, 0) td_simulator.td_tx_state( TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) td_simulator.td_operation_mode(TDOpModes.MODE_POST.value, 0) + post_treatment = waitForObjectExists( names.o_PostTreatmentStack_PostTreatmentStack, 3000 ) - mouseClick(utility.findChildByText(post_treatment, "Auto Eject")) + mouseClick(utility.findChildByText(post_treatment, config.AUTO_EJECT)) test.verify( waitFor("'bloodSetAutoEject == 1'", 5000), "Testing UI -> TD message Auto Eject" ) + td_simulator.td_blood_set_auto_eject_response(1) auto_eject_reject_notification = utility.findChildByText( post_treatment, config.BLOOD_SET_AUTO_EJECT_REJECTION @@ -212,7 +222,7 @@ td_simulator.td_operation_mode(TDOpModes.MODE_INIT.value, 0) navigation.navigate_to_device_settings_using_service_password() grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - mouseClick(utility.findChildByText(grid_container, "Advanced Mode")) + mouseClick(utility.findChildByText(grid_container, config.ADVANCED_MODE)) advanced_mode_switch = waitForObject(names.o_settingsAdvancedMode_BaseSwitch, 1000) # Check current state and toggle Advanced Mode Switch and store the initial state @@ -225,16 +235,17 @@ mouseClick(waitForObjectExists(names.o_SettingsBase_backButton_AdvancedMode, 3000)) main_menu_container = waitForObject(names.o_mainMenu_MainMenu, 2000) - mouseClick(utility.findChildByText(main_menu_container, "Prescriptions")) - mouseClick(utility.findChildByText(main_menu_container, "Treatment")) + mouseClick(utility.findChildByText(main_menu_container, config.PRESCRIPTIONS)) + mouseClick(utility.findChildByText(main_menu_container, config.TREATMENT)) mouseClick(waitForObject(names.o_createTreatmentRect_TouchRect, 2000)) td_simulator.td_operation_mode(TDOpModes.MODE_PRET.value) pre_treatment = waitForObjectExists( names.o_preTreatmentStack_PreTreatmentStack, 3000 ) - mouseClick(utility.findChildByText(pre_treatment, "Auto Load")) - + + mouseClick(utility.findChildByText(pre_treatment, config.AUTO_LOAD)) + td_simulator.td_blood_set_auto_load_response(0) - - mouseClick(utility.findChildByText(pre_treatment, "Next")) - test.endSection() + mouseClick(utility.setObjectText(names.o_preTreatmentStack_Text, config.NEXT)) + + test.endSection() \ No newline at end of file