Index: suite_leahi/tst_pre_treatment_foundation/test.py =================================================================== diff -u -r0b9e1c4d2429e9ad58420f00a52adf8ec800ef35 -r482751bf56168ed081eae22617f3b16a7522a53f --- suite_leahi/tst_pre_treatment_foundation/test.py (.../test.py) (revision 0b9e1c4d2429e9ad58420f00a52adf8ec800ef35) +++ suite_leahi/tst_pre_treatment_foundation/test.py (.../test.py) (revision 482751bf56168ed081eae22617f3b16a7522a53f) @@ -13,14 +13,16 @@ import names import re -from configuration import config, utility, navigation, application_init -from leahi_dialin.ui import utils -from leahi_dialin.ui.td_messaging import TD_Messaging -from leahi_dialin.common.td_defs import TDOpModes, TDTreatmentStates -from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions -from leahi_dialin.protocols import CAN -from leahi_dialin.utils import conversions +from configuration import config, utility, navigation, application_init +from leahi_dialin.ui import utils +from leahi_dialin.ui.td_messaging import TD_Messaging +from leahi_dialin.common.td_defs import TDOpModes, TDTreatmentStates +from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.protocols import CAN +from leahi_dialin.utils import conversions +from configuration.getrejectiontext import ScopedRejectionRepository + td_simulator = TD_Messaging() can_interface = td_simulator.can_interface startTreatment = None @@ -140,14 +142,16 @@ can_interface.register_receiving_publication_function( channel_id, message_id, handle_start_treatment_request ) - + # conf_path = "/home/denali/Public/luis/config/configurations/Alarms/Rejections.conf" + conf_path = "/home/denali/Public/luis/config/configurations/Instructions/Instructions.conf" + repo = ScopedRejectionRepository(path=conf_path) application_init.reset_system_setting("AdvancedMode") startApplication(utility.aut("-q")) # --- Flow 1: Full Pre-Treatment --- td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value) td_simulator.td_operation_mode(TDOpModes.MODE_PRET.value) - + # Concentrates waitForObjectExists(names.o_preTreatmentStack_PreTreatmentStack, 3000) test.compare( @@ -163,11 +167,12 @@ mouseClick(play_button) mouseClick(play_button) utils.waitForGUI(5) - connect_obj = waitForObject(names.o_PreTreatmentBase_instructionView_InstructionView, 3000) - connect = utility.findChildByText(connect_obj, config.CONCENTRATES_PAGE_CONTENTS[1]) - test.compare(connect.color.name, config.BLUE_COLOR, "Test step changes to another index") + content_column = waitForObject(names.o_PreTreatmentBase_instructionView_InstructionView, 3000) + values = utility.findAllObjectsById(content_column, "_message") + mouseClick(values[1]) + test.compare(values[1].color.name, config.BLUE_COLOR, "Test step changes to another index") click_next() - + # Installation Stepper wait_compare_text( names.o_preTreatmentStack_Text, @@ -178,10 +183,10 @@ values = utility.findAllObjectsById(content_column, "_message") for content in values[1:4]: mouseClick(content) - + click_auto_load() td_simulator.td_blood_set_auto_load_response(0) - + wait_compare_text( names.o_preTreatmentStack_Text, config.INSTALLATION_STEPPER_2_PAGE_TITLE, @@ -192,7 +197,7 @@ for content in values[1:5]: mouseClick(content) click_next() - + wait_compare_text( names.o_preTreatmentStack_Text, config.INSTALLATION_STEPPER_3_PAGE_TITLE, @@ -224,18 +229,18 @@ obj.text, content, f"Comparison of Self Tests Page Contents: {content}" ) click_next() - + # Prime for content in config.PRIME_PAGE_CONTENTS: obj = waitForObjectExists( utility.setObjectText(names.o_preTreatmentStack_Text, content) ) test.compare(obj.text, content, f"Comparison of Prime Page Contents: {content}") click_next() - + # Create Rx Flow 1 set_treatment_params('1234', 60, 75, 75, 0.10) - + # Connect wait_compare_text( names.o_preTreatmentStack_Text, @@ -246,7 +251,7 @@ values = utility.findAllObjectsById(content_column, "_message") for content in values[1:4]: mouseClick(content) - + verify_start_treatment_request() td_simulator.td_operation_mode(TDOpModes.MODE_INIT.value, 0) @@ -279,7 +284,9 @@ config.INSTALLATION_PAGE_TITLE, "Installation Page Title Text", ) - click_text(None, config.INSTALLATION_PAGE_CONTENTS[1]) + content_column = waitForObjectExists(names.o_PreTreatmentBase_contentColumn_Column) + values = utility.findAllObjectsById(content_column, "_message") + mouseClick(values[1]) click_text(None, config.AUTO_LOAD) td_simulator.td_blood_set_auto_load_response(0)