# -*- 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_create_custom_treatment # date 2022/01/27 # author Joseph varghese # # NOTE: # This test is intended to be used to verify custom treatment in application . import names from dialin.ui import utils from configuration import utility from configuration import config from dialin.common.msg_defs import RequestRejectReasons from dialin.ui.hd_simulator import HDSimulator from dialin.utils.conversions import integer_to_bytearray hd_simulator = HDSimulator() PRE_TREATMENT_STEP = 0 def set_parameter_type(text): """ Method to set object property based on text @param text : (string) treatment parameter text """ names.o_operating_parameters["text"] = text return names.o_operating_parameters def prescription_measurement_title(text): """ Method to set object property based on text @param text : (string) treatment parameter text """ names.o_prescription_mesurement["text"] = text return names.o_prescription_mesurement def verify_request_rejection_mode(): """ Method to verify rejection mode of create custom treatment """ reject_reasons = [RequestRejectReasons.REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE] * hd_simulator.NUM_TREATMENT_PARAMETERS treatment_status = hd_simulator.cmd_send_treatment_parameter_validation_response(reject_reasons) test.compare(treatment_status, True, "custom treatment should be rejected") def verify_request_continue_mode(): """ Method to accept treatment response. """ mouseClick(waitForObject(names.o_CreateCustomTreatment_Continue_button)) treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]) test.compare(treatment_status, True, "custom treatment should be accepted") def verify_manual_validation_mode(): """ Method to verify response of all the parameters in the treatment. """ test.startSection("Verifying manual validation response for all patameters") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]) test.compare(treatment_status, True, "custom treatment should be rejected") for expected_treatment_title in config.CREATE_TREATMENT_PARAMETERS: parameter_object = set_parameter_type(text = expected_treatment_title) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1 ]) test.compare(treatment_status, True, "custom treatment should be rejected") treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]) test.compare(treatment_status, True, "custom treatment should be rejected") utils.waitForGUI(0.1) test.endSection() def verify_custom_treatment_record_rejected(): """ Method to verify custom treatment record, if confirmation rejected """ test.startSection("Verifying custom treatment record, if confirmation rejected") for expected_treatment_title in config.CREATE_TREATMENT_PARAMETERS: expected_color = config.COLOR_CODES.get("Red") parameter_object = set_parameter_type(text = expected_treatment_title) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) parameter_text = waitForObject(parameter_object) parameter_text_color = parameter_text.color.name test.compare(expected_color, parameter_text_color, "parameter color should be ' \red for' " + expected_treatment_title +" , if the confirmation get rejected !") test.endSection() def test_continue_button(): """ Method to verify continue button of create custom treatment page """ test.startSection("Verification of continue button from create custom treatment section") test.compare(waitForObject(names.o_PreTreatmentCreate_confirmButton_TouchRect).text.text, config.CONTINUE_TEXT, "continue button should be displayed") test.verify(waitForObject(names.o_PreTreatmentCreate_confirmButton_TouchRect).enabled, "continue button should be enabled") test.endSection() def test_back_button(): """ Method to verify back button of create custom treatment page """ test.startSection("Verification of back button from create custom treatment section") test.compare(waitForObject(names.o_PreTreatmentCreate_backButton_BackButton).text.text, config.BACK_TEXT, "Back button should be displayed") test.verify(waitForObject(names.o_PreTreatmentCreate_backButton_BackButton).enabled, "Back button should be enabled") test.endSection() def create_custom_treatment_record(): """ Method to set create custom treatment slider value based on slider buffer on negative direction """ test.startSection("Method to set create custom treatment slider based on negative slider buffer") #flicker screen into blood dialysate section parameter_object = set_parameter_type(text = config.BLOOD_FLOW_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") #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)) for blood_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_FLOW_RATE][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, blood_flow_rate, 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)) for dialysate_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_FLOW_RATE][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, dialysate_flow_rate, 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)) for duration in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DURATION][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, 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)) for heparin_dispensing_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_DISPENSING_RATE][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, heparin_dispensing_rate, 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)) for heparin_bolus_volume in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_BOLUS_VOLUME][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, heparin_bolus_volume, 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)) for heparin_stop_time in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_STOP_TIME][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, 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)) for saline_bolus in config.CREATE_TREATMENT_PARAMETER_RANGE[config.SALINE_BOLUS_VOLUME][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, saline_bolus, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS_TITLE) 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)) for dialysate_temperature in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_TEMPERATURE][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, dialysate_temperature, 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_high_and_low_limits_using_slider() set_venous_high_and_low_limits_using_slider() 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)) for blood_pressure_measurement_interval in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, blood_pressure_measurement_interval, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text).text, "OFF text should display for value 0") test.endSection() test.startSection("Verification of rinseback flow rate values") parameter_object = set_parameter_type(text = 150) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) for rinseback_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.RINSEBACK_FLOW_RATE][::-1]: test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, rinseback_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) test.endSection() test_continue_button() test_back_button() test.endSection() def verify_the_confirm_treatment_screen_is_displayed() -> None: """ Method to verify confirm treatment title """ test.log("Verifying the 'Confirm Treatment' is displayed and its title text") confirm_treatment_title = waitForObject(names.o_confirm_title_text) test.compare(config.CONFIRM_TREATMENT_TITLE, confirm_treatment_title.text.toUtf8().constData(), config.CONFIRM_TREATMENT_TITLE + " screen is displayed " +"and title should be " +config.CONFIRM_TREATMENT_TITLE) def verify_prescriptional_details_from_confirm_treatment_screen(): """ Method to verify prescription details from confirm treatment section. """ test.startSection("Verifying prescription values from confirm treatment section") verify_the_confirm_treatment_screen_is_displayed() prescription_title = waitForObject(names.o_prescription_title_text) test.compare(config.PRESCRIPTION_TITLE, prescription_title.text.toUtf8().constData(), config.PRESCRIPTION_TITLE + " title " + "should be " +config.PRESCRIPTION_TITLE) for expected_prescription_title, measurement in config.PRESCRIPTION_DETAILS.items(): #flickering into expected parameter title parameter_object = prescription_measurement_title(text = expected_prescription_title) utility.scroll_to_zone(parameter_object, names.o_treatment_confirm_flickable) prescription_title = waitForObject(prescription_measurement_title(text=expected_prescription_title)) actual_measurement = object.parent(prescription_title) actual_measurement = object.children(actual_measurement)[-1] test.compare(expected_prescription_title, prescription_title.text.toUtf8().constData(), "title should be " + expected_prescription_title) unit = config.CREATE_CUSTOM_TREATMENT[expected_prescription_title] test.compare(str(unit)+ " " +str(measurement), actual_measurement.text, expected_prescription_title + " corresponding measured value should be " + str(unit)+" "+str(measurement)) test.endSection() def verify_operational_details_from_confirm_treatment_screen(): """ Method to verify operational details from confirm treatment section. """ test.startSection("Verifying operational values from confirm treatment screen") verify_the_confirm_treatment_screen_is_displayed() parameter_object = prescription_measurement_title(text = "Blood Flow Rate") utility.scroll_to_zone(parameter_object, names.o_treatment_confirm_flickable) for expected_operational_title, measurement in config.OPERATIONAL_PARAMETERS.items(): operational_title = waitForObject(prescription_measurement_title(text=expected_operational_title)) actual_measurement = object.parent(operational_title) actual_measurement = object.children(actual_measurement)[-1] test.compare(expected_operational_title, operational_title.text.toUtf8().constData(), expected_operational_title + " title should be " + expected_operational_title) test.compare(measurement, actual_measurement.text.toUtf8().constData(), expected_operational_title +" corresponding measured value should be " + measurement) test.endSection() 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 value : (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.2) mouseClick(waitForObjectExists(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 set_venous_low_and_high_limits_using_slider(): """ Method to set the venous low and high limits using slider """ test.startSection("Set the venous low and high limits using slider") utils.waitForGUI(1) for venous_value in range(config.VENOUS_VALUE_20, config.VENOUS_VALUE_600, config.POSITIVE_BUFFER): utility.set_venous_ranges_min_val(venous_value) utility.set_venous_ranges_min_val(config.VENOUS_VALUE_20) for venous_value in range(config.VENOUS_VALUE_600, config.VENOUS_VALUE_20, config.NEGATIVE_BUFFER): utility.set_venous_ranges_max_val(venous_value) test.endSection() def set_arterial_low_and_high_limits_using_slider(): """ Method to set the arterial low and high limits using slider """ test.startSection("Set the arterial low and high limits using slider") utils.waitForGUI(1) for arterial_value in range(config.ARTERIAL_VALUE_0, config.ARTERIAL_VALUE_NEGATIVE_270, config.NEGATIVE_BUFFER): utility.set_arterial_ranges_max_val(arterial_value) utility.set_arterial_ranges_max_val(config.ARTERIAL_VALUE_0) for arterial_value in range(config.ARTERIAL_VALUE_NEGATIVE_300, config.ARTERIAL_VALUE_NEGATIVE_20, config.POSITIVE_BUFFER): utility.set_arterial_ranges_min_val(arterial_value) test.endSection() def set_venous_high_and_low_limits_using_slider(): """ Method to set the venous low and high limits using slider """ test.startSection("Set the venous low and high limits using slider") utils.waitForGUI(1) for venous_value in range(config.VENOUS_VALUE_50, config.VENOUS_VALUE_600, config.POSITIVE_BUFFER): utility.set_venous_ranges_max_val(venous_value) for venous_value in range(config.VENOUS_VALUE_20, config.VENOUS_VALUE_570, config.POSITIVE_BUFFER): utility.set_venous_ranges_min_val(venous_value) test.endSection() def set_arterial_high_and_low_limits_using_slider(): """ Method to set the arterial low and high limits using slider """ test.startSection("Set the arterial low and high limits using slider") utils.waitForGUI(1) utility.set_arterial_ranges_min_val(config.ARTERIAL_VALUE_NEGATIVE_300) for arterial_value in range(config.ARTERIAL_VALUE_0, config.ARTERIAL_VALUE_NEGATIVE_270, config.NEGATIVE_BUFFER): utility.set_arterial_ranges_max_val(arterial_value) test.endSection() def verify_standby_mode_from_create_treatment(): """ 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 """ hd_simulator.cmd_send_hd_operation_mode(op_mode = 3) mouseClick(waitForObject(names.o_MainHome_CREATE_TREATMENT_Text)) payload = integer_to_bytearray(0) payload += integer_to_bytearray(1) hd_simulator.cmd_send_hd_general_response(message_id = 57, accepted = 1, reason = 0, is_pure_data = False, has_parameters = True, parameters_payload = payload) hd_simulator.cmd_send_hd_operation_mode(4, 0) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), config.PATIENT_ID) test.compare(waitForObject(names.o_PreTreatmentBase_Patient_ID_Text).text, config.PATIENT_ID_TEXT, "Title text should be -> "+str(config.PATIENT_ID_TEXT)) mouseClick(waitForObject(names.o_create_treatment_continue_button)) 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)) for blood_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_FLOW_RATE]: test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, blood_flow_rate, 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)) for dialysate_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_FLOW_RATE]: test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, dialysate_flow_rate, 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)) for duration in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DURATION]: test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, 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)) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_switch)) test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_Text).text, "OFF text should be enabled") test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinDispensingRateValue_switch).enabled, True, "Heparin Dispensing Rate off switch should be enabled") mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_switch)) test.compare(config.ON_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_On_Text).text, "ON text should be enabled") for heparin_dispensing_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_DISPENSING_RATE]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, heparin_dispensing_rate, 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(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_switch)) test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_Text).text, "OFF text should be enabled") test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinBolusVolumeValue_switch).enabled , True, "Heparin Dispensing Rate off switch should be enabled") mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_switch)) test.compare(config.ON_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_On_Text).text, "ON text should be enabled") for heparin_bolus_volume in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_BOLUS_VOLUME]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, heparin_bolus_volume, 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)) for heparin_stop_time in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_STOP_TIME]: test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, 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)) for saline_bolus in config.CREATE_TREATMENT_PARAMETER_RANGE[config.SALINE_BOLUS_VOLUME]: test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, saline_bolus, 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])) mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect).text.text, config.ACID_CONCENTRATE[1], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[1])) mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect).text.text, config.ACID_CONCENTRATE[2], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[2])) 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 dialyzer type") 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])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).text.text, config.DIALYZER_TYPE[1], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[1])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect).text.text, config.DIALYZER_TYPE[2], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[2])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect).text.text, config.DIALYZER_TYPE[3], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[3])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect).text.text, config.DIALYZER_TYPE[4], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[4])) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect5_TouchRect) test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect5_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect5_TouchRect).text.text, config.DIALYZER_TYPE[5], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[5])) 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)) for dialysate_temperature in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_TEMPERATURE]: test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, dialysate_temperature, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) test.endSection() set_arterial_low_and_high_limits_using_slider() #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_venous_low_and_high_limits_using_slider() 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)) for blood_pressure_measurement_interval in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL]: test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, blood_pressure_measurement_interval, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text).text, "OFF text should display for value 0") 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)) for rinseback_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.RINSEBACK_FLOW_RATE]: test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, rinseback_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) test.endSection() test.endSection() def create_custom_values_for_treatment(): """ Method to set create custom treatment slider value based on user input """ test.startSection("Method to set treatment value based on user input") #flicker screen into blood dialysate section parameter_object = set_parameter_type(text = config.BLOOD_FLOW_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") #set custom values for parameters test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.BLOOD_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DIALYSATE_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DURATION], config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) #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) #set custom values for parameters test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_DISPENSING_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_BOLUS_VOLUME], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) #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) #set custom values for parameters test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_STOP_TIME], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.SALINE_BOLUS_VOLUME], config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS_VOLUME) #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) mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) #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) mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) #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) mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) #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) mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect) #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_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DIALYSATE_TEMPERATURE], config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) #scroll the screen to the title rinseback flow rate parameter_object = set_parameter_type(text = 150) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) #set custom values for parameters test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL], config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.RINSEBACK_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) hd_simulator.cmd_send_hd_operation_mode(4, 0) utils.waitForGUI(0.3) test.log("Verification of page step indicator from patient id page") utility.verify_page_step_indicator(screen_obj=names.o_PreTreatmentBase_gridSteps_Grid_1, treatment_step=PRE_TREATMENT_STEP, treatment_screens=config.PRE_TREATMENT_SCREENS) test.compare(waitForObjectExists(names.o_create_treatment_skip_button).enabled , True, "Skip button should be enabled") test.compare(str(waitForObjectExists(names.o_create_treatment_skip_button).text), config.SKIP_TEXT, "Skip Button text should be {}".format(config.SKIP_TEXT)) mouseClick(waitForObject(names.o_create_treatment_skip_button)) mouseClick(waitForObject(names.o_back_button_confirm_treatment)) utils.waitForGUI(0.2) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), config.PATIENT_ID) test.compare(waitForObject(names.o_PreTreatmentBase_Patient_ID_Text).text, config.PATIENT_ID_TEXT, "Title text should be -> "+str(config.PATIENT_ID_TEXT)) mouseClick(waitForObject(names.o_create_treatment_continue_button)) test.log("Verification of page step indicator from create custom treatment page") utility.verify_page_step_indicator(screen_obj=names.o_PreTreatmentCreate_gridSteps_Grid, treatment_step=PRE_TREATMENT_STEP, treatment_screens=config.PRE_TREATMENT_SCREENS) verify_create_custom_treatment_parameter() verify_request_rejection_mode() #verification of create treatment screen after request rejection verify_custom_treatment_record_rejected() verify_standby_mode_from_create_treatment() create_custom_treatment_record() verify_request_continue_mode() verify_the_confirm_treatment_screen_is_displayed() mouseClick(waitForObject(names.o_back_button_confirm_treatment)) #set custom values for treatment parameters create_custom_values_for_treatment() verify_request_continue_mode() #verification of records from confirm treatment screen verify_the_confirm_treatment_screen_is_displayed() verify_operational_details_from_confirm_treatment_screen() verify_prescriptional_details_from_confirm_treatment_screen() mouseClick(waitForObject(names.o_PreTreatmentConfirm_confirmButton_TouchRect)) utils.waitForGUI(0.2) mouseClick(waitForObject(names.o_back_button_confirm_treatment)) verify_manual_validation_mode() utils.tstDone()