Index: shared/scripts/configuration/config.py =================================================================== diff -u -r8a2f99cdf750415302f56df3a674b68bdacc96fe -r99607ca6262a62ca36fc37242aec8dff604a8c2d --- shared/scripts/configuration/config.py (.../config.py) (revision 8a2f99cdf750415302f56df3a674b68bdacc96fe) +++ shared/scripts/configuration/config.py (.../config.py) (revision 99607ca6262a62ca36fc37242aec8dff604a8c2d) @@ -91,6 +91,7 @@ } #pressure +PRESSURE_STEPS = 10 ARTERIAL_PRESSURE_MINIMUM = -400 ARTERIAL_PRESSURE_MAXIMUM = +600 ARTERIAL_PRESSURE_LOW_MIN = -300 Index: shared/scripts/names.py =================================================================== diff -u -r8a2f99cdf750415302f56df3a674b68bdacc96fe -r99607ca6262a62ca36fc37242aec8dff604a8c2d --- shared/scripts/names.py (.../names.py) (revision 8a2f99cdf750415302f56df3a674b68bdacc96fe) +++ shared/scripts/names.py (.../names.py) (revision 99607ca6262a62ca36fc37242aec8dff604a8c2d) @@ -60,22 +60,17 @@ o_treatmentAdjustmentPressures_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentPressures", "type": "ContentItem"} o_arterial_range_slider = {"container": o_treatmentAdjustmentPressures_Screen, "id": "_arterialPressure", "type": "PressureRangeSlider"} -o_arterial_progress = {"container": o_arterial_range_slider , "id": "_pressureRangeBar", "type": "RangeBar" } -o_arterial_marker = {"container": o_arterial_progress , "id": "_rangeMarkerValue", "type": "RangeMarker" } -o_arterial_progress_textValue = {"container": o_arterial_marker , "id": "_textValue" , "type": "Text" } -# arterial slider -o_arterial_slider = {"container": o_arterial_range_slider , "id": "_pressureSlider" , "type": "RangeSlider" } -# arterial limits bar -o_arterial_limitbar = {"container": o_arterial_range_slider , "id": "_rangeRect" , "type": "RangeRect" } -# venous pressure range slider -o_venous_range_slider = {"container": o_treatmentAdjustmentPressures_Screen, "id": "_venousPressure" , "type": "PressureRangeSlider"} -# venous progress -o_venous_progress = {"container": o_venous_range_slider , "id": "_pressureRangeBar", "type": "RangeBar" } -o_venous_marker = {"container": o_venous_progress , "id": "_rangeMarkerValue", "type": "RangeMarker" } -o_venous_progress_textValue = {"container": o_venous_marker , "id": "_textValue" , "type": "Text" } -# venous slider -o_venous_slider = {"container": o_venous_range_slider , "id": "_pressureSlider" , "type": "RangeSlider" } -o_venous_limitbar = {"container": o_venous_range_slider , "id": "_rangeRect" , "type": "RangeRect" } +o_arterial_progress = {"container": o_arterial_range_slider , "id": "_pressureRangeBar", "type": "RangeBar"} +o_arterial_marker = {"container": o_arterial_progress, "id": "_rangeMarkerValue", "type": "RangeMarker"} +o_arterial_progress_text_value = {"container": o_arterial_marker, "id": "_textValue", "type": "Text"} +o_arterial_slider = {"container": o_arterial_range_slider, "id": "_pressureSlider" , "type": "RangeSlider"} +o_arterial_limitbar = {"container": o_arterial_range_slider, "id": "_rangeRect", "type": "RangeRect"} +o_venous_range_slider= {"container": o_treatmentAdjustmentPressures_Screen, "id": "_venousPressure", "type": "PressureRangeSlider"} +o_venous_progress = {"container": o_venous_range_slider , "id": "_pressureRangeBar", "type": "RangeBar"} +o_venous_marker = {"container": o_venous_progress , "id": "_rangeMarkerValue", "type": "RangeMarker" } +o_venous_progress_text_value = {"container": o_venous_marker , "id": "_textValue", "type": "Text"} +o_venous_slider = {"container": o_venous_range_slider , "id": "_pressureSlider" , "type": "RangeSlider" } +o_venous_limitbar = {"container": o_venous_range_slider, "id": "_rangeRect" , "type": "RangeRect"} def pressure_pop_up_text_obj(text): Index: tst_main_treatment_pressure/test.py =================================================================== diff -u -r8a2f99cdf750415302f56df3a674b68bdacc96fe -r99607ca6262a62ca36fc37242aec8dff604a8c2d --- tst_main_treatment_pressure/test.py (.../test.py) (revision 8a2f99cdf750415302f56df3a674b68bdacc96fe) +++ tst_main_treatment_pressure/test.py (.../test.py) (revision 99607ca6262a62ca36fc37242aec8dff604a8c2d) @@ -18,7 +18,8 @@ from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator - +in_range_color = "#ffffff" +out_of_range_color = "#c53b33" ART_LOW_VAL_MINUS_120 = -120 ART_HIGH_VAL_160 = 160 ART_LOW_VAL_MINUS_200 = -200 @@ -122,8 +123,7 @@ test.compare(venous_scale_max, VENOUS_PRESSURE_MAXIMUM, "Venous scale range maximum value should be " + "{max}".format(max=VENOUS_PRESSURE_MAXIMUM)) - test.log("Closing pressure pop up") - mouseClick(waitForObjectExists(names.o_uf_close_button)) + close_the_pop_up() test.endSection() @@ -253,6 +253,11 @@ test.endSection() +def close_the_pop_up(): + test.log("Closing pressure pop up") + mouseClick(waitForObjectExists(names.o_uf_close_button)) + + def verify_reject_msg_on_pop_up(reason_id): """ Method verify the rejection message @@ -294,19 +299,102 @@ ven_low=ven_low, ven_high=ven_high) test.endSection() +def set_arterial_pressure_and_verify_the_color(): + """ + Method to set arterial pressure + verify the value and color + """ + test.startSection("Set arterial pressure and verify value and color") + open_pressure_pop_up() + for arterial_prs in range(ARTERIAL_PRESSURE_MINIMUM , \ + ARTERIAL_PRESSURE_MAXIMUM + PRESSURE_STEPS, \ + PRESSURE_STEPS * 10): + test.log("Setting arterial pressure {prs}".format(prs=arterial_prs)) + hd.cmd_set_pressure_occlusion_data(arterial_prs=arterial_prs, venous_prs=0, + blood_pump_occlusion=0, + dialysate_inlet_pump_occlusion=0, + dialysate_outlet_pump_occlusion=0) + arterial_current_value = waitForObjectExists(names.o_arterial_marker).value + arterial_limit_min = waitForObjectExists(names.o_arterial_limitbar).minimum + arterial_limit_max = waitForObjectExists(names.o_arterial_limitbar).maximum + arterial_slider_value = waitForObjectExists(names.o_arterial_range_slider).value + test.compare(arterial_slider_value, arterial_prs, "Actual arterial pressure: " + + "{act} ".format(act=arterial_slider_value) + "should be equal to " + + "expected arterial pressure: {exp}".format(exp=arterial_prs)) + arterial_progress_value = waitForObjectExists(names.o_arterial_progress_text_value) + test.compare(arterial_progress_value.text.toInt(), arterial_prs, + "Actual arterial pressure: " + "{act} ".format(\ + act=arterial_progress_value.text.toInt()) + + "should be equal to expected arterial " + + "pressure: {exp}".format(exp=arterial_prs)) + if arterial_limit_min <= arterial_current_value <= arterial_limit_max: + test.compare(arterial_progress_value.color.name, in_range_color, + "Arterial progress value {val} is in range".format(\ + val=arterial_current_value)) + else: + test.compare(arterial_progress_value.color.name, out_of_range_color, + "Arterial progress value {val} is out of range".format(\ + val=arterial_current_value)) + close_the_pop_up() + test.endSection() + + +def set_venous_pressure_and_verify_the_color(): + """ + Method to set venous pressure + verify the value and color + """ + test.startSection("Set Venous pressure and verify value and color") + open_pressure_pop_up() + for venous_prs in range(VENOUS_PRESSURE_MINIMUM, \ + VENOUS_PRESSURE_MAXIMUM + \ + PRESSURE_STEPS, PRESSURE_STEPS * 10): + test.log("Setting Venous pressure {prs}".format(prs=venous_prs)) + hd.cmd_set_pressure_occlusion_data(arterial_prs=0, venous_prs=venous_prs, + blood_pump_occlusion=0, + dialysate_inlet_pump_occlusion=0, + dialysate_outlet_pump_occlusion=0) + venous_current_value = waitForObjectExists(names.o_venous_marker).value + venous_limit_min = waitForObjectExists(names.o_venous_limitbar).minimum + venous_limit_max = waitForObjectExists(names.o_venous_limitbar).maximum + venous_slider_value = waitForObjectExists(names.o_venous_range_slider).value + test.compare(venous_slider_value, venous_prs, "Actual venous pressure: " + + "{act} ".format(act=venous_slider_value) + "should be equal to " + + "expected venous pressure: {exp}".format(exp=venous_prs)) + venous_progress_value = waitForObjectExists(names.o_venous_progress_text_value) + test.compare(venous_progress_value.text.toInt(), venous_prs, + "Actual venous pressure: " + "{act} ".format(\ + act=venous_progress_value.text.toInt()) + + "should be equal to expected venous " + + "pressure: {exp}".format(exp=venous_prs)) + if venous_limit_min <= venous_current_value <= venous_limit_max: + test.compare(venous_progress_value.color.name, in_range_color, + "Venous progress value {val} is in range".format(\ + val=venous_current_value)) + else: + test.compare(venous_progress_value.color.name, out_of_range_color, + "Venous progress value {val} is out of range".format(\ + val=venous_current_value)) + close_the_pop_up() + test.endSection() + def main(): utils.tstStart(__file__) start_application(AUT_NAME) hd.cmd_send_power_on_self_test_version_request() - hd.cmd_set_treatment_states_data(sub_mode=2, uf_state=0, saline_state=0, heparin_state=0, - rinseback_state=0, recirculate_state=0, blood_prime_state=0, - treatment_end_state=0, treatment_stop_state=0) + hd.cmd_set_treatment_states_data(sub_mode=2, uf_state=0, saline_state=0, + heparin_state=0, rinseback_state=0, + recirculate_state=0, blood_prime_state=0, + treatment_end_state=0, treatment_stop_state=0) verify_the_constants() + set_arterial_pressure_and_verify_the_color() + set_venous_pressure_and_verify_the_color() + verify_pressures_on_treatment_and_pop_up_screen(accepted=ACCEPTED, reason=0, art_low=ART_LOW_VAL_MINUS_120, art_high=ART_HIGH_VAL_160, ven_low=VENOUS_LOW_VAL_MINUS_310, ven_high=VENOUS_HIGH_VAL_170) @@ -324,14 +412,3 @@ ven_low=VENOUS_LOW_VAL_MINUS_390, ven_high=VENOUS_HIGH_VAL_300) utils.tstDone() - - hd.cmd_send_treatment_adjust_pressures_limit_response(accepted=ACCEPTED, - reason=0, - arterial_low=-301, - arterial_high=201, - venous_low=-101, - venous_high=601) - - snooze(5) - -