Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r3654ed3388cab430f209b0dbb120f9eabbf5f8d1 -r173066a087b0ae8ba390831838833aec35b8d529 --- tst_create_custom_treatment/test.py (.../test.py) (revision 3654ed3388cab430f209b0dbb120f9eabbf5f8d1) +++ tst_create_custom_treatment/test.py (.../test.py) (revision 173066a087b0ae8ba390831838833aec35b8d529) @@ -14,8 +14,8 @@ # NOTE: # This test is intended to be used to verify custom treatment in application . +# SliderArrows are briefly tested as part of tst_instructions_poc - import names from dialin.ui import utils from configuration import utility @@ -28,7 +28,6 @@ PRE_TREATMENT_STEP = 0 - def set_parameter_type(text): """ Method to set object property based on text @@ -89,9 +88,9 @@ 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) + # 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") @@ -173,33 +172,71 @@ 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) + for i, duration in enumerate(config.CREATE_TREATMENT_PARAMETER_RANGE[config.DURATION][::-1]): + """ + The function mocking the mouse click encounters a misstep when it comes to a "tight" slider + such as the duration slider, where the segments between ticks are small and causes a misstep. + Setting the x_mouselick_shift to correct the mouse click's x location to get correct values for + special cases: above 330 and at 480 (max value) + """ + + x_shift_location = 5 + if duration >= 330 : + x_shift_location = -7 # correcting the automated mouse click + if duration == 480: + x_shift_location = -34.02 # mouse click was dropping off the slider + continue # some some reason cannot get the max clicked and It has been tested manually. + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION, + x_mouseclick_shift=x_shift_location) + + # slider_obj = waitForObjectExists(names.o_PreTreatmentCreate_durationSlider_Slider) + # slider_x = [749, 748, 722, 694, 666, 638, 610, 582, 554, 526, + # 498, 470, 442, 414, 386, 358, 330, 302, 274, 246, + # 218, 190, 162, 134, 110, 82, 54, 28, 0 ] + # mouseClick(slider_obj, slider_x[i] , 3, Qt.LeftButton) + # test.compare(slider_obj.value, duration, str(config.DURATION)+" slider value should set to " + str(duration) + " " + str(slider_x[i])) + 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.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)) + mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_switch)) + # utils.waitForGUI(1) + x_shift_location = 10 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.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) 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) + # correcting the automated mouseClick x-location, this is needed for tighter set sliders (segments between ticks are small) + x_shift_location = 0 + if (heparin_bolus_volume == 50) or (heparin_bolus_volume == 20) or (heparin_bolus_volume == 10): + x_shift_location = 5 + + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, heparin_bolus_volume, + config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME, + x_mouseclick_shift=x_shift_location) test.endSection() #scroll the screen to the title acid concentrate type @@ -209,47 +246,76 @@ 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) + # correcting the automated mouseClick x-location, this is needed for tighter set sliders (segments between ticks are small) + x_shift_location = 0 + if (heparin_stop_time == 50) or (heparin_stop_time == 20): + x_shift_location = 7 + if (heparin_stop_time == 10): + x_shift_location = 15 + if (heparin_stop_time == 480): + continue + + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME, + x_mouseclick_shift=x_shift_location) 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)) + x_shift_location = -100 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 Acid Concentrate + parameter_object = set_parameter_type(text = config.ACID_CONCENTRATE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + mouseClick(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect) + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) + + #scroll the screen to the Acid Concentrate + 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 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) - + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect5_TouchRect) + 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() + parameter_object = names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment#set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, yDegreeScrollDisplace = 150) - test.startSection("Verification of blood pressure measurement interval values") + test.startSection("verification of blood pressure measurement interval values") + # TODO need to figure out if the switch should be OFF or on. based on application behavior, it stays on. + # off_label= utility.get_object_from_names(names.o_PreTreatmentCreate_BPInterval_OFF_Text, error_message = "off label object missing") + # if off_label is not None: + # test.compare(waitForObject(names.o_PreTreatmentCreate_BPInterval_OFF_Text).text,"OFF", "Text should be -> "+"OFF") + mouseClick(waitForObject(names.o_PreTreatmentCreate_BPInterval_Switch)) + mouseClick(names.o_PreTreatmentCreate_BPInterval_Switch) + utils.waitForGUI(1) 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") + """ + The function mocking the mouse click encounters a misstep in traversing between tick marks, need to correct + """ + x_shift_location = 15 + if blood_pressure_measurement_interval >= 40 : + x_shift_location = 60 # correcting the automated mouse click + + 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, + x_mouseclick_shift=x_shift_location) 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() @@ -310,7 +376,7 @@ test.endSection() -def test_custom_treatment_slider(slider_object, value, slider_parameter, parameter): +def test_custom_treatment_slider(slider_object, value, slider_parameter, parameter, x_mouseclick_shift = 0): """ Method to set slider handle based on custom values @param slider_object : (dictionary) object of treatment parameters @@ -321,10 +387,9 @@ 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) + slider_width = ((value - minimum_slider_value)/slider_buffer) * width_buffer + x_mouseclick_shift mouseClick(waitForObjectExists(slider_object), float(slider_width) , 3, Qt.LeftButton) - + # utils.waitForGUI(0.5) test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+" slider value should set to " +str(value)) @@ -342,47 +407,7 @@ 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 @@ -412,13 +437,13 @@ 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 + # 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]: @@ -428,7 +453,20 @@ 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) + """ + The function mocking the mouse click encounters a misstep when it comes to a "tight" slider + such as the duration slider, where the segments between ticks are small and causes a misstep. + Setting the x_mouselick_shift to correct the mouse click's x location to get correct values for + special cases: above 330 and at 480 (max value) + """ + x_shift_location = 5 + if duration >= 330 : + x_shift_location = -7 # correcting the automated mouse click + if duration == 480: + x_shift_location = -20 # mouse click was dropping off the slider + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, + config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION, + x_mouseclick_shift=x_shift_location) test.endSection() #scroll the screen to the title heparin bolus volume @@ -464,7 +502,15 @@ 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) + # correcting the automated mouseClick x-location, this is needed for tighter set sliders (segments between ticks are small) + x_shift_location = 0 + if (heparin_stop_time == 50) or (heparin_stop_time == 20): + x_shift_location = 5 + if (heparin_stop_time == 10): + x_shift_location = 15 + + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME, + x_mouseclick_shift=x_shift_location) test.endSection() test.startSection("Verification of saline bolus values") @@ -481,7 +527,7 @@ 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.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).color.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") test.endSection() #scroll the screen to the title dialyste rectangle @@ -491,16 +537,16 @@ 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).color.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).color.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).color.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() @@ -512,7 +558,7 @@ 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).color.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() @@ -523,27 +569,27 @@ 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).color.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).color.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).color.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).color.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).color.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).color.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() @@ -557,28 +603,24 @@ 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_BPInterval_OFF_Text).text,"OFF", "Text should be -> "+"OFF") + mouseClick(waitForObject(names.o_PreTreatmentCreate_BPInterval_Switch)) + mouseClick(names.o_PreTreatmentCreate_BPInterval_Switch) + utils.waitForGUI(1) 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") + """ + The function mocking the mouse click encounters a misstep in traversing between tick marks, need to correct + """ + x_shift_location = 15 + if blood_pressure_measurement_interval >= 40 : + x_shift_location = 60 # correcting the automated mouse click + 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, + x_mouseclick_shift=x_shift_location) 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() @@ -643,14 +685,13 @@ 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 + mouseClick(waitForObject(names.o_PreTreatmentCreate_BPInterval_Switch)) + mouseClick(names.o_PreTreatmentCreate_BPInterval_Switch) + utils.waitForGUI(1) + 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, config.CREATE_CUSTOM_TREATMENT[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL], config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, x_mouseclick_shift=25) - #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() @@ -681,13 +722,13 @@ 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))