Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r2650a9f3f8ca6571294f6ce322327b62fc832ab9 -r173066a087b0ae8ba390831838833aec35b8d529 --- tst_create_custom_treatment/test.py (.../test.py) (revision 2650a9f3f8ca6571294f6ce322327b62fc832ab9) +++ tst_create_custom_treatment/test.py (.../test.py) (revision 173066a087b0ae8ba390831838833aec35b8d529) @@ -172,32 +172,42 @@ 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)) - x_shift_location = 10 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 = -30 # 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) @@ -242,6 +252,9 @@ 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() @@ -703,19 +716,19 @@ 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() + 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))