Index: tst_create_custom_treatment/test.py =================================================================== diff -u -rcdc2b6ae80bb42957f9e1e225f5f64140614efd6 -r173066a087b0ae8ba390831838833aec35b8d529 --- tst_create_custom_treatment/test.py (.../test.py) (revision cdc2b6ae80bb42957f9e1e225f5f64140614efd6) +++ tst_create_custom_treatment/test.py (.../test.py) (revision 173066a087b0ae8ba390831838833aec35b8d529) @@ -172,38 +172,53 @@ 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]: + 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 = -20 # mouse click was dropping off the slider + 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.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment).label, config.HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(config.HEPARIN_DISPENSING_RATE)) - utils.waitForGUI(1) + 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() @@ -212,7 +227,7 @@ 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) + # utils.waitForGUI(1) for heparin_bolus_volume in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_BOLUS_VOLUME][::-1]: # correcting the automated mouseClick x-location, this is needed for tighter set sliders (segments between ticks are small) x_shift_location = 0 @@ -237,20 +252,39 @@ 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]: @@ -355,7 +389,7 @@ width_buffer = slider_parameter[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) + # utils.waitForGUI(0.5) test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+" slider value should set to " +str(value)) @@ -688,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))