Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r8b040a9d580e826b011143de530fa4ccdf7fd196 -refab64294d8971b8a8b2d5729995cb4dc54e8379 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 8b040a9d580e826b011143de530fa4ccdf7fd196) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision efab64294d8971b8a8b2d5729995cb4dc54e8379) @@ -18,11 +18,6 @@ import squish from configuration import config from builtins import int as pyInt -from dialin.common.hd_defs import HDOpModes -from dialin.ui.hd_simulator import HDSimulator -from dialin.ui.utils import waitForGUI - -hd_simulator = HDSimulator() def check_if_object_is_within_the_container(obj=None, container=None): """ @@ -75,19 +70,6 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") - -def navigate_to_pretreatment_screen(mode): - - """ - Method to navigate to sub mode under pre-treatment screen - @param mode - (int) pre treatment state - """ - hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,0) - - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=mode, water_sample_state=0,consumables_self_test_state=0, - no_cartridge_self_test_state=0,installation_state=0, dry_self_test_state=0, - prime_state=0,recirculate_state=0, patient_connection_state=0) - def verify_page_step_indicator(screen_obj, pre_treatment_step): """ Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] Index: tst_pre_treatment_consumables/test.py =================================================================== diff -u -r18c32e8fca8e270576f227e64abc8117efd6d14d -refab64294d8971b8a8b2d5729995cb4dc54e8379 --- tst_pre_treatment_consumables/test.py (.../test.py) (revision 18c32e8fca8e270576f227e64abc8117efd6d14d) +++ tst_pre_treatment_consumables/test.py (.../test.py) (revision efab64294d8971b8a8b2d5729995cb4dc54e8379) @@ -22,15 +22,28 @@ import names from dialin.ui import utils from configuration import config, utility -from dialin.common.hd_defs import PreTreatmentSubModes, PreTreatmentConsumableSelfTestStates from dialin.ui.hd_simulator import HDSimulator from dialin.ui.utils import waitForGUI +from dialin.common.hd_defs import PreTreatmentSubModes, PreTreatmentConsumableSelfTestStates, HDOpModes, HDOpSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestsStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates hd_simulator = HDSimulator() + PRE_TREATMENT_STEP= 2 num_of_instructions = 0 SCREEN_OBJ= names.o_PreTreatmentStack_preTreatmentConsumablesStack_PreTreatmentConsumablesStack + +def navigate_to_consumables_screen(): + """ + Method to navigate to sub mode under pre-treatment screen + @param mode - (int) pre treatment state + """ + hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.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=PreTreatmentNoCartSelfTestsStates.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, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) + + def verify_right_instruction_navigation(): """ The method is used to verify the functionality of the right arrow in the instruction navigation, as well as the visibility of the two arrows @@ -99,10 +112,9 @@ test.startSection("Check and busy indicator shouldn't be present") for states in range (config.CONSUMABLE_SELF_TEST_BICARB_PUMP_CHECK_STATE): test.startSection(" consumable self test state = " + str(states)) - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=2, water_sample_state=0, - consumables_self_test_state=states, no_cartridge_self_test_state=0, - installation_state=0, dry_self_test_state=0, prime_state=0, - recirculate_state=0, patient_connection_state=0) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_BICARB_PUMP_CHECK_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.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, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) test.verify(not bicarb_indicator[0].visible, " busy indicator for bicarb pump must not be present") @@ -114,32 +126,30 @@ test.startSection("Verification of Check and busy indicators") test.log(" consumable self test state = 3") - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=2, water_sample_state=0, - consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_ACID_PUMP_CHECK_STATE.value, no_cartridge_self_test_state=0, - installation_state=0, dry_self_test_state=0, prime_state=0, - recirculate_state=0, patient_connection_state=0) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_ACID_PUMP_CHECK_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.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, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) test.verify(waitForObject(bicarb_indicator[0]).visible,"The Busy indicator for BiCarb Pump must be visible") test.verify(not acid_indicator[0].visible," busy indicator for acid pump must not be present") test.verify(not acid_indicator[1].visible," check indicator for acid pump must not be present") test.log(" consumable self test state = 4") - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_CONSUMABLE_SELF_TEST_STATE.value, water_sample_state=0, - consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.value, no_cartridge_self_test_state=0, - installation_state=0, dry_self_test_state=0, prime_state=0, - recirculate_state=0, patient_connection_state=0) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.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, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) test.verify(waitForObject(bicarb_indicator[1]).visible,"The check indicator for Bicarb Pump must be visible") test.log("BiCarb Pump Check is completed") test.verify(waitForObject(acid_indicator[0]).visible,"The Busy indicator for Acid Pump must be visible") test.log(" consumable self test state = 5") - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=2, water_sample_state=0, - consumables_self_test_state= 5, no_cartridge_self_test_state=0, - installation_state=0, dry_self_test_state=0, prime_state=0, - recirculate_state=0, patient_connection_state=0) + + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.NUM_OF_CONSUMABLE_SELF_TESTS_STATES.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.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, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) test.log("Verification for Acid Pump check is done") bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) @@ -155,7 +165,7 @@ global num_of_instructions utils.tstStart(__file__) startApplication(config.AUT_NAME) - utility.navigate_to_pretreatment_screen(PreTreatmentSubModes.HD_PRE_TREATMENT_CONSUMABLE_SELF_TEST_STATE.value) + navigate_to_consumables_screen() utility.verify_page_step_indicator(SCREEN_OBJ, PRE_TREATMENT_STEP) test.startSection("verification of instruction navigation ") @@ -167,17 +177,13 @@ test.verify(waitForObjectExists(names.o_confirm_button_enabled).enabled, " confirm button must be active") verify_left_instruction_navigation() test.verify(not waitForObjectExists(names.o_confirm_button_enabled).enabled ," confirm button must not be active") - for right_arrow in range(1, num_of_instructions): - mouseClick(waitForObject(names.o_PreTreatmentBase_rightImage_Image)) - + mouseClick(waitForObject(names.o_PreTreatmentBase_rightImage_Image)) mouseClick(waitForObject(names.o_confirm_button_enabled)) test.endSection() - test.startSection("verification of consumable self test ") test.verify(not object.exists(names.o_PreTreatmentBase_Self_Test_Complete_Text),config.SELF_TEST_COMPLETE_TEXT + " must not be present ") - verify_consumables_states() verify_consumable_states_text() test.endSection()