Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rf9cde78342e2769d5a6429eef23dd08ac64dbe2c -r4ddb4aa472a16aac2ac3530138d3b30cb83a1485 --- shared/scripts/configuration/utility.py (.../utility.py) (revision f9cde78342e2769d5a6429eef23dd08ac64dbe2c) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 4ddb4aa472a16aac2ac3530138d3b30cb83a1485) @@ -117,6 +117,55 @@ test.endSection() +def set_venous_ranges_max_val(ven_high): + """ + Method to set the Venous range maximum value to user expected value + @param ven_high - (int) user expected value + """ + test.startSection("Set Venous range maximum value to {}".format(ven_high)) + ven_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_max = pyInt(ven_max.maximum) + ven_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_min = pyInt(ven_min.minimum) + high_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous)) + high_handler_children = object.children(high_handler_parent) + high_handler = high_handler_children[-1] + width = pyInt(high_handler.width) - 15 + height = pyInt(high_handler.height) - 10 + if ven_max == ven_high: + test.passes("Venous range maximum is already set to {}".format(ven_high)) + elif ven_max < ven_high: + while ven_max != ven_high: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_max += 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) + break + else: + continue + elif ven_max > ven_high: + while ven_max != ven_high: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_max -= 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) + break + else: + continue + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(high_handler_parent.maxValue, ven_max, "Venous range maximum value cannot be moved beyond {}".format(ven_max)) + else: + test.compare(ven_max, ven_high, "Actual Venous range maximum value: {} is equal to Expected value: {}".format(ven_max, ven_high)) + test.endSection() #Methods for create custom treatment def set_venous_ranges_min_val(ven_low): @@ -170,60 +219,6 @@ "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) test.endSection() - -def set_venous_ranges_max_val(ven_high): - """ - Method to set the Venous range maximum value to user expected value - @param ven_high - (int) user expected value - """ - test.startSection("set Venous range maximum value to {}".format(ven_high)) - ven_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) - ven_max = pyInt(ven_max.maximum) - ven_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) - ven_min = pyInt(ven_min.minimum) - high_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous)) - high_handler_children = object.children(high_handler_parent) - high_handler = high_handler_children[-1] - width = pyInt(high_handler.width) - 15 - height = pyInt(high_handler.height) - 10 - if ven_max == ven_high: - test.passes("Venous range maximum is already set to {}".format(ven_high)) - elif ven_max < ven_high: - while ven_max != ven_high: - squish.mouseDrag(high_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) - ven_max += 10 - # venous blood pressure low limit should be lower than the high limit by at least 30mmHg - if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) - test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) - break - else: - continue - elif ven_max > ven_high: - while ven_max != ven_high: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) - ven_max -= 10 - # venous blood pressure low limit should be lower than the high limit by at least 30mmHg - if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) - test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) - break - else: - continue - # venous blood pressure low limit should be lower than the high limit by at least 30mmHg - if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - test.compare(high_handler_parent.maxValue, ven_max, - "Venous range maximum value cannot be moved beyond {}".format(ven_max)) - else: - test.compare(ven_max, ven_high, - "Actual Venous range maximum value: {} is equal to Expected value: {}".format(ven_max, ven_high)) - test.endSection() - - def set_arterial_ranges_min_val(art_low): """ Method to set the Arterial range maximum value to user expected value