Index: shared/scripts/configuration/config.py =================================================================== diff -u -r1b46227816628d8648501e93e0d392489f0829c3 -r941ef3c2c59d7977c23dd37a7af68a3aa84a60a9 --- shared/scripts/configuration/config.py (.../config.py) (revision 1b46227816628d8648501e93e0d392489f0829c3) +++ shared/scripts/configuration/config.py (.../config.py) (revision 941ef3c2c59d7977c23dd37a7af68a3aa84a60a9) @@ -49,3 +49,242 @@ BLOOD_PRESSURE_UNIT = "mmHg" HEART_RATE_UNIT = "BPM" + +KEYBOARD_SWITCH = ["ABC", "&123"] + +REJECTION_REASON = { + 0: "No Active Alarm List", + 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", # Request is not allowed in the current operating mode + 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", # Validated request was not confirmed by user in reasonable time + 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", # Request is not allowed if not in treatment mode + 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", # Request is not allowed in current treatment state + 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", # Request is not allowed so near end of treatment + 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", # Treatment duration is out of range + 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", # Treatment time change is less than currently elapsed treatment time + 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", # Blood flow is out of range + 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", # Dialysate flow is out of range + 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit + 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", # Ultrafiltration volume is out of range + 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", # Ultrafiltration rate is out of range + 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", # Treatment time change is less than minimum treatment time + 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", # Ultrafiltration is not currently in progress + 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", # Ultrafiltration is not currently paused + 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", # A saline bolus is in progress + 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", # A treatment parameter is out of range + 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", # The Heparin pre-stop setting is greater than the treatment duration + 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", # Arterial pressure low and high alarm limits are not inconsistent + 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", # Venous pressure low and high alarm limits are inconsistent + 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", # Saline bolus volume maximum has been reached - no more saline allowed + 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", # A saline bolus is not in progress + 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", # Requested user action is disabled in current state + 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", # Requested user action not allowed while alarm is active + 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", # Requested user action invalid + 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", # The treatment has been completed + 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed + 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", # Ultrafiltration volume is not set yet + 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", # The user has not confirmed patient connection + 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", # Heparin cannot be paused if not currently deliverying Heparin + 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", # Heparin cannot be resumed if not paused + 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", # Treatment cannot initiate if DG comm is lost + 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", # Post-treatment reservoirs drain not complete + 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", # Treatment cannot initiate if DG is not in standby idle state + 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", # Request message not formatted properly + 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", # Given date/time is invalid + 37: "REQUEST_REJECT_REASON____AVAILABLE_1", # Not used - available for use + 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", # Battery does not have enough charge to start treatment + 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", # Cannot move on to recirculate without completing full rinseback. + 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete + 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed + 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed + 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present + } + +NUM_OF_REQUEST_REJECT_REASONS = 43 + + + +#create custom treatment +PATIENT_ID = "demopatientid" +TREATMENT_TITLE = "Create a Custom Treatment" +HEPARIN_TYPE = "UFH 1,000 IU/mL" +ACID_CONCENTRATE = ["Fres. Naturalyte", "08-1251-1", "08-2251-0", "08-3251-9"] +BICARBONATE_CONCENTRATE = "Fres. Centrisol" +DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] +CONFIRM_TREATMENT_TITLE = "Confirm Treatment" +PRESCRIPTION_TITLE = "PRESCRIPTION" +OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" +COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", + "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", + "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", + "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} + +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' +PATIENT_ID_TEXT = "Patient ID" +PATIENT_ID = "demopatientid" +BLOOD_FLOW_RATE = "Blood Flow Rate" +DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" +DURATION = "Duration" +HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" +HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" +HEPARIN_STOP_TIME = "Heparin Stop Time" +SALINE_BOLUS_VOLUME = "Saline Bolus Volume" +HEPARIN_TYPE_TITLE = "Heparin Type" +SALINE_BOLUS_TITLE = "Saline Bolus" +ACID_CONCENTRATE_TITLE = "Acid Concentrate" +BICARBONATE_CONCENTRATE_TITLE = "Bicarbonate Concentrate" +DIALYZER_TYPE_TITLE = "Dialyzer Type" +DIALYSATE_TEMPERATURE = "Dialysate Temperature" +BLOOD_PRESSURE_MEASUREMENT_INTERVAL = "Blood Pressure Measurement Interval" +RINSEBACK_FLOW_RATE = "Rinseback Flow Rate" + +CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", + "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus", "Dialysate Temperature", + "Blood Pressure Measurement Interval", "Rinseback Flow Rate"] +TREATMENT_UNHIGHLIGHTED_COLOR = "#000000" +TREATMENT_HIGHLIGHTED_COLOR = "#135088" +OFF_TEXT = "OFF" +BACK_TEXT = "BACK" +CONTINUE_TEXT = "CONTINUE" + +PRESCRIPTION_DETAILS = { + "Blood Flow Rate": "mL/min", "Dialysate Flow Rate": "mL/min", + "Duration": "min", "Heparin Dispensing Rate": "mL/hr", + "Heparin Bolus Volume": "mL", "Heparin Stop Time": "min", + "Saline Bolus Volume": "mL", + "Dialysate Temperature": "°C", "Arterial Pressure Limit Low": "mmHg", + "Arterial Pressure Limit High": "mmHg","Blood Pressure Measure Interval":"min", + "Rinseback Rate" : "mL/min", "Venous Pressure Limit High": "mmHg", + "Venous Pressure Limit Low": "mmHg" +} + +OPERATIONAL_PARAMETERS = {"Heparin Type": HEPARIN_TYPE, "Acid Concentrate": "Fres. Naturalyte", + "Bicarbonate Concentrate": BICARBONATE_CONCENTRATE, "Dialyzer Type": "BB Diacap Pro 16H"} + + +#create custom treatment +HIGHER_VALUE_OF_BLOOD_FLOW_RATE = 500 +LOWER_VALUE_OF_BLOOD_FLOW_RATE = 100 +STEP_VALUE_OF_BLOOD_FLOW_RATE = 25 +BUFFER_LOW_AND_HIGH_LIMITS = 30 +ARTERIAL_VALUE_0 = 0 +ARTERIAL_VALUE_NEGATIVE_300 = -300 +ARTERIAL_VALUE_NEGATIVE_20 = -20 +ARTERIAL_VALUE_NEGATIVE_270 = -270 +VENOUS_VALUE_600 = 600 +VENOUS_VALUE_20 = 20 +VENOUS_VALUE_50 = 50 +VENOUS_VALUE_570 = 570 +POSITIVE_BUFFER = 10 +NEGATIVE_BUFFER = -10 + +#dictionary consist of custom treatment values +CREATE_CUSTOM_TREATMENT = { + "Blood Flow Rate": 250, + "Dialysate Flow Rate": 400, + "Duration": 270, + "Heparin Dispensing Rate": 0.5, + "Heparin Bolus Volume": 1, + "Heparin Stop Time": 100, + "Saline Bolus Volume": 200, + "Dialysate Temperature": 37, + "Blood Pressure Measurement Interval": 40, + "Rinseback Flow Rate": 100, + "Arterial Pressure Limit Low" : -30, + "Arterial Pressure Limit High" : 0, + "Blood Pressure Measure Interval" : 40, + "Rinseback Rate" : 100, + "Venous Pressure Limit High" : 590, + "Venous Pressure Limit Low": 560 + +} + +#dictionary consist of slider values of treatment parameters +CREATE_TREATMENT_PARAMETER_RANGE = { + "Blood Flow Rate": [100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500], + "Dialysate Flow Rate": [100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600], + "Duration": [60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 240, 255, 270, 285, 300, 315, 330, 345, 360, 375, 390, 405, 420, 435, 450, 465, 480], + "Heparin Dispensing Rate": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 0], + "Heparin Bolus Volume": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 0], + "Heparin Stop Time": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 0], + "Saline Bolus Volume": [100, 200, 300], + "Dialysate Temperature": [35.0, 35.5, 36.0, 36.5, 37.0], + "Blood Pressure Measurement Interval": [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 0], + "Rinseback Flow Rate": [50, 75, 100, 125, 150], +} + +#dictionary consist of slider minimum value, slider buffer value, width buffer of slider +CREATE_TREATMENT_SLIDER_VALUES = { + + "blood_flow_rate" : [100, 25, 46], + "dialysate_flow_rate" : [100, 50, 75], + "duration" : [60, 15, 26.6], + "heparin_dispensing_rate" : [0, 0.1, 75], + "heparin_bolus_volume" : [0, 0.1, 37], + "heparin_stop_time" : [0, 10, 15.9], + "saline_bolus" : [100, 100, 375], + "dialysate_temperature" : [35, 0.5, 187.5], + "arterial_pressure_limit_high" : [20, 10, 11.931], + "blood_pressure_measurement_interval" : [0, 5, 62], + "rinseback_flow_rate" : [50, 25, 187], +} + +# pretreatment_patient_connection +SYSTOLIC_PRESSSURE_120 = 120 +SYSTOLIC_PRESSSURE_113 = 113 +SYSTOLIC_PRESSSURE_150 = 150 +SYSTOLIC_PRESSSURE_175 = 175 +SYSTOLIC_PRESSSURE_200 = 200 +SYSTOLIC_PRESSSURE_200 = 200 +SYSTOLIC_PRESSSURE_251 = 251 +SYSTOLIC_PRESSSURE_59 = 59 +SYSTOLIC_PRESSSURE_15 = 15 +DIASTOLIC_PRESSSURE_25 = 25 +DIASTOLIC_PRESSSURE_39 = 39 +DIASTOLIC_PRESSSURE_74 = 74 +DIASTOLIC_PRESSSURE_80 = 80 +DIASTOLIC_PRESSSURE_85 = 85 +DIASTOLIC_PRESSSURE_60 = 60 +DIASTOLIC_PRESSSURE_150 = 150 +DIASTOLIC_PRESSSURE_200 = 200 +DIASTOLIC_PRESSSURE_201 = 201 +HEART_RATE_VAL_39 = 39 +HEART_RATE_VAL_60 = 60 +HEART_RATE_VAL_70 = 70 +HEART_RATE_VAL_85 = 85 +HEART_RATE_VAL_100 = 100 +HEART_RATE_VAL_101 = 101 +HEART_RATE_VAL_110 = 110 +HEART_RATE_VAL_181 = 181 +HEART_RATE_VAL_200 = 200 +SYSTOLIC_LOWER_LIMIT = 60 +SYSTOLIC_UPPER_LIMIT = 250 +DIASTOLIC_LOWER_LIMIT = 40 +DIASTOLIC_UPPER_LIMIT = 200 +HEART_RATE_LOWER_LIMIT = 40 +HEART_RATE_UPPER_LIMIT = 180 + +# pretreatment_patient_connection +DIASTOLIC_TEXT = "diastolic" +SYSTOLIC_TEXT = "systolic" +OUT_OF_RANGE_COLOR = "#c53b33" +IN_RANGE_COLOR = "#fcfcfc" +HEART_RATE_TITLE = "Heart Rate" +BLOOD_PRESSURE_TITLE = "Blood Pressure" +BLOOD_PRESSURE_UNIT = "mmHg" +HEART_RATE_UNIT = "BPM" +PATIENT_CONNECTION_TEXT = "Patient Connection" +UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" +UF_TITLE_TEXT = "Ultrafiltration Setup" +BP_HR_TEXT = "BP/HR" +SKIP_TEXT = "SKIP" +TUTORIAL_TEXT = { + 0 : "Wash your hands and establish vascular access per your clinic's instructions.", + 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", + 2 : "Remove arterial and venous shunt.", + 3 : "Connect arterial and venous cartridge lines to your patient access lines." +} + +PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] \ No newline at end of file Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r1d549bba5b5063b0c481eee6ed8241bd1c4af179 -r941ef3c2c59d7977c23dd37a7af68a3aa84a60a9 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 1d549bba5b5063b0c481eee6ed8241bd1c4af179) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 941ef3c2c59d7977c23dd37a7af68a3aa84a60a9) @@ -16,10 +16,11 @@ import sys import test import squish - +import object from configuration import config from dialin.ui import utils from builtins import int as pyInt +from builtins import str as pyStr from datetime import datetime @@ -31,12 +32,12 @@ @return boolean true/false """ container = squish.findObject(container) - containerPos = container.mapToGlobal(QPoint(0, 0)) + containerPos = container.mapToGlobal(squish.QPoint(0, 0)) container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) container_width, container_height = pyInt(container.width), pyInt(container.height) obj = squish.findObject(obj) - objPos = obj.mapToGlobal(QPoint(0, 0)) + objPos = obj.mapToGlobal(squish.QPoint(0, 0)) obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) @@ -46,7 +47,6 @@ return False - def scroll_to_zone(zone=None, screen_object=None): """ scroll to the numeric if object is hidden @@ -69,12 +69,11 @@ screenHeight = pyInt(ScreenObj.height) screenWidth = pyInt(ScreenObj.width) squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, Qt.NoModifier) + screenHeight-10, 0, -50, squish.Qt.NoModifier) raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") - def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): date = datetime.now() @@ -94,8 +93,19 @@ squish.mouseClick(key_val) utils.waitForGUI(1) test.endSection() - - + +def enter_keypad_value_bphr(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + entry = pyStr(entry) #type casted into string format + for value in entry: + squish.mouseClick(squish.waitForObject(keypad_input(value))) + test.endSection() + def erase_entered_value(input_field): """ Method to erase the entered value @@ -118,5 +128,221 @@ def keypad_input(key_value): names.o_keypad_input["text"] = key_value return names.o_keypad_input - - \ No newline at end of file + +def rejection_msg(text): + names.o_rejection_msg["text"] = text + return names.o_rejection_msg + +def vitals_interval_obj(interval): + names.o_time_interval_obj["text"] = interval + return names.o_time_interval_obj +def msg(string): + """ + Added ### at the right side of the string to make sure that it is a message. + @param string: (str) the string to add trailing ### to + @return pad_str: (str) padded string + """ + padded_str = "###"+string + return padded_str + +def set_arterial_ranges_min_val(art_low): + """ + Method to set the Arterial range maximum value to user expected value + @param art_low - (int) user expected value + """ + test.startSection("Set Arterial range minimum value to {}".format(art_low)) + arterial_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_min = pyInt(arterial_min.minimum) + arterial_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_max = pyInt(arterial_max.maximum) + low_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery)) + low_handler_children = object.children(low_handler_parent) + low_handler = low_handler_children[-2] + width = pyInt(low_handler.width) - 8 + height = pyInt(low_handler.height)- 10 + if arterial_min == art_low: + test.passes("Arterial range minimum is already set to {}".format(art_low)) + elif arterial_min < art_low: + while arterial_min != art_low: + squish.mouseDrag(low_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_min += 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + break + else: + continue + elif arterial_min > art_low: + while arterial_min != art_low: + squish.mouseDrag(low_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_min -= 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + break + else: + continue + # arterial blood pressure low limit should be lower than the high limit by atleast 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(low_handler_parent.minValue, arterial_min, "Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + else: + test.compare(arterial_min, art_low, "Actual Arterial range minimum value: {} is equal to Expected value: {}".format(arterial_min, 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 - (int) user expected value + """ + test.startSection("Set Arterial range maximum value to {}".format(art_high)) + arterial_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_max = pyInt(arterial_max.maximum) + arterial_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_min = pyInt(arterial_min.minimum) + high_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery)) + high_handler_children = object.children(high_handler_parent) + high_handler = high_handler_children[-1] + width = pyInt(high_handler.width) - 20 + height = pyInt(high_handler.height) - 25 + if arterial_max == art_high: + test.passes("Arterial range maximum is already set to {}".format(art_high)) + elif arterial_max < art_high: + while arterial_max != art_high: + squish.mouseDrag(high_handler, -1, height, width, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max += 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + break + else: + continue + elif arterial_max > art_high: + while arterial_max != art_high: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max -= 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + break + else: + continue + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(high_handler_parent.maxValue, arterial_max, + "Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + else: + test.compare(arterial_max, art_high, + "Actual Arterial range maximum value: {} is equal to Expected value: {}".format(arterial_max, art_high)) + 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): + """ + Method to set the Venous range maximum value to user expected value + @param ven_low - (int) user expected value + """ + test.startSection("set Venous range minimum value to {}".format(ven_low)) + ven_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_min = pyInt(ven_min.minimum) + ven_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_max = pyInt(ven_max.maximum) + low_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous)) + low_handler_children = object.children(low_handler_parent) + low_handler = low_handler_children[-2] + width = pyInt(low_handler.width) - 15 + height = pyInt(low_handler.height) - 10 + if ven_min == ven_low: + test.passes("Venous range minimum is already set to {}".format(ven_low)) + elif ven_min < ven_low: + while ven_min != ven_low: + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_min += 10 + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) + break + else: + continue + elif ven_min > ven_low: + while ven_min != ven_low: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_min -= 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) + break + else: + continue + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(low_handler_parent.minValue, ven_min, + "Venous range minimum value cannot be moved beyond {}".format(ven_min)) + else: + test.compare(ven_min, ven_low, + "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) + test.endSection() \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -r9e08d6649ff6c4f29ba71369a7439af1ca028a9b -r941ef3c2c59d7977c23dd37a7af68a3aa84a60a9 --- shared/scripts/names.py (.../names.py) (revision 9e08d6649ff6c4f29ba71369a7439af1ca028a9b) +++ shared/scripts/names.py (.../names.py) (revision 941ef3c2c59d7977c23dd37a7af68a3aa84a60a9) @@ -1,10 +1,10 @@ -# encoding: UTF-8 - - +# # encoding: UTF-8 + + from objectmaphelper import * - - - + + + o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} @@ -16,26 +16,30 @@ o_titleBar_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_titleBar", "type": "Rectangle", "unnamed": 1, "visible": True} o_treatmentStack_TreatmentStack = {"container": o_Gui_MainView, "objectName": "TreatmentStack", "type": "TreatmentStack", "visible": True} o_treatmentStack_TreatmentBloodPrime_ScreenItem = {"container": o_treatmentStack_TreatmentStack, "objectName": "_TreatmentBloodPrime", "type": "ScreenItem", "visible": True} -o_PreTreatmentBase_input_TextInput = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_input_TextInput = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"echoMode": 0, "id": "_input", "type": "TextInput","text": "abcd", "unnamed": 1, "visible": True} o_PreTreatmentBase_CONFIRM_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", "visible": True} -o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} -o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} -o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} -o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container":o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"objectName":"_PreTreatmentBase","type":"TreatmentFlowBase", "visible": True} o_treatmentStack_treatmentHome_TreatmentHome = {"container": o_treatmentStack_TreatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1, "visible": True} -o_confirmButton_TouchRect = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} -o_backButton_BackButton = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": False} +o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container":o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"objectName":"_PreTreatmentBase","type":"TreatmentFlowBase", "visible": True} +o_confirmButton_TouchRect = {"container": o_Gui_MainView, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} +o_backButton_BackButton = {"container": o_Gui_MainView, "objectName": "_backButton", "type": "BackButton", "visible": False} o_NinePatchImage = {"container": o_Gui_MainView, "occurrence": 6, "type": "NinePatchImage", "unnamed": 1, "visible": False} -o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} -o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} - - +o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +t_Text = {"container": o_Gui_MainView, "text": "t", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +#page step indicator dynamic object property +o_text_object = {"type": "Text", "unnamed": 1, "visible": True} +o_bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} + + #standbymode o_MainHome_MainHome = {"container": o_Gui_MainView, "objectName": "_MainHome", "type": "MainHome", "visible": True} o_standby_page = {"container": o_MainHome_MainHome, "type": "Column", "unnamed": 1, "visible": True} - - + + #in-treatment o_blood_priming = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "Blood Priming", "type": "Text", "unnamed": 1, "visible": True} o_blood_priming_value_by_default = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} @@ -48,17 +52,17 @@ o_uf_close_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} - - - + + + #vitals #vitals title text on main-treatment screen o_vitals_title = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "VITALS", "type": "Text", "unnamed": 1, "visible": True} #unit of measurement for blood pressure and heart rate o_bp_uom = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "mmHg", "type": "Text", "unnamed": 1, "visible": True} o_hr_uom = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "BPM", "type": "Text", "unnamed": 1, "visible": True} #reading of vitals -o_vitals_reading = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} +o_vitals_reading = {"container ": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} #vitals pop up confirm and close button o_vitals_confrim_btn = {"container": o_treatmentStack_TreatmentStack, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_vitals_close_btn = {"container": o_treatmentStack_TreatmentStack, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} @@ -77,3 +81,137 @@ o_keypad_input = {"container": o_Gui_MainView, "id": "_keyText", "type": "Text", "unnamed": 1, "visible": True} #virtal keypad back space key o_back_space_key = {"container": o_Gui_MainView, "id": "_backspaceKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iBackspace.svg", "type": "Image", "unnamed": 1, "visible": True} +#vital time interval +o_time_interval_obj = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} + + + + + + +#create_custom treatment testcase +o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentBase_confirmButton_TouchRect_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentBase_backgroundRect_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentConfirm", "type": "TreatmentFlowBase", "visible": True} +o_treatment_confirm_flickable = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "objectName": "_PreTreatmentConfirmFlickable", "type": "Flickable", "visible": True} +o_prescription_mesurement = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "type": "Text", "visible": True} +o_operating_parameters = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "Text", "unnamed": 1, "visible": True} +o_treatment_create_flickable = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "TreatmentCreateFlickable", "type": "Flickable", "visible": True} +o_create_treatment_screen = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "TreatmentCreateFlickable", "type": "Flickable", "visible": True} +o_confirm_title_text = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "text": "Confirm Treatment", "type": "Text", "unnamed": 1, "visible": True} +o_prescription_title_text = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "objectName": "ConfirmTreatmentTable_prescription", "type": "Text", "visible": True} +o_input_patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_confirm_button = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_back_button_confirm_treatment = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} +o_MainHome_MainHome = {"container": o_Gui_MainView, "objectName": "_MainHome", "type": "MainHome", "visible": True} +o_standby_page = {"container": o_MainHome_MainHome, "type": "Column", "unnamed": 1, "visible":True} +o_PreTreatmentCreate_progressRect_ProgressRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_progressRect", "type": "ProgressRect", "unnamed": 1, "visible": True} +#page step indicator verification +o_PreTreatmentCreate_gridSteps_Grid = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_gridSteps", "type": "Grid", "unnamed": 1, "visible": True} +#create custom treatment slider object property's +#prescription object propert's +o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_durationSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_durationSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinDispensingRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolumeSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinStopTimeSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTimeSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_salineBolusSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_salineBolusSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateTemperatureSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateTemperatureSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementIntervalSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_rinsebackFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentBase_gridSteps_Grid_1 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_gridSteps", "type": "Grid", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_nextStepsBullet_StepBullet = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentBase_nextStepsBullet_StepBullet = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_venousPressureLimitsSlider_RangeSlider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_venousPressureLimitsSlider", "type": "RangeSlider", "visible": True} +o_PreTreatmentCreate_handlerLeft_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_handlerLeft", "occurrence": 2, "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_handlerRight_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "occurrence": 2, "id": "_handlerRight", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_handlerLeft_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "occurrence": 1, "id": "_handlerLeft", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_venousColumn_Column = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_venousColumn", "type": "Column", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_mouseArea_MouseArea_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_mouseArea", "occurrence": 33, "type": "MouseArea", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_line_Line = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_line", "type": "Line", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_rangeRect_RangeRect_Venous = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rangeRect", "occurrence": 2, "type": "RangeRect", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_rangeRect_RangeRect_Artery = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rangeRect", "occurrence": 1, "type": "RangeRect", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_Heparin_Type_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Heparin Type", "type": "Text", "unnamed": 1, "visible": True} +#operating parameters object property's +o_PreTreatmentCreate_heparinTypeRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinTypeRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect1_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect1", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect2_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect2", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect3_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect3", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect1", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect2", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect3", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect4", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_heparinDispensingRateValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRateValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_heparinBolusVolumeValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolumeValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_heparinStopTimeValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTimeValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementIntervalValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_duration_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_duration", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolume", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTime", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_salineBolus_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_salineBolus", "type": "SliderCreateTreatment", "visible": True} +#operating parameters object property +o_PreTreatmentCreate_heparinTypeRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinTypeRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bicarbonateConcentrateRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateTemperature", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementInterval", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_rinsebackFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bicarbonateConcentrateRect0", "type": "TouchRect", "visible": True} +#custom treatment title object +o_PreTreatmentCreate_Create_a_Custom_Treatment_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Create a Custom Treatment", "type": "Text", "unnamed": 1, "visible": True} +#confirm and back button object property +o_PreTreatmentCreate_backButton_BackButton = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_backButton", "type": "BackButton", "visible": True} +o_PreTreatmentCreate_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_PreTreatmentBase_Patient_ID_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "Patient ID", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_PRESCRIPTION_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "PRESCRIPTION", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_OPERATING_PARAMETERS_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "OPERATING PARAMETERS", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentStack_PreTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentStack", "type": "PreTreatmentStack", "visible": True} +o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_pretreatmentConnectionStack ", "type": "PreTreatmentConnectionStack", "visible": True} +o_pretreatmentConnectionStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration = {"container": o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentUltrafiltration", "type": "PreTreatmentUltrafiltration", "visible": True} +o_pretreatment_ultrafilteration_confirm_btn = {"container": o_pretreatmentConnectionStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} + +o_PreTreatmentUltrafiltration_volumeSlider_Slider = {"container": o_pretreatmentConnectionStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "objectName": "_volumeSlider", "type": "Slider", "visible": True} + +o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2 = {"container": o_PreTreatmentStack_pretreatmentConnectionStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentBase_Patient_Connection_Text = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Patient Connection", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Continue_Text = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "CONTINUE", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_input_TextInput_2 = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_BP_HR_Text = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "occurrence": 2, "text": "BP/HR", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Blood_Pressure_Text = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Blood Pressure", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_mmHg_Label = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "mmHg", "type": "Label", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Heart_Rate_Text = {"container":o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Heart Rate", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_BPM_Label = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "BPM", "type": "Label", "unnamed": 1, "visible": True} +o_PreTreatmentBase_bloodPressureSystolic_TextEntry = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_bloodPressureSystolic", "type": "TextEntry", "unnamed": 1, "visible": True} +o_PreTreatmentBase_input_TextInput_3 = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_bloodPressureDiastolic_TextEntry = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_bloodPressureDiastolic", "type": "TextEntry", "unnamed": 1, "visible": True} +o_PreTreatmentBase_input_TextInput_4 = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "echoMode": 0, "id": "_input", "occurrence": 3, "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_heartRate_TextEntry = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_heartRate", "type": "TextEntry", "unnamed": 1, "visible": True} + +#virtal keypad back space key +o_back_space_key = {"container": o_Gui_MainView, "id": "_backspaceKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iBackspace.svg", "type": "Image", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Indicators = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "type": "StepBullet", "unnamed": 1, "visible": True} +#systolic, diastolic and heart rate input field +o_pop_up_systolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_pop_up_diastolic_input_field = {"container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 2, "type": "TextInput", "unnamed": 1, "visible": True} +o_pop_up_heart_rate_input_field = {"backgroundcolor": "#254670", "container": o_treatmentStack_TreatmentStack, "echoMode": 0, "id": "_input", "occurrence": 3, "type": "TextInput", "unnamed": 1, "visible": True} +o_PreTreatmentBase_gridSteps_Grid = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_PreTreatmentBase_indicator_StepIndicator = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_indicator", "type": "StepIndicator", "unnamed": 1, "visible": True} +o_PreTreatmentBase_headStepBullet_StepBullet = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_headStepBullet", "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentBase_gridStepsRest_Grid_2 = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_gridStepsRest", "occurrence": 10, "type": "Grid", "unnamed": 1, "visible": True} +o_text_object = {"type": "Text", "unnamed": 1, "visible": True} +o_bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentbase_skip_text = {"container": o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "SKIP", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_CONFIRM_Text_2 = {"container":o_PreTreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} + +#o_time_interval_obj = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} +#o_time_interval_obj = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} +# o_treatmentStack_TreatmentStack = {"container": o_Gui_MainView, "objectName": "TreatmentStack", "type": "TreatmentStack", "visible": True} +# o_treatmentStack_treatmentHome_TreatmentHome = {"container": o_treatmentStack_TreatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_interval_obj = {"container":o_treatmentStack_treatmentHome_TreatmentHome, "id": "_text", "type": "Text", "unnamed": 1, "visible": True} Index: tst_main_treatment_vitals/test.py =================================================================== diff -u -ra28d0e428b2a605c271dea369fb92c98d2051cd1 -r941ef3c2c59d7977c23dd37a7af68a3aa84a60a9 --- tst_main_treatment_vitals/test.py (.../test.py) (revision a28d0e428b2a605c271dea369fb92c98d2051cd1) +++ tst_main_treatment_vitals/test.py (.../test.py) (revision 941ef3c2c59d7977c23dd37a7af68a3aa84a60a9) @@ -18,6 +18,9 @@ from configuration.utility import * from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.utils import waitForGUI +from configuration import utility +from dialin.common.hd_defs import PreTreatmentSubModes, HDOpModes, HDOpSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestsStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates hd_simulator = HDSimulator() @@ -40,7 +43,75 @@ INVALID_VALS = {"systolic" : [260, 59, 300, 23], "diastolic": [39, 1, 210, 201], "Heart Rate": [181, 200, 39, 20]} +time_interval = "25min" +BP_HR_PRE_TREATMENT_STEPS = 6 +ven_low = 40 +ven_high = 400 +art_high = -20 +art_low = -240 +def keyboard_object_map_helper(text): + """ + Method for setting custom object property's for keyboard keys + + @return: required object property's for keys + """ + if text is not None: + names.o_keboard_input["text"] = text + return names.o_keboard_input + else: + test.log("Invalid ",text," for object.") + names.o_keyboard_input["text"] = "Q" + + +def keyboard_switching_section(text): + """ + Tests to automate keyboard based on user input + + @return: key text (text displayed on keyboard) + """ + keyboard_value = keyboard_object_map_helper(text) + object_status = object.exists(keyboard_value) + if object_status is True: + return text + else: + #Tests to get status of keys in keyboard layout + object_status = object.exists(keyboard_object_map_helper(config.KEYBOARD_SWITCH[1])) + if object_status is True: + keyboard_value = keyboard_object_map_helper(config.KEYBOARD_SWITCH[1]) + utils.waitForGUI(.3) + mouseClick(waitForObject(keyboard_value)) + keyboard_value = keyboard_object_map_helper(text) + object_status = object.exists(keyboard_value) + if object_status is True: + return text + object_status = object.exists(keyboard_object_map_helper(config.KEYBOARD_SWITCH[0])) + if object_status is True: + keyboard_value = keyboard_object_map_helper(config.KEYBOARD_SWITCH[0]) + mouseClick(waitForObject(keyboard_value)) + keyboard_value = keyboard_object_map_helper(text) + object_status = object.exists(keyboard_value) + if object_status is True: + return text + object_status = object.exists(names.o_keyboard_switch2) + if object_status is True: + keyboard_value = waitForObject(names.o_keyboard_switch2) + mouseClick(keyboard_value) + text = text.lower() + keyboard_value = keyboard_object_map_helper(text) + object_status = object.exists(keyboard_value) + if object_status is True: + return text + object_status = object.exists(names.o_keyboard_switch) + if object_status is True: + keyboard_value = waitForObject(names.o_keyboard_switch) + mouseClick(keyboard_value) + text = text.lower() + keyboard_value = keyboard_object_map_helper(text) + object_status = object.exists(keyboard_value) + if object_status is True: + return text + def open_vitals_pop_up(): """ Method to open the vitals pop up @@ -96,28 +167,368 @@ elif (entry >= HEART_RATE_LOWER_LIMIT) and (entry <= HEART_RATE_UPPER_LIMIT): test.compare(input_field_color,IN_RANGE_COLOR, "Heart Rate value {} is in range of {} and {}".format(entry, HEART_RATE_LOWER_LIMIT, HEART_RATE_UPPER_LIMIT)) test.endSection() + +def verify_request_continue_mode(): + """ + Method to accept treatment response. + """ + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]) + test.compare(treatment_status, True, "custom treatment should be accepted") +def verify_create_custom_treatment_parameter(): + """ + Method to set create custom treatment slider value based on slider buffer + """ + test.startSection("Method to set create custom treatment slider based on positive slider buffer") + test.compare(waitForObject(names.o_PreTreatmentCreate_Create_a_Custom_Treatment_Text).text, config.TREATMENT_TITLE, "Title text should be -> "+str(config.TREATMENT_TITLE)) + + test.compare(waitForObject(names.o_PreTreatmentCreate_PRESCRIPTION_Text).text, config.PRESCRIPTION_TITLE, "Title text should be -> "+str(config.PRESCRIPTION_TITLE)) + #set custom values for parameters + test.startSection("verification of blood flow values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment).label, config.BLOOD_FLOW_RATE, "Parameter should be -> "+str(config.BLOOD_FLOW_RATE)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, 100, 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)) + + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, 250, 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)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, 60, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) + 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)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, 0.0, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) + + test.endSection() + + test.startSection("verification of heparin bolus volume values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment).label, config.HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(config.HEPARIN_BOLUS_VOLUME)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, 0.0, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) + + test.endSection() + + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of heparin stop time values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment).label, config.HEPARIN_STOP_TIME, "Parameter should be -> "+str(config.HEPARIN_STOP_TIME)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, 10, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) + + 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)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, 100, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS_TITLE) + test.endSection() + + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.ACID_CONCENTRATE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of heparin type") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect_GridSelection).labels, config.HEPARIN_TYPE, "Parameter should be -> "+str(config.HEPARIN_TYPE)) + mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).text.text, config.HEPARIN_TYPE, "heparin text should be :"+ str(config.HEPARIN_TYPE)) + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.endSection() + + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of acid concentrate type") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect_GridSelection).title, config.ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.ACID_CONCENTRATE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).text.text, config.ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) + test.endSection() + + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of bicarbonate concentrate rectangle") + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection).title, config.BICARBONATE_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.BICARBONATE_CONCENTRATE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).text.text, config.BICARBONATE_CONCENTRATE, "Bicarbonate concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) + test.endSection() + + #scroll the screen to the title dialyste temperature value + parameter_object = set_parameter_type(text = config.DIALYSATE_TEMPERATURE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of dialysate rectangle") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect_GridSelection).title, config.DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(config.DIALYZER_TYPE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).text.text, config.DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[0])) + + + test.endSection() + + #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) + + 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)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, 35, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) + test.endSection() + + #scroll the screen to the title rinseback flow rate + parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + set_arterial_low_and_high() + set_venous_low_and_high() + + test.startSection("verification of blood pressure measurement interval values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, 25, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + + test.endSection() + + test.startSection("verification of rinseback flow rate values") + test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) + test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, 50, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) + test.endSection() + + test.endSection() + +def set_venous_low_and_high(): + """ + Method to set the venous low and high limits using slider + """ + test.startSection("Set the venous low and high limits using slider") + utility.set_venous_ranges_min_val(ven_low) + utility.set_venous_ranges_max_val(ven_high) + + test.endSection() + +def set_arterial_low_and_high(): + """ + Method to set the arterial low and high limits using slider + """ + test.startSection("Set the arterial low and high limits using slider") + utility.set_arterial_ranges_max_val(art_high) + utility.set_arterial_ranges_min_val(art_low) + + test.endSection() + +def verify_vital_entries_in_main_treatment_screen(sys_val, dia_val, heart_rate): + """ + method to enter systolic, diastolic and heart rate value and save or unsave it and verify + same is updated in pre-treatment screen. + @param sys_val - (int) user expected systolic pressure + @param dia_val - (int) user expected diastolic pressure + @param heart_rate - (int) user expected heart rate + @param save - (bool) True/False + """ + test.startSection("Verify the entered systolic, diastolic and heart rate value updated in main-treatement screen") + mouseClick(waitForObject(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry)) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_2) + utility.enter_keypad_value_bphr(sys_val) + + test.verify(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).enabled, "systolic combo box should be enabled.") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureSystolic_TextEntry).text, str(sys_val), "systolic value should be : "+str(sys_val)) + verify_color_of_entry(entry = sys_val, vital_parameter = config.SYSTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_2)) + + + mouseClick(waitForObject(names.o_PreTreatmentBase_input_TextInput_3)) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_3) + utility.enter_keypad_value_bphr(dia_val) + + test.verify(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureDiastolic_TextEntry).enabled, "diastolic value should be enabled.") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_bloodPressureDiastolic_TextEntry).text, str(dia_val), "diastolic value should be : "+str(dia_val)) + verify_color_of_entry(entry = dia_val, vital_parameter = config.DIASTOLIC_TEXT, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_3)) + + + mouseClick(waitForObject(names.o_PreTreatmentBase_input_TextInput_4)) + utility.erase_entered_value(names.o_PreTreatmentBase_input_TextInput_4) + utility.enter_keypad_value_bphr(heart_rate) + + test.verify(waitForObjectExists(names.o_PreTreatmentBase_heartRate_TextEntry).enabled, "diastolic value should be enabled.") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_heartRate_TextEntry).text, str(heart_rate), "diastolic value should be : "+str(dia_val)) + verify_color_of_entry(entry = heart_rate, vital_parameter = config.HEART_RATE_TITLE, input_field = waitForObject(names.o_PreTreatmentBase_input_TextInput_4)) + + test.endSection() + +def verify_entered_vitals_in_patient_connection_screen(): + """ + Method to verify BP/HR section from patient connection. + @param : N/A + @return: N/A + """ + test.startSection("verification of BP/HR section from patient connection") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_BP_HR_Text).text, config.BP_HR_TEXT, "BP/HR title text should be :" + str(config.BP_HR_TEXT)) + test.compare(waitForObjectExists(names.o_PreTreatmentbase_skip_text).text, config.SKIP_TEXT, "BP/HR button text should be " + str(config.SKIP_TEXT)) + test.verify(waitForObjectExists(names.o_PreTreatmentbase_skip_text).enabled, "BP/HR button should enabled.") + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Blood_Pressure_Text).text, config.BLOOD_PRESSURE_TITLE, "BP title text should be :" + str(config.BLOOD_PRESSURE_TITLE)) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_mmHg_Label).text, config.BLOOD_PRESSURE_UNIT, "BP unit should be " + str(config.BLOOD_PRESSURE_UNIT)) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Heart_Rate_Text).text, config.HEART_RATE_TITLE, "HR text should be :" + str(config.HEART_RATE_TITLE)) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_BPM_Label).text, config.HEART_RATE_UNIT, "BP unit should be " + str(config.HEART_RATE_UNIT)) + + verify_vital_entries_in_main_treatment_screen(sys_val=config.SYSTOLIC_PRESSSURE_175, dia_val=config.DIASTOLIC_PRESSSURE_74, heart_rate=config.HEART_RATE_VAL_85) + test.verify(waitForObjectExists(names.o_PreTreatmentBase_CONFIRM_Text_2).enabled, "Confirm button is enabled.") + mouseClick(waitForObject(names.o_PreTreatmentBase_CONFIRM_Text_2)) + + reset_bp_hr_in_main_treatment() + test.endSection() + +def set_venous_high_and_low_limits_using_slider(): + """ + Method to set the venous low and high limits using slider + """ + test.startSection("Set the venous low and high limits using slider") + utils.waitForGUI(1) + for venous_value in range(config.VENOUS_VALUE_50, config.VENOUS_VALUE_600, config.POSITIVE_BUFFER): + utility.set_venous_ranges_max_val(venous_value) + for venous_value in range(config.VENOUS_VALUE_20, config.VENOUS_VALUE_570, config.POSITIVE_BUFFER): + utility.set_venous_ranges_min_val(venous_value) + + test.endSection() + +def set_arterial_high_and_low_limits_using_slider(): + """ + Method to set the arterial low and high limits using slider + """ + test.startSection("Set the arterial low and high limits using slider") + utils.waitForGUI(1) + utility.set_arterial_ranges_min_val(config.ARTERIAL_VALUE_NEGATIVE_300) + for arterial_value in range(config.ARTERIAL_VALUE_0, config.ARTERIAL_VALUE_NEGATIVE_270, config.NEGATIVE_BUFFER): + utility.set_arterial_ranges_max_val(arterial_value) + + test.endSection() def verify_last_read_time(saved_time): """ method to verify the last read of blood pressure and heart rate @param saved_time: (str) time of saving blood pressure and heart rate """ + test.startSection("Verify the last read of blood pressure and heart rate") expected_last_read = "Interval: off , Last Read: {}".format(saved_time) last_read = waitForObject(vitals_reading_obj(expected_last_read)) last_read = str(last_read.text) test.compare(last_read, expected_last_read, "Last read time should be {}".format(last_read)) test.endSection() - - + +def drag_and_drop_ultrafiltration_slider(slider_value = 0, maximum_ultrafiltration = 0): + """ + Tests to verify ultrafiltration slider range + @param slider_value: (int) value of the slider to set. + """ + slider_buffer = (config.UF_MAXIMUM_SLIDER_WIDTH/(maximum_ultrafiltration/100)) * slider_value + slider_width = slider_buffer + config.UF_MINIMUM_SLIDER_WIDTH + mouseClick(waitForObject(names.o_PreTreatmentUltrafiltration_volumeSlider_Slider), slider_width , 3, Qt.LeftButton) + + utils.waitForGUI(0.1) + + +def verify_interval_for_bpm(): + """ + Method to set all parameters in create custom treatment + and navigate to patient connection screen and set bp/hr + navigate to main treatment screen to reset vitals + """ + test.startSection("Setting all parameters in create custom treatment, navigating to patient connection and set bp/hr, navigate to main treatment and reset vitals") + hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TPAR.value , sub_mode = HDOpSubModes.SUBMODE_START.value) + mouseClick(waitForObject(names.o_input_patient_id)) + test.log("Entering patient_id") + type(waitForObject(names.o_input_patient_id), "Alberto") + mouseClick(waitForObject(names.o_confirm_button)) + verify_create_custom_treatment_parameter() + verify_request_continue_mode() + + utils.waitForGUI(0.5) + hd_simulator.cmd_initiate_treatment_response(response = 1, reason =0) + hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_PRET.value , sub_mode = HDOpSubModes.SUBMODE_START.value) + test.log("Navigating to Patient connection screen") + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_PATIENT_CONNECTION_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, + no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, + prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) + hd_simulator.cmd_send_uf_treatment_response(accepted =True, reason =0, volume = 300) + verify_entered_vitals_in_patient_connection_screen() + + utils.waitForGUI(0.5) + hd_simulator.cmd_send_hd_operation_mode(op_mode = 6 , sub_mode = 2) + utils.waitForGUI(1) + test.log("Navigating to main treatment screen") + hd_simulator.cmd_set_treatment_states_data(sub_mode = 1, 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, dialysis_state=0) + hd_simulator.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, dialysis_state=0) + + test.endSection() + +def reset_bp_hr_in_main_treatment(): + """ + Method to verify the blood pressure and heart from navigating + from main treatment to patient connection verifying the same + by navigating from patient connection to main treatment to reset + """ + test.startSection("Method to reset and verify the blood pressure and heart rate") + hd_simulator.cmd_send_hd_operation_mode(op_mode = 6 , sub_mode = 2) + utils.waitForGUI(1) + hd_simulator.cmd_set_treatment_states_data(sub_mode = 1, 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, dialysis_state=0) + hd_simulator.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, dialysis_state=0) + + test.endSection() + +def set_parameter_type(text): + """ + Method to set object property based on text + @param text : (string) treatment parameter text + """ + if isinstance(text, str): + names.o_operating_parameters["text"] = text + return names.o_operating_parameters + else: + test.log("Invalid \"text\": " +text+" for object.") + names.o_operating_parameters["text"] = None + +def test_custom_treatment_slider(slider_object, value, slider_parameter, parameter): + """ + Method to set slider handle based on custom values + @param slider_object : (dictionary) object of treatment parameters + @param vale : (int)value to be set on slider + @param slider_parameter : (list) consist combination of slider minimum value, slider buffer and width buffer + @param parameter : (str) parameter name + """ + minimum_slider_value = slider_parameter[0] + slider_buffer = slider_parameter[1] + width_buffer = slider_parameter[2] + slider_width = ((value - minimum_slider_value)/slider_buffer) * width_buffer + utils.waitForGUI(0.3) + mouseClick(findObject(slider_object), float(slider_width) , 3, Qt.LeftButton) + test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+" slider value should set to"+str(value)) + def verify_entered_value_in_main_treatment_screen(value, vital, save): """ method to verify the user entered value in main-treatment screen @param value: (int) user user entered value @param vital - (str) parameter name under which user is entering value (sys/dia/heart rate) @param input_field - (obj) object of input field """ + test.startSection("Verify the user entered {} value {} in main-treatment screen".format(vital, value)) if save: input_field = waitForObject(vitals_reading_obj(value)) @@ -269,49 +680,45 @@ vital=HEART_RATE_TITLE) verify_color_of_entry(entry=heart_rate, vital_parameter=HEART_RATE_TITLE, input_field=hr) - + if save: test.log("Clicking confirm button") confirm_button = waitForObjectExists(names.o_vitals_confrim_btn) test.compare(confirm_button.enabled, True, "Valid Blood Pressure and Heart is entered therefore confirm button is enabled") - saved_time = get_current_date_and_time() + saved_time = get_current_date_and_time(date_format='%Y/%b/%d - %H:%M') mouseClick(confirm_button) verify_last_read_time(saved_time) + elif save is False: mouseClick(waitForObject(names.o_vitals_close_btn)) test.log("'Vitals pop is closed") - + expected_blood_pressure = "{sys} / {dia}".format(sys=sys_val, dia=dia_val) verify_entered_value_in_main_treatment_screen(value=expected_blood_pressure, vital=BLOOD_PRESSURE_TITLE, save=save) verify_entered_value_in_main_treatment_screen(value=heart_rate, vital=HEART_RATE_TITLE, save=save) test.endSection() - - + def main(): utils.tstStart(__file__) startApplication(AUT_NAME) - hd_simulator.cmd_send_power_on_self_test_version_request() + hd_simulator.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, dialysis_state=0) - - hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration=0, max_treatment_duration=480, - min_uf_volume=0.0, max_uf_volume=8000.0, - min_dialysate_flow_rate=100, max_dialysate_flow_rate=600) - + rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, + treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) + utils.waitForGUI(1) open_vitals_pop_up() verify_entered_valid_vital_entries_in_main_treatment_screen(sys_val=SYSTOLIC_PRESSSURE_120, dia_val=DIASTOLIC_PRESSSURE_80, heart_rate=HEART_RATE_VAL_101, save=True) - + utils.waitForGUI(1) - + open_vitals_pop_up() verify_entered_value_in_pop_up(value=SYSTOLIC_PRESSSURE_120, input_field=names.o_pop_up_systolic_input_field, @@ -327,6 +734,7 @@ heart_rate=HEART_RATE_VAL_85, save=False) utils.waitForGUI(1) + open_vitals_pop_up() verify_entered_value_in_pop_up(value=SYSTOLIC_PRESSSURE_175, input_field=names.o_pop_up_systolic_input_field, @@ -342,6 +750,7 @@ heart_rate=HEART_RATE_VAL_70, save=True) utils.waitForGUI(1) + open_vitals_pop_up() verify_entered_value_in_pop_up(value=SYSTOLIC_PRESSSURE_113, input_field=names.o_pop_up_systolic_input_field, @@ -357,13 +766,16 @@ heart_rate=HEART_RATE_VAL_60, save=False) utils.waitForGUI(1) + open_vitals_pop_up() verify_ranges_of_vital(vital_parameter=SYSTOLIC_TEXT) verify_ranges_of_vital(vital_parameter=DIASTOLIC_TEXT) verify_ranges_of_vital(vital_parameter=HEART_RATE_TITLE) - + verify_the_color_of_out_of_range(vital_parameter=SYSTOLIC_TEXT) verify_the_color_of_out_of_range(vital_parameter=DIASTOLIC_TEXT) verify_the_color_of_out_of_range(vital_parameter=HEART_RATE_TITLE) - utils.tstDone() + verify_interval_for_bpm() + + utils.tstDone() \ No newline at end of file