Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rb4c9bea230cee577383592686ae7bb79c9716375 -rf027e8ea656a56912e18c4879eeae24f03c411a7 --- shared/scripts/configuration/utility.py (.../utility.py) (revision b4c9bea230cee577383592686ae7bb79c9716375) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision f027e8ea656a56912e18c4879eeae24f03c411a7) @@ -20,6 +20,7 @@ from configuration.config import * from configuration import config from builtins import int as pyInt +from dialin.common.hd_defs import HDOpModes from dialin.ui.hd_simulator import HDSimulator hd_simulator = HDSimulator() @@ -81,7 +82,7 @@ Method to navigate to sub mode under pre-treatment screen @param mode - (int) pre treatment state """ - hd_simulator.cmd_set_hd_operation_mode_data(5,0) + 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, @@ -162,19 +163,18 @@ test.endSection() -def page_step_indicator_verification(screen_obj, pre_treatment_step): +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] @param pre_treatment_step : indicates the Current pre-treatment step """ - test.startSection("verification of page step indicators") for page in range(len(config.PRE_TREATMENT_SCREENS)): bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.PRE_TREATMENT_SCREENS[page])) - + if page < pre_treatment_step: test.log("To verify the step indicator of the completed pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) @@ -211,7 +211,7 @@ names.o_text_object["text"] = txt return names.o_text_object - + def get_bullet_object(screen_obj, num): """ To obtain a bullet object based on occurrence provided. Index: tst_pre_treatment_priming/test.py =================================================================== diff -u -rb4c9bea230cee577383592686ae7bb79c9716375 -rf027e8ea656a56912e18c4879eeae24f03c411a7 --- tst_pre_treatment_priming/test.py (.../test.py) (revision b4c9bea230cee577383592686ae7bb79c9716375) +++ tst_pre_treatment_priming/test.py (.../test.py) (revision f027e8ea656a56912e18c4879eeae24f03c411a7) @@ -17,6 +17,7 @@ import names from configuration import config, utility +from dialin.common.hd_defs import PreTreatmentSubModes from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator @@ -49,10 +50,10 @@ is displayed """ test.startSection("Navigating to self test dry screen and verify the 'Begin Prime' title is displayed") - utility.navigate_to_pretreatment_screen(5) + utility.navigate_to_pretreatment_screen(PreTreatmentSubModes.HD_PRE_TREATMENT_SELF_TEST_DRY_STATE.value) title = (waitForObjectExists(utility.self_test_dry_check_list_text(config.BEGIN_PRIME_TITLE))).text test.compare(title, config.BEGIN_PRIME_TITLE, "{} title should be displayed when user is navigating to self test dry screen".format(config.BEGIN_PRIME_TITLE)) - utility.page_step_indicator_verification(names.o_PreTreatmentStack_pretreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) + utility.verify_page_step_indicator(names.o_PreTreatmentStack_pretreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) test.endSection() @@ -63,10 +64,10 @@ is displayed """ test.startSection("Navigating to priming screen and verify the begin 'Priming' title is displayed") - utility.navigate_to_pretreatment_screen(6) + utility.navigate_to_pretreatment_screen(PreTreatmentSubModes.HD_PRE_TREATMENT_PRIME_STATE.value) title = (waitForObject(utility.self_test_dry_check_list_text(config.PRIMING_TITLE))).text test.compare(title, config.PRIMING_TITLE, "{} title should be displayed when user is navigating to 'Priming' screen".format(config.PRIMING_TITLE)) - utility.page_step_indicator_verification(names.o_PreTreatmentStack_pretreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) + utility.verify_page_step_indicator(names.o_PreTreatmentStack_pretreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) test.endSection() @@ -124,7 +125,7 @@ test.startSection("Simulating different states of priming recirculate states and verifying the busy and check indicator") for state, index in RECIRCULATE_STATES.items(): test.startSection("Passing {} state".format(state)) - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=7, water_sample_state=0, + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_RECIRCULATE_STATE.value, 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=index, patient_connection_state=0) @@ -145,9 +146,9 @@ test.startSection("Simulating different states of priming and verifying the busy and check indicator") for state, index in PRIMING_STATES.items(): test.startSection("Passing {} state".format(state)) - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=6, 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=index, + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_SELF_TEST_DRY_STATE.value, + 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=index, recirculate_state=0, patient_connection_state=0) if (state == "HD_PRIME_START_STATE") or (state == "HD_PRIME_WAIT_FOR_USER_START_STATE") : verify_indicators(None, PRIMING_STEPS)