Index: tst_pre_treatment_disposables/test.py =================================================================== diff -u -r30917908a423bb7efff6f1acbdf2edd822dc9e9e -rd5265d4dd217d7fe2d63166dbb3a59ff2ca2a92f --- tst_pre_treatment_disposables/test.py (.../test.py) (revision 30917908a423bb7efff6f1acbdf2edd822dc9e9e) +++ tst_pre_treatment_disposables/test.py (.../test.py) (revision d5265d4dd217d7fe2d63166dbb3a59ff2ca2a92f) @@ -13,20 +13,19 @@ import names -from configuration.utility import * -from configuration.config import * -from dialin.ui import utils, dg_simulator + +from configuration import config +from configuration import utility +from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from dialin.ui.dg_simulator import DGSimulator -from configuration import utility -from configuration import config from dialin.common.hd_defs import HDOpModes, HDOpSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestsStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates hd_simulator = HDSimulator() dg_simulator = DGSimulator() PRE_TREATMENT_STEP = 3 -NUM_OF_PRETREATMENT_BULLETS = len(PRE_TREATMENT_SCREENS) +NUM_OF_PRETREATMENT_BULLETS = len(config.PRE_TREATMENT_SCREENS) SCREEN_OBJ = names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack CARTRIDGE_INSTALLATION = 1 CARTRIDGE_CONNECTION = 2 @@ -63,11 +62,11 @@ recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) - test.compare(SYSTEM_SELF_TEST_TITLE, waitForObject(names.o_system_test_text).text, "'{} title should displayed when user is navigated to disposable screen".format(SYSTEM_SELF_TEST_TITLE)) + test.compare(waitForObject(names.o_system_test_text).text, config.SYSTEM_SELF_TEST_TITLE, "'{} title should displayed when user is navigated to disposable screen".format(config.SYSTEM_SELF_TEST_TITLE)) utility.verify_page_step_indicator(SCREEN_OBJ, PRE_TREATMENT_STEP, config.PRE_TREATMENT_SCREENS) - verify_countdown(SYSTEM_SELF_TEST_TITLE, TIME_OUT_DURATION_100, hd_simulator, dg_simulator) - verify_countdown(SYSTEM_SELF_TEST_TITLE, TIME_OUT_DURATION_200, hd_simulator, dg_simulator) - verify_countdown(SYSTEM_SELF_TEST_TITLE, TIME_OUT_DURATION_300, hd_simulator, dg_simulator) + utility.verify_countdown(config.SYSTEM_SELF_TEST_TITLE, config.TIME_OUT_DURATION_100, hd_simulator, dg_simulator) + utility.verify_countdown(config.SYSTEM_SELF_TEST_TITLE, config.TIME_OUT_DURATION_200, hd_simulator, dg_simulator) + utility.verify_countdown(config.SYSTEM_SELF_TEST_TITLE, config.TIME_OUT_DURATION_300, hd_simulator, dg_simulator) test.endSection() @@ -79,19 +78,19 @@ @param screen - (int) current screen """ test.startSection("verifying right arrow functionality and verify the status of left, 'BACK', 'NEXT' and 'CONFIRM' button if available") - verify_missing_object(names.o_disposable_leftImage_Image) + utility.verify_missing_object(names.o_disposable_leftImage_Image) for indicator in range(1, num_of_instruction, 1): verify_bullet_navigation(indicator, num_of_instruction) - verify_next_button(DISABLED) + verify_next_button(config.DISABLED) if screen == CARTRIDGE_INSTALLATION: - verify_back_button(DISABLED) + verify_back_button(config.DISABLED) else: - verify_back_button(ENABLED) + verify_back_button(config.ENABLED) if indicator != num_of_instruction: mouseClick(waitForObject(names.o_disposable_rightImage_Image)) - verify_missing_object(names.o_disposable_rightImage_Image) - verify_next_button(ENABLED) + utility.verify_missing_object(names.o_disposable_rightImage_Image) + verify_next_button(config.ENABLED) test.endSection() def verify_left_instruction_navigation(num_of_instruction, screen): @@ -102,21 +101,21 @@ @param screen - (int) current screen """ test.startSection("verifying left arrow functionality and verify the status of left, 'BACK', 'NEXT' and 'CONFIRM' button if available") - verify_missing_object(names.o_disposable_rightImage_Image) + utility.verify_missing_object(names.o_disposable_rightImage_Image) for indicator in range(num_of_instruction, 0, -1): verify_bullet_navigation(indicator, num_of_instruction) if indicator == num_of_instruction: - verify_next_button(ENABLED) + verify_next_button(config.ENABLED) else: - verify_next_button(DISABLED) + verify_next_button(config.DISABLED) if screen == CARTRIDGE_INSTALLATION: - verify_back_button(DISABLED) + verify_back_button(config.DISABLED) else: - verify_back_button(ENABLED) + verify_back_button(config.ENABLED) if indicator != 1: mouseClick(waitForObject(names.o_disposable_leftImage_Image)) - verify_missing_object(names.o_disposable_leftImage_Image) + utility.verify_missing_object(names.o_disposable_leftImage_Image) test.endSection() def verify_bullet_navigation(num, num_of_instruction): @@ -128,16 +127,16 @@ """ test.startSection("instruction bullet verification for screens") for instruction in range(1, num_of_instruction): - bullet_children = object.children(waitForObjectExists(get_bullet_object(SCREEN_OBJ,(NUM_OF_PRETREATMENT_BULLETS + instruction) - 1))) + bullet_children = object.children(waitForObjectExists(utility.get_bullet_object(SCREEN_OBJ,(NUM_OF_PRETREATMENT_BULLETS + instruction) - 1))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name if instruction <= num: - test.compare(bullet_circle_color, COMPLETE_COLOR) - test.compare(bullet_border_color,COMPLETE_COLOR) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) test.log(str(instruction) + " Complete bullet") else: - test.compare(bullet_circle_color, CURRENT_COLOR) - test.compare(bullet_border_color,INCOMPLETE_COLOR) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.INCOMPLETE_COLOR) test.log(str(instruction) + " Incomplete bullet") test.endSection() @@ -147,7 +146,7 @@ @param condition - (bool) True/False """ test.startSection("Verifying the status of 'NEXT' button") - test.compare(str(waitForObjectExists(names.o_next_button_text).text), NEXT_BUTTON_TEXT, "'NEXT' button text should be {}".format(NEXT_BUTTON_TEXT)) + test.compare(str(waitForObjectExists(names.o_next_button_text).text), config.NEXT_BUTTON_TEXT, "'NEXT' button text should be {}".format(config.NEXT_BUTTON_TEXT)) if condition: test.compare(waitForObjectExists(names.o_next_button_text).enabled, condition, "'NEXT' button should be enabled") else: @@ -168,7 +167,7 @@ """ test.startSection("Verifying the availability of 'BACK' button verify the status of the same") if object.exists(names.o_back_button_text): - test.compare(str(waitForObjectExists(names.o_back_button_text).text), BACK_BUTTON_TEXT,"'BACK' button text should be {}".format(BACK_BUTTON_TEXT)) + test.compare(str(waitForObjectExists(names.o_back_button_text).text), config.BACK_BUTTON_TEXT,"'BACK' button text should be {}".format(config.BACK_BUTTON_TEXT)) if condition: test.compare(waitForObjectExists(names.o_back_button_text).enabled , condition, "'BACK' button should be enabled") else: @@ -219,7 +218,7 @@ Method to verify the status 'CONFIRM' button """ test.startSection("Verifying the status 'CONFIRM' button") - test.compare(str(waitForObjectExists(names.o_confirm_button_text).text), CONFIRM_BUTTON_TEXT,"'CONFIRM' button text should be {}".format(CONFIRM_BUTTON_TEXT)) + test.compare(str(waitForObjectExists(names.o_confirm_button_text).text), config.CONFIRM_BUTTON_TEXT,"'CONFIRM' button text should be {}".format(config.CONFIRM_BUTTON_TEXT)) test.compare(waitForObjectExists(names.o_confirm_button_text).enabled , True, "'CONFIRM' button should be enabled") test.endSection() @@ -345,7 +344,7 @@ test.endSection() #scroll the screen to the title heparin bolus volume - parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) + parameter_object = set_parameter_type(text=config.HEPARIN_BOLUS_VOLUME) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of heparin dispensing rate values") @@ -361,7 +360,7 @@ test.endSection() #scroll the screen to the title acid concentrate type - parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) + parameter_object = set_parameter_type(text=config.HEPARIN_TYPE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of heparin stop time values") @@ -376,7 +375,7 @@ test.endSection() #scroll the screen to the title acid concentrate type - parameter_object = set_parameter_type(text = config.ACID_CONCENTRATE_TITLE) + parameter_object = set_parameter_type(text=config.ACID_CONCENTRATE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of heparin type") @@ -387,7 +386,7 @@ test.endSection() #scroll the screen to the title dialyste rectangle - parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + parameter_object = set_parameter_type(text=config.DIALYZER_TYPE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of acid concentrate type") @@ -398,7 +397,7 @@ test.endSection() #scroll the screen to the title dialyste rectangle - parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + parameter_object = set_parameter_type(text=config.DIALYZER_TYPE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of bicarbonate concentrate rectangle") @@ -409,7 +408,7 @@ test.endSection() #scroll the screen to the title dialyste temperature value - parameter_object = set_parameter_type(text = config.DIALYSATE_TEMPERATURE) + parameter_object = set_parameter_type(text=config.DIALYSATE_TEMPERATURE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of dialysate rectangle") @@ -422,7 +421,7 @@ test.endSection() #scroll the screen to the title blood pressure measurement interval - parameter_object = set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + parameter_object = set_parameter_type(text=config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.startSection("verification of dialysate temperature values") @@ -431,7 +430,7 @@ test.endSection() #scroll the screen to the title rinseback flow rate - parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) + parameter_object = set_parameter_type(text=config.RINSEBACK_FLOW_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) set_arterial_low_and_high() @@ -505,27 +504,28 @@ """ test.startSection("Method to navigate to create custom treatment to set all parameters ") - hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TPAR.value , sub_mode = HDOpSubModes.SUBMODE_START.value) + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_TPAR.value, sub_mode=HDOpSubModes.SUBMODE_START.value) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), "abcd") mouseClick(waitForObject(names.o_confirm_button)) verify_create_custom_treatment_parameter() verify_request_continue_mode() # navigation for pre-treatment screens - hd_simulator.cmd_send_hd_operation_mode(op_mode = 4 , sub_mode = 0) - utils.waitForGUI(2) - hd_simulator.cmd_set_treatment_states_data(sub_mode = 1, uf_state= 0, saline_state=0, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_TPAR.value, sub_mode=HDOpSubModes.SUBMODE_START.value) utils.waitForGUI(1) + hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,PreTreatmentPrimeStates.HD_PRIME_START_STATE.value) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpModes.MODE_PRET.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) + utils.waitForGUI(1) - hd_simulator.cmd_initiate_treatment_response(response = 1, reason =0) - hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_PRET.value , sub_mode = HDOpSubModes.SUBMODE_START.value) + hd_simulator.cmd_initiate_treatment_response(response=1, reason=0) + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_PRET.value, sub_mode=HDOpSubModes.SUBMODE_START.value) utils.waitForGUI(1) # navigation for pre-treatment disposables screens - hd_simulator.cmd_send_hd_operation_mode(op_mode = 5 , sub_mode = 0) + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_PRET.value, sub_mode=HDOpSubModes.SUBMODE_START.value) utils.waitForGUI(1) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_DG_FLUSH_IN_PROGRESS.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value, @@ -544,16 +544,22 @@ def main(): utils.tstStart(__file__) - startApplication(AUT_NAME) + + startApplication(config.AUT_NAME) verify_disposables_screen() + navigate_to_disposables_screen_from_create_custom_treatment() verify_functionality_for_cartridge_installation() + utils.waitForGUI(1) verify_functionality_for_cartridge_connection() + utils.waitForGUI(1) verify_functionality_for_heparin_syringe() + utils.waitForGUI(1) verify_functionality_for_saline_bag() + utils.tstDone()