# -*- coding: utf-8 -*-" ## # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # file tst_instructions_poc # date 16/05/2022 # author Ajina S M # author Amol Pandharinath Shinde # author Amrita Debnath import names import os from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from configuration import config from configuration import utility from dialin.common.hd_defs import HDOpModes, HDStandbyStates, HDInitStates, PreTreatmentSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates, TreatmentStates, UFStates, SalineBolusStates, HeparinStates, TreatmentRinsebackStates, PreTreatmentRecircStates, TreatmentBloodPrimeStates, TreatmentEndStates, TreatmentStopStates, TreatmentDialysisStates from dialin.ui.utils import waitForGUI hd_simulator = HDSimulator() ven_low = 40 ven_high = 400 art_low = -240 art_high = -20 first_index = 0 contents = [] instructions = [] image_names = [] title_list = [] count_of_instructions = [] title_count_dict = {} IMAGE_READY = 1 image_list_from_location = os.listdir(config.EXPECTED_IMAGE_LOCATION) text_obj_names = [names.o_PreTreatmentBase_swipeview_SwipeView_WaterSample,names.o_PreTreatmentBase_swipeview_SwipeView_Consumables,names.o_preTreatmentDisposablesCartridgeInstallation_swipeview_SwipeView,names.o_preTreatmentDisposablesCartridgeConnetion_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView,names.o_preTreatmentDisposablesSalineBag_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView_3,names.o_EndTreatmentRinsebackInit_swipeview_SwipeView,names.o_EndTreatmentRinsebackComplete_swipeview_SwipeView,names.o_patientDisconnectionConfirm_swipeview_SwipeView,names.o_disposablesRemovalConfirm_swipeview_SwipeView,names.o_EndTreatmentBase_swipeview_SwipeView] rightarrow_obj_names = [names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase,names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack,names.o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase,names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit,names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase,names.o_PostTreatmentStack_disposablesRemovalConfirm_TreatmentFlowBase,names.o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase] def get_text_obj(screen_obj,text): """ To obtain a text object based on text provided @param (str) screen_obj: provides the container name on which the text must be present @param (str) text: instruction text @returns a real name object """ names.o_instruction["container"] = screen_obj names.o_instruction["text"] = text return names.o_instruction def get_rightarrow_obj(screen_obj): """ To obtain object for right arrow based on container @param (str) screen_obj: provides the container @returns a real name object """ names.o_right_arrow["container"] = screen_obj return names.o_right_arrow def get_img_obj(screen_obj,source): """ To obtain image object based on container @param (str) screen_obj: provides the container @param (str) source: image source @returns a real name object """ names.o_image_path["container"] = screen_obj names.o_image_path["source"] = source return names.o_image_path def read_data_from_conf_file(): """ This method is used to read the data from Instructions.conf file. """ utils.waitForGUI(0.2) with open(config.INSTRUCTION_CONF_LOCATION, 'r') as conf_file: contents = conf_file.readlines() count = 0 line_count = 0 for line in contents: length =len(line) line_count += 1 if line[0] =="[": title = line.split("^") title_strip = title[1][:-2] title_list.append(title_strip) continue else: conf_data = line.split("=") if length > 2: count += 1 instructions.append(conf_data[0]) image_names.append(conf_data[1].strip()) if line_count == len(contents): count_of_instructions.append(count) else: if count > 0: count_of_instructions.append(count) count = 0 title_count_dict.update(dict(zip(title_list,count_of_instructions))) def verify_instruction_and_image(title,index): """ This method is used to verify the instruction and image on present screen @param - (str) title: screen title @param - (int) index: index of data from Instructions.conf file @return - (int) index """ test.startSection("Verifying instruction and image from" +title+ "screen") for count in range(title_count_dict.get(title)): instruction_text = instructions[index] image_text = image_names[index] instruction_text = instruction_text.replace('\\n','\n') index += 1 #to remove last empty character from the string if instruction_text[-1] == " ": instruction_text = instruction_text.rstrip() test.log(str(text_obj_names)) image_status = waitForObjectExists(get_img_obj(text_obj_names[0],"{}{}".format(config.IMAGE_LOCATION,image_text))).status test.compare(str(image_status),str(IMAGE_READY),image_text + " - image title is valid and loaded on UI.") test.compare(str(waitForObject(get_text_obj(text_obj_names[0],instruction_text)).text),instruction_text, "Instruction from" +title+ "screen is visible and matched") if object.exists(names.o_next_button_ws): mouseClick(waitForObject(names.o_next_button)) if object.exists(names.o_fail_button_ws): mouseClick(waitForObject(names.o_fail_button)) if object.exists(get_rightarrow_obj(rightarrow_obj_names[0])): mouseClick(waitForObject(get_rightarrow_obj(rightarrow_obj_names[0]))) test.endSection() return index def verify_create_custom_treatment_parameter(): """ Method to set create custom treatment slider value based on slider buffer """ test.startSection("Method to set create custom treatment slider based on positive slider buffer") test.compare(waitForObject(names.o_PreTreatmentCreate_Create_a_Custom_Treatment_Text).text, config.TREATMENT_TITLE, "Title text should be ->"+str(config.TREATMENT_TITLE)) test.compare(waitForObject(names.o_PreTreatmentCreate_PRESCRIPTION_Text).text, config.PRESCRIPTION_TITLE, "Title text should be ->"+str(config.PRESCRIPTION_TITLE)) #set custom values for parameters test.startSection("verification of blood flow values") test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment).label, config.BLOOD_FLOW_RATE, "Parameter should be ->"+str(config.BLOOD_FLOW_RATE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, 100, config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) test.endSection() test.startSection("verification of dialysate flow values") test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment).label, config.DIALYSATE_FLOW_RATE, "Parameter should be ->"+str(config.DIALYSATE_FLOW_RATE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, 250, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) test.endSection() test.startSection("verification of duration values") test.compare(waitForObject(names.o_PreTreatmentCreate_duration_SliderCreateTreatment).label, config.DURATION, "Parameter should be -> "+str(config.DURATION)) test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, 60, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) test.endSection() #scroll the screen to the title 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") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment).label, config.HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(config.HEPARIN_DISPENSING_RATE)) utils.waitForGUI(1) test.compare(waitForObject(names.o_PreTreatmentCreate_OFF_Text).text,"OFF", "Text should be -> "+"OFF") mouseClick(names.o_PreTreatmentCreate_heparinDispensingRateSwitch_Switch) mouseClick(names.o_PreTreatmentCreate_heparinDispensingRateSwitch_Switch) utils.waitForGUI(1) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, 0.8, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) test.endSection() test.startSection("verification of heparin bolus volume values") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment).label, config.HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(config.HEPARIN_BOLUS_VOLUME)) mouseClick(names.o_PreTreatmentCreate_heparinBolusVolumeSwitch_Switch) mouseClick(names.o_PreTreatmentCreate_heparinBolusVolumeSwitch_Switch) utils.waitForGUI(1) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, 1.4, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) test.endSection() #scroll the screen to the title acid concentrate type 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") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment).label, config.HEPARIN_STOP_TIME, "Parameter should be -> "+str(config.HEPARIN_STOP_TIME)) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, 230, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) test.endSection() test.startSection("verification of saline bolus values") test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolus_SliderCreateTreatment).label, config.SALINE_BOLUS_TITLE, "Parameter should be -> "+str(config.SALINE_BOLUS_TITLE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, 100, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS_TITLE) test.endSection() #scroll the screen to the title acid concentrate type 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") test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect_GridSelection).labels, config.HEPARIN_TYPE, "Parameter should be -> "+str(config.HEPARIN_TYPE)) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).text.text, config.HEPARIN_TYPE, "heparin text should be :"+ str(config.HEPARIN_TYPE)) test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.endSection() #scroll the screen to the title dialyste rectangle 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") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect_GridSelection).title, config.ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.ACID_CONCENTRATE_TITLE)) mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).text.text, config.ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) test.endSection() #scroll the screen to the title dialyste rectangle 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") test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection).title, config.BICARBONATE_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.BICARBONATE_CONCENTRATE_TITLE)) mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).text.text, config.BICARBONATE_CONCENTRATE, "Bicarbonate concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) test.endSection() #scroll the screen to the title dialyste temperature value 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") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect_GridSelection).title, config.DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(config.DIALYZER_TYPE_TITLE)) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).text.text, config.DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[0])) test.endSection() #scroll the screen to the title 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") test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment).label, config.DIALYSATE_TEMPERATURE, "Parameter should be -> "+str(config.DIALYSATE_TEMPERATURE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, 35, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) test.endSection() #scroll the screen to the title 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() set_venous_low_and_high() test.startSection("verification of blood pressure measurement interval values") test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, 25, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.endSection() test.startSection("verification of rinseback flow rate values") test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, 50, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) test.endSection() test.endSection() def set_arterial_low_and_high(): """ Method to set the arterial low and high limits using slider """ test.startSection("Set the arterial low and high limits using slider") utility.set_arterial_ranges_max_val(art_high) utility.set_arterial_ranges_min_val(art_low) test.endSection() def set_venous_low_and_high(): """ Method to set the venous low and high limits using slider """ test.startSection("Set the venous low and high limits using slider") utility.set_venous_ranges_min_val(ven_low) utility.set_venous_ranges_max_val(ven_high) test.endSection() def set_parameter_type(text): """ Method to set object property based on text @param text : (string) treatment parameter text """ if isinstance(text, str): names.o_operating_parameters["text"] = text return names.o_operating_parameters else: test.log("Invalid \"text\": " +text+" for object.") names.o_operating_parameters["text"] = None def test_custom_treatment_slider(slider_object, value, slider_parameter, parameter): """ Method to set slider handle based on custom values @param slider_object : (dictionary) object of treatment parameters @param vale : (int)value to be set on slider @param slider_parameter : (list) consist combination of slider minimum value, slider buffer and width buffer @param parameter : (str) parameter name """ minimum_slider_value = slider_parameter[0] slider_buffer = slider_parameter[1] width_buffer = slider_parameter[2] slider_width = ((value - minimum_slider_value)/slider_buffer) * width_buffer utils.waitForGUI(0.3) mouseClick(findObject(slider_object), float(slider_width) , 3, Qt.LeftButton) test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+"slider value should set to"+str(value)) def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) read_data_from_conf_file() hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value) test.startSection("Navigating to Pre-Treatment Sample screen") hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_TREATMENT_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.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) index = verify_instruction_and_image("Water Sample",index = 0) index = verify_instruction_and_image("Water Sample Result",index = index) index = verify_instruction_and_image("Water Sample Result Failed",index = index) text_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to Pre-Treatment Consumables screen") hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_DISINFECT_STATE.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=PreTreatmentNoCartSelfTestStates.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) index = verify_instruction_and_image("Consumables Installation",index = index) rightarrow_obj_names.pop(first_index) test.endSection() 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 = HDStandbyStates.STANDBY_START_STATE.value) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), "abcd") mouseClick(waitForObject(names.o_continue_button)) verify_create_custom_treatment_parameter() test.endSection() test.startSection("Navigating to Pre-Treatment Disposables screen") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_PRET.value , sub_mode = HDStandbyStates.STANDBY_START_STATE.value) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDStandbyStates.STANDBY_WAIT_FOR_DG_FLUSH_TO_START_STATE.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=PreTreatmentNoCartSelfTestStates.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) text_obj_names.pop(first_index) index = verify_instruction_and_image("Cartridge Installation",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.log("Clicking on next button in Cartridge Installation instruction page") mouseClick(waitForObjectExists(names.o_next_button_cartridge_installation)) index = verify_instruction_and_image("Cartridge Connection",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.log("Clicking on next button in Cartridge Connection instruction page") mouseClick(waitForObjectExists(names.o_next_button_cartridge_connection)) index = verify_instruction_and_image("Heparin Syringe",index = index) text_obj_names.pop(first_index) test.log("Clicking on next button in Heparin Syringe instruction page") mouseClick(waitForObjectExists(names.o_next_button_heparinsyringe)) index = verify_instruction_and_image("Saline Bag",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() test.log("Navigating to Pre-Treatment Ultrafiltration screen") hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_PATIENT_CONNECTION_STATE.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=PreTreatmentNoCartSelfTestStates.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) hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(accepted=True, reason=0) hd_simulator.cmd_send_uf_treatment_response(accepted = True, reason = 0, volume = 120) test.log("Clicking on skip button in BP/HR screen") mouseClick(waitForObject(names.o_skip_button)) test.startSection("Navigating to Pre-Treatment Patient Connection screen") index = verify_instruction_and_image("Patient Connection",index = index) test.endSection() test.startSection("Navigating to Pre-Treatment Start screen") hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(accepted=True, reason=0) index = verify_instruction_and_image("Start Treatment",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to End Treatment Rinseback Setup screen") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) index = verify_instruction_and_image("Rinseback Setup",index = index) text_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to End Treatment Rinseback Complete screen") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) index = verify_instruction_and_image("Rinseback Complete",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to Post Treatment Disconnection screen") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_POST.value , sub_mode = HDInitStates.POST_STATE_START.value) index = verify_instruction_and_image("Patient Disconnection",index = index) mouseClick(waitForObject(names.o_confirm_button_patient_disconnection)) mouseClick(waitForObject(names.o_next_button_review)) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to Post Treatment Disposables screen") index = verify_instruction_and_image("Disposables Removal",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() test.startSection("Navigating to End Treatment Recirculate screen") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RECIRC_STATE.value, uf_state = UFStates.UF_START_STATE.value, saline_state = SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state = HeparinStates.HEPARIN_STATE_OFF.value, rinseback_state = TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, blood_prime_state = TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, treatment_end_state = TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state = TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state = TreatmentDialysisStates.DIALYSIS_START_STATE.value) index = verify_instruction_and_image("Recirculate",index = index) text_obj_names.pop(first_index) rightarrow_obj_names.pop(first_index) test.endSection() #TODO :- Disinfect verification utils.tstDone()