Index: shared/scripts/configuration/config.py =================================================================== diff -u -r9b04cc323c54bbd0bdd8bd2dee62a154d375b401 -rfd1d376554fc2c396d99e84975c2c8c0deab09c3 --- shared/scripts/configuration/config.py (.../config.py) (revision 9b04cc323c54bbd0bdd8bd2dee62a154d375b401) +++ shared/scripts/configuration/config.py (.../config.py) (revision fd1d376554fc2c396d99e84975c2c8c0deab09c3) @@ -46,3 +46,5 @@ FILTER_FLUSH_TITLE = "Filter Flush" MAXIMUM_COUNTDOWN_TIME = 300 MINIMUM_COUNTDOWN_TIME = 0 +ENABLED = True +DISABLED = False Index: shared/scripts/names.py =================================================================== diff -u -r262cc42e2b0a0044bc0c698249b0da502a31766f -rfd1d376554fc2c396d99e84975c2c8c0deab09c3 --- shared/scripts/names.py (.../names.py) (revision 262cc42e2b0a0044bc0c698249b0da502a31766f) +++ shared/scripts/names.py (.../names.py) (revision fd1d376554fc2c396d99e84975c2c8c0deab09c3) @@ -61,4 +61,6 @@ o_priming_title_text = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "Priming", "type": "Text", "unnamed": 1, "visible": True} #check_mark_parent_object o_self_test_dry_progress_circle = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "id": "_progressCircle", "type": "ProgressCircle", "unnamed": 1, "visible": True} - +#start prime button and continue button +o_start_prime_btn = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "Start Prime", "type": "Text", "unnamed": 1, "visible": True} +o_continue_btn = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONTINUE", "type": "Text", "unnamed": 1, "visible": True} \ No newline at end of file Index: tst_pre_treatment_priming/test.py =================================================================== diff -u -r9b04cc323c54bbd0bdd8bd2dee62a154d375b401 -rfd1d376554fc2c396d99e84975c2c8c0deab09c3 --- tst_pre_treatment_priming/test.py (.../test.py) (revision 9b04cc323c54bbd0bdd8bd2dee62a154d375b401) +++ tst_pre_treatment_priming/test.py (.../test.py) (revision fd1d376554fc2c396d99e84975c2c8c0deab09c3) @@ -14,8 +14,17 @@ "DRY_SELF_TESTS_PRESSURE_SENSORS_SETUP_STATE" : 4, "DRY_SELF_TESTS_PRESSURE_SENSORS_STATE" : 5, "DRY_SELF_TESTS_PRESSURE_SENSORS_NORMAL_STATE" : 6, "DRY_SELF_TESTS_SYRINGE_PUMP_PRIME_STATE" : 7, "DRY_SELF_TESTS_STOPPED_STATE" : 8, "DRY_SELF_TESTS_COMPLETE_STATE" : 9} +PRIMING_STATES = {"HD_PRIME_START_STATE" : 0, "HD_PRIME_WAIT_FOR_USER_START_STATE" : 1, + "HD_PRIME_SALINE_SETUP_STATE" : 2, "HD_PRIME_SALINE_PURGE_AIR_STATE" : 3, + "HD_PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE" : 4, "HD_PRIME_RESERVOIR_ONE_FILL_COMPLETE_STATE" : 5, + "HD_PRIME_DIALYSATE_DIALYSER_STATE" : 6, "HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE" : 7, + "HD_PRIME_DIALYSATE_BYPASS_STATE" : 8, "HD_PRIME_WET_SELF_TESTS_STATE" : 9, + "HD_PRIME_PAUSE" : 10, "HD_PRIME_COMPLETE" :11} +RECIRCULATE_STATES = {"PRE_TREATMENT_RECIRC_STATE" : 0, "PRE_TREATMENT_RECIRC_STOPPED_STATE" : 1} TEST_DRY_STEPS = ["Used Cartridge Check", "Occlusion Sensors Check", "Pressure Sensors Check", "Syringe Pump Check"] +PRIMING_STEPS = ["Blood Circuit Priming", "Dialysate Circuit Priming", "Wet Self Tests"] SELF_TEST_COMPLETION_MSG = "Self Test Complete!" +PRIMING_COMPLETE_MSG = "Priming Complete!" def navigate_self_test_dry_screen(): @@ -44,9 +53,6 @@ test.endSection() - - - def verify_dry_states(): """ Method to simulating different states @@ -81,16 +87,82 @@ verify_the_indicators(indicator=CHECK, steps="Occlusion Sensors Check") verify_the_indicators(indicator=CHECK, steps="Pressure Sensors Check") verify_the_indicators(indicator=CHECK, steps="Syringe Pump Check") - verify_completion_message_and_indicator(False) + verify_completion_message_and_indicator(False, SELF_TEST_COMPLETION_MSG) else: verify_the_indicators(indicator=CHECK, steps="Used Cartridge Check") verify_the_indicators(indicator=CHECK, steps="Occlusion Sensors Check") verify_the_indicators(indicator=CHECK, steps="Pressure Sensors Check") verify_the_indicators(indicator=BUSY, steps="Syringe Pump Check") - verify_completion_message_and_indicator(True) + verify_completion_message_and_indicator(True, SELF_TEST_COMPLETION_MSG) test.endSection() test.endSection() + +def verify_priming_recirculate_states(): + """ + Method to simulating different states + of priming recirculate and verify the busy and + check indicator + """ + 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, + 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) + verify_the_indicators(indicator=CHECK, steps="Blood Circuit Priming") + verify_the_indicators(indicator=CHECK, steps="Dialysate Circuit Priming") + verify_the_indicators(indicator=BUSY, steps="Wet Self Tests") + verify_completion_message_and_indicator(True, PRIMING_COMPLETE_MSG) + verify_the_continue_button(ENABLED) + test.endSection() + test.endSection() + +def verify_priming_states(): + """ + Method to simulating different states + of priming and verify the busy and + check indicator + """ + 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, + recirculate_state=0, patient_connection_state=0) + if (state == "HD_PRIME_START_STATE") or (state == "HD_PRIME_WAIT_FOR_USER_START_STATE") or (state == "HD_PRIME_SALINE_SETUP_STATE") or (state == "HD_PRIME_SALINE_PURGE_AIR_STATE"): + verify_the_indicators(indicator=None, steps=PRIMING_STEPS) + if state == "HD_PRIME_WAIT_FOR_USER_START_STATE": + verify_the_start_priming_button(ENABLED) + else: + verify_the_start_priming_button(DISABLED) + verify_the_continue_button(DISABLED) + elif (state == "HD_PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE") or (state == "HD_PRIME_RESERVOIR_ONE_FILL_COMPLETE_STATE") or (state == "HD_PRIME_DIALYSATE_DIALYSER_STATE"): + verify_the_indicators(indicator=BUSY, steps="Blood Circuit Priming") + verify_the_start_priming_button(DISABLED) + verify_the_continue_button(DISABLED) + elif (state == "HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE") or (state == "HD_PRIME_DIALYSATE_BYPASS_STATE"): + verify_the_indicators(indicator=CHECK, steps="Blood Circuit Priming") + verify_the_indicators(indicator=BUSY, steps="Dialysate Circuit Priming") + verify_the_start_priming_button(DISABLED) + verify_the_continue_button(DISABLED) + elif (state == "HD_PRIME_WET_SELF_TESTS_STATE") or (state == "HD_PRIME_PAUSE"): + verify_the_indicators(indicator=CHECK, steps="Blood Circuit Priming") + verify_the_indicators(indicator=CHECK, steps="Dialysate Circuit Priming") + verify_the_start_priming_button(DISABLED) + verify_the_continue_button(DISABLED) + else: + verify_the_indicators(indicator=CHECK, steps="Blood Circuit Priming") + verify_the_indicators(indicator=CHECK, steps="Dialysate Circuit Priming") + verify_the_indicators(indicator=BUSY, steps="Wet Self Tests") + verify_the_start_priming_button(DISABLED) + verify_completion_message_and_indicator(False, PRIMING_COMPLETE_MSG) + verify_the_continue_button(DISABLED) + test.endSection() + test.endSection() + def get_indicators(step): """ @@ -128,28 +200,57 @@ test.endSection() -def verify_completion_message_and_indicator(completed): +def verify_completion_message_and_indicator(completed, msg): """ - Method to verify the 'Self Test Complete!' + Method to verify the completion message is displayed @param completed - (bool) True/False """ - test.startSection("verify the 'Self Test Complete!' is displayed") + test.startSection("verify the {} is displayed".format(msg)) check_indicator = object.children(findObject(names.o_self_test_dry_progress_circle)) check_indicator = objectMap.realName(check_indicator[2]) if completed: - completion_msg = waitForObjectExists(self_test_dry_check_list_text(SELF_TEST_COMPLETION_MSG)) - test.compare(completion_msg.visible, VISIBLE, "{} message should be displayed".format(SELF_TEST_COMPLETION_MSG)) - test.compare(completion_msg.text, SELF_TEST_COMPLETION_MSG, "Completion message should be {}".format(SELF_TEST_COMPLETION_MSG)) + completion_msg = waitForObjectExists(self_test_dry_check_list_text(msg)) + test.compare(completion_msg.visible, VISIBLE, "{} message should be displayed".format(msg)) + test.compare(completion_msg.text, msg, "Completion message should be {}".format(msg)) if object.exists(check_indicator): - test.passes("Check indicator should display on progress circle upon completion of 'Self test'") + test.passes("Check indicator should display on progress circle upon completion") else: - if object.exists(self_test_dry_check_list_text(SELF_TEST_COMPLETION_MSG)) is False: - test.passes("{} message should not display".format(SELF_TEST_COMPLETION_MSG)) + if object.exists(self_test_dry_check_list_text(msg)) is False: + test.passes("{} message should not display".format(msg)) test.endSection() +def verify_the_start_priming_button(expected_state): + """ + Method to verify the 'Start Prime' + button is enabled + @param expected_state - (bool) True/False + """ + test.startSection("Verifying the 'Start Prime' button is enabled or disabled") + start_prime_btn = waitForObjectExists(names.o_start_prime_btn) + if expected_state: + test.compare(start_prime_btn.enabled, ENABLED, "'Start Prime' should be enabled") + else: + test.compare(start_prime_btn.enabled, DISABLED, "'Start Prime' should be disabled") + test.endSection() + +def verify_the_continue_button(expected_state): + """ + Method to verify the 'Continue' + button is enabled + @param expected_state - (bool) True/False + """ + test.startSection("Verifying the 'Continue' button is enabled or disabled") + continue_btn = waitForObjectExists(names.o_continue_btn) + if expected_state: + test.compare(continue_btn.enabled, ENABLED, "'Continue' should be enabled") + else: + test.compare(continue_btn.enabled, DISABLED, "'Continue' should be disabled") + test.endSection() + + def main(): utils.tstStart(__file__) @@ -161,5 +262,6 @@ navigate_to_priming_screen() verify_the_countdown(PRIMING_TITLE) - -# hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(self, timeout: int, countdown: int) + verify_priming_states() + verify_priming_recirculate_states() + \ No newline at end of file