Index: shared/scripts/names.py =================================================================== diff -u -r99607ca6262a62ca36fc37242aec8dff604a8c2d -r9fb8abff0916942c7d80874b27c1729c5373c12b --- shared/scripts/names.py (.../names.py) (revision 99607ca6262a62ca36fc37242aec8dff604a8c2d) +++ shared/scripts/names.py (.../names.py) (revision 9fb8abff0916942c7d80874b27c1729c5373c12b) @@ -71,8 +71,12 @@ 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"} +o_arterial_left_slider = {"container": o_arterial_slider, "gradient": 0, "id": "_handlerLeft", "type": "Rectangle", "unnamed": 1, "visible": True} +o_arterial_right_slider = {"container": o_Overlay, "gradient": 0, "id": "_handlerRight", "type": "Rectangle", "unnamed": 1, "visible": True} +o_arterial_text_low = {"container": o_Overlay, "text": "LOW", "type": "Text", "unnamed": 1, "visible": True} +o_arterial_max_val = {"container": o_arterial_limitbar, "id": "_textMaximum", "type": "Text", "unnamed": 1, "visible": True} +o_arterial_min_val = {"container": o_arterial_limitbar, "id": "_textMinimum", "type": "Text", "unnamed": 1, "visible": True} - def pressure_pop_up_text_obj(text): o_pop_up_pressure_text_obj["text"] = text return o_pop_up_pressure_text_obj Index: tst_main_treatment_pressure/test.py =================================================================== diff -u -r99607ca6262a62ca36fc37242aec8dff604a8c2d -r9fb8abff0916942c7d80874b27c1729c5373c12b --- tst_main_treatment_pressure/test.py (.../test.py) (revision 99607ca6262a62ca36fc37242aec8dff604a8c2d) +++ tst_main_treatment_pressure/test.py (.../test.py) (revision 9fb8abff0916942c7d80874b27c1729c5373c12b) @@ -13,11 +13,13 @@ import names +from builtins import int as pyInt from configuration.config import * from configuration.utility import * 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 @@ -127,6 +129,91 @@ test.endSection() +def set_arterial_ranges_min_val(art_low): + """ + Method to set the Arterial range + maximum value to user expected value + @param art_low - user expected value + """ + test.startSection("Set Arterial range minimum value " + + "to {val}".format(val=art_low)) + arterial_min = waitForObjectExists(names.o_arterial_limitbar) + arterial_min_val = pyInt(arterial_min.minimum) + low_handler_parent = object.parent(\ + waitForObjectExists(names.o_arterial_text_low)) + low_handler_children = object.children(low_handler_parent) + low_handler = low_handler_children[-2] + width = pyInt(low_handler.width) + height = pyInt(low_handler.height) + width = width + 15 + height = height + 10 + if arterial_min_val == art_low: + test.passes("Arterial range minimum is already set to " + + "{minimum}".format(minimum=art_low)) + elif arterial_min_val < art_low: + while waitFor("arterial_min.minimum != art_low"): + mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + elif arterial_min_val > art_low: + while waitFor("arterial_min.minimum != art_low"): + mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.compare(arterial_min_val, art_low, + "Actual Arterial range minimum value: " + + "{min_range} is ".format(min_range=arterial_min_val) + + "equal to Expected value: {exp}".format(exp=art_low)) + test.endSection() + + +def set_arterial_ranges_max_val(art_high): + """ + Method to set the Arterial range + maximum value to user expected value + @param art_high - user expected value + """ + test.startSection("Set Arterial range maximum value " + + "to {val}".format(val=art_high)) + arterial_max = waitForObjectExists(names.o_arterial_limitbar) + arterial_max = pyInt(arterial_max.maximum) + high_handler_parent = object.parent(\ + waitForObjectExists(names.o_arterial_text_low)) + high_handler_children = object.children(high_handler_parent) + high_handler = high_handler_children[-1] + width = pyInt(high_handler.width) + height = pyInt(high_handler.height) + width = width - 15 + height = height - 10 + if arterial_max == art_high: + test.passes("Arterial range maximum is already set to " + + "{maximum}".format(maximum=art_high)) + elif arterial_max < art_high: + while arterial_max != art_high: + mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max += 10 + elif arterial_max > art_high: + while arterial_max != art_high: + mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max -= 10 + test.compare(arterial_max, art_high, + "Actual Arterial range maximum value: " + + "{max_range} is ".format(max_range=arterial_max) + + "equal to Expected value: {exp}".format(exp=art_high)) + test.endSection() + + +def set_arterial_low_and_high_limits_using_slider(): + open_pressure_pop_up() + set_arterial_ranges_max_val(art_high=-100) + set_arterial_ranges_min_val(art_low=-250) + set_arterial_ranges_max_val(art_high=-10) + set_arterial_ranges_min_val(art_low=-120) + set_arterial_ranges_max_val(art_high=0) + set_arterial_ranges_min_val(art_low=-300) + close_the_pop_up() + + def verify_arterial_and_venous_value_on_pressure_pop_up(accepted, reason_id, art_low, art_high, ven_low, ven_high): """ @@ -299,6 +386,7 @@ ven_low=ven_low, ven_high=ven_high) test.endSection() + def set_arterial_pressure_and_verify_the_color(): """ Method to set arterial pressure @@ -382,7 +470,7 @@ def main(): utils.tstStart(__file__) - start_application(AUT_NAME) + startApplication(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, @@ -392,23 +480,25 @@ verify_the_constants() + set_arterial_low_and_high_limits_using_slider() + 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) - + verify_pressures_on_treatment_and_pop_up_screen(accepted=REJECTED, reason=39, art_low=ART_LOW_VAL_MINUS_200, art_high=ART_HIGH_VAL_70, ven_low=VENOUS_LOW_VAL_MINUS_200, ven_high=VENOUS_HIGH_VAL_150) - + verify_pressures_on_treatment_and_pop_up_screen(accepted=ACCEPTED, reason=0, art_low=ART_LOW_VAL_MINUS_80, art_high=ART_HIGH_VAL_175, ven_low=VENOUS_LOW_VAL_110, ven_high=VENOUS_HIGH_VAL_250) - + verify_pressures_on_treatment_and_pop_up_screen(accepted=REJECTED, reason=21, art_low=ART_LOW_VAL_MINUS_30, art_high=ART_HIGH_VAL_100, ven_low=VENOUS_LOW_VAL_MINUS_390, ven_high=VENOUS_HIGH_VAL_300) - + utils.tstDone()