Index: config.xml =================================================================== diff -u -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 -r9b2b6f2f03d8988f9999d65945a60773cbaa22e9 --- config.xml (.../config.xml) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) +++ config.xml (.../config.xml) (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -3,7 +3,5 @@ - -200 - + Index: shared/scripts/configuration/config.py =================================================================== diff -u -r8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6 -r9b2b6f2f03d8988f9999d65945a60773cbaa22e9 --- shared/scripts/configuration/config.py (.../config.py) (revision 8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6) +++ shared/scripts/configuration/config.py (.../config.py) (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -15,7 +15,7 @@ import os -Application_name = "denaliSquish" +APPLICATION_NAME = "denaliSquish" COMMON_PATH = f"{os.environ['HOME']}/Projects" Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6 -r9b2b6f2f03d8988f9999d65945a60773cbaa22e9 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -38,7 +38,7 @@ try: counter += 1 test.log("Starting {}".format(app_name)) - squish.startApplication(config.Application_name) + squish.startApplication(config.APPLICATION_NAME) if counter == 1: test.log(f"Application launched at the {counter}'st try.") elif counter == 2: @@ -47,7 +47,6 @@ test.log(f"Application launched at the {counter}'rd try.") else: test.log(f"Application launched at the {counter}'th try.") - squish.snooze(20) break except RuntimeError: if counter == 1: Index: suite.conf =================================================================== diff -u -rc178841263d7366f577776e63b59bd562e5d4d72 -r9b2b6f2f03d8988f9999d65945a60773cbaa22e9 --- suite.conf (.../suite.conf) (revision c178841263d7366f577776e63b59bd562e5d4d72) +++ suite.conf (.../suite.conf) (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -1,4 +1,8 @@ AUT=denaliSquish +CWD= +ENVVARS=envvars +HOOK_SUB_PROCESSES=false +IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script TEST_CASES=tst_post tst_patientID_UI tst_standbymode tst_pre_treatment tst_case2 tst_case1 Fisheye: Tag 9b2b6f2f03d8988f9999d65945a60773cbaa22e9 refers to a dead (removed) revision in file `tst_authentication/test.py'. Fisheye: No comparison available. Pass `N' to diff? Index: tst_case1/test.py =================================================================== diff -u --- tst_case1/test.py (revision 0) +++ tst_case1/test.py (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- + +import names +import squish + + +def TriggerDragAndDrop(Obj=None, topLeftXOffset=150, topLeftYOffset=None): + """ + Function to enter into drag and drop mode in squish. + Arguments: + Obj - target object + topLeftXOffset - int value for X offset of widget + topLeftXOffset - int value for Y offset of widget + Return: + None + """ + objRect = object.globalBounds(Obj) + + x = objRect.x + if topLeftXOffset is None: + x = objRect.center().x + else: + x += topLeftXOffset + + y = objRect.y + if topLeftYOffset is None: + y = objRect.center().y + else: + y += topLeftYOffset + + delta = 10 + snoozeTime = 0.01 + + for i in range(delta): + squish.QCursor.setPos(x+i, y) # alternative function -> mouseMove() + squish.snooze(snoozeTime) + for i in range(delta): + squish.QCursor.setPos(x, y+i) + squish.snooze(snoozeTime) + for i in range(delta): + squish.QCursor.setPos(x-i, y) + squish.snooze(snoozeTime) + for i in range(delta): + squish.QCursor.setPos(x, y-i) + squish.snooze(snoozeTime) + + +def StartDrag(Obj=None, topLeftXOffset=None, topLeftYOffset=None): + """ + Function to start a drag on a widget. + Arguments: + Obj - target object + topLeftXOffset - int value for X offset of widget + topLeftXOffset - int value for Y offset of widget + Return: + None + """ + objRect = object.globalBounds(Obj) + if topLeftXOffset is None or topLeftYOffset is None: + squish.mousePress(Obj, squish.Qt.LeftButton) + else: + if topLeftXOffset is None: + topLeftXOffset = objRect.center().x + if topLeftYOffset is None: + topLeftYOffset = objRect.center().y + squish.mousePress(Obj, topLeftXOffset, topLeftYOffset, squish.Qt.LeftButton) + TriggerDragAndDrop(Obj, topLeftXOffset, topLeftYOffset) + + + + +def DropOnWidget(Obj=None, topLeftXOffset=None, topLeftYOffset=None): + """ + Function to Drop on the target widget. + Arguments: + Obj - target object + topLeftXOffset - int value for X offset of widget + topLeftXOffset - int value for Y offset of widget + Return: + None + """ + TriggerDragAndDrop(Obj, topLeftXOffset, topLeftYOffset) + squish.mouseRelease(squish.Qt.LeftButton) + + + + +def dragAndDropObject(source=None, target=None): + """ + Drag and drop the source object to target. + Arguments: + source - Button Object + target - Target tab object + Return: + None + """ + StartDrag(Obj=source) + DropOnWidget(Obj=target) + + + +def set_random_slider_weight(value, slider_object): + """ + Method to drag_slider_position of weight widget + Argument: N/A + Return: + return slider current position + """ + #weight_combo_box = waitForObject(loc.weightInput) + #utility.TapElement(weight_combo_box) + #slider_object = waitForObject(self.SliderCurser) + squish.mouseDrag(slider_object, 0, 0, value, 0, squish.Qt.NoModifier, + squish.Qt.LeftButton) + #slider_position = squish.waitForObject(self.__SliderPosition) + #cursor_value = object.children(slider_position)[0] + #test.log(f"User dragged weight slider into {cursor_value.text}") + #return (cursor_value.text) + + +def main(): + startApplication("denaliSquish") + mouseClick(waitForObject(names.patient_id), 264, 15, Qt.LeftButton) + type(waitForObject(names.patient_id), "id") + mouseClick(waitForObject(names.confirm_button)) + + #slider_object = {"container": names. , + # "objectName": slider_object_name, + # "type": "Slider" } + #demo = {"container" : names.o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, 'gradient':0, 'id':_handler, type:'Rectangle', 'unnamed':1, visible: 'true'}(QQuickRectangle_QML_78) + #demo = {"container": names.o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "id": "_handler", "type": "Rectangle", "unnamed": 1, "visible": True}#(QQuickRectangle_QML_78) + """ + "bloodFlowRate": [200, 300, 400, 150, 250], + "dialysateFlowRate": [150, 250, 300, 450, 500], + "duration": [120, 150, 240, 300, 450], + "heparinDispensingRate": [0.2, 0.3, 0.6, 0.8, 0.5], + "heparinBolusVolume": [0.2, 0.5, 0.8, 1.0, 1.6], + "heparinStopTime": [20, 60, 270, 320, 420, 440], + "salineBolus": [200], + "dialysateTemperature": [35.5, 36.0, 36.5, 37.0, 37.5], + "bloodPressureMeasurementInterval": [5, 15, 20, 30, 45, 55], + "rinsebackFlowRate": [75, 100, 125], + """ + slider_object = waitForObject(names.demo) + child = object.children(slider_object)[0] + child = object.children(child)[0] + child = object.children(child)[1] + child = object.children(child)[2] + child1 = object.children(child)[5] + move = object.children(child)[2] + set_random_slider_weight(value = 400, slider_object = child) + #dragAndDropObject(child1,move) + snooze(5) + \ No newline at end of file Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6 -r9b2b6f2f03d8988f9999d65945a60773cbaa22e9 --- tst_create_custom_treatment/test.py (.../test.py) (revision 8fe36cf3dde9429e91c1497af8bf7eac2a9a10e6) +++ tst_create_custom_treatment/test.py (.../test.py) (revision 9b2b6f2f03d8988f9999d65945a60773cbaa22e9) @@ -27,13 +27,28 @@ from dialin.ui.hd_simulator import HDSimulator -PATIENT_ID = "id" +PATIENT_ID = "demopatientid" 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"] +CREATE_TREATMENT_SLIDER_VALUES = { + "bloodFlowRate": [200, 300, 400, 150, 250], + "dialysateFlowRate": [150, 250, 300, 450, 500], + "duration": [120, 150, 240, 300, 450], + "heparinDispensingRate": [0.2, 0.3, 0.6, 0.8, 0.5], + "heparinBolusVolume": [0.2, 0.5, 0.8, 1.0, 1.6], + "heparinStopTime": [20, 60, 270, 320, 420, 440], + "salineBolus": [200], + "dialysateTemperature": [35.5, 36.0, 36.5, 37.0, 37.5], + "bloodPressureMeasurementInterval": [5, 15, 20, 30, 45, 55], + "rinsebackFlowRate": [75, 100, 125], + +} + + def treatment_create_flickable(x_axis =0, y_axis = 0): mouseWheel(waitForObject(names.treatment_create_flickable), @@ -75,7 +90,21 @@ test.log(f"Invalid \"text\": {text} for object.") names.keyboard_input["text"] = "BB Diacap Pro 13H" + + slider_object = waitForObject(names.demo) + child = object.children(slider_object)[0] + child = object.children(child)[0] + child = object.children(child)[1] + child = object.children(child)[2] + child1 = object.children(child)[5] + move = object.children(child)[2] + set_random_slider_weight(value = 400, slider_object = child) + + + + + def set_operating_parameters(heparin_type, acid_concentrate, bicarbonate_concentrate, dialyzer_type): """ Tests that all possible non-slider options are shown. @@ -117,27 +146,33 @@ @return: None """ - sliders = { - "_bloodFlowRate": {"min": 100 , "max": 500, "units": "mL/min", "title": "Blood Flow Rate"}, - "_dialysateFlowRate": {"min":100 , "max": 600, "units": "__ mL/min", "title": "Dialysate Flow Rate"}, - "_duration": {"min": 60, "max": 480, "units": "__ min", "title": "Duration"}, - "_heparinDispensingRate": {"min": 0, "max": 1, "units": "__ mL/hr", "title": "Heparin Dispensing Rate" }, - "_heparinBolusVolume": {"min": 0, "max": 2, "units": "__ mL", "title": "Heparin Bolus Volume" }, - "_heparinStopTime": {"min": 0, "max": 470, "units": "__ min", "title": "Heparin Stop Time" }, - "_salineBolus": {"min": 100, "max": 300, "units": "__ mL", "title": "Saline Bolus"}, - "_dialysateTemperature": {"min": 35, "max": 38, "units": "__ °C", "title": "Dialysate Temperature"}, - "_bloodPressureMeasurementInterval": {"min": 0, "max": 60, "units": "__ min", "title": "Blood Pressure Measurements Interval"}, - "_rinsebackFlowRate": {"min": 50, "max": 150, "units": "__ mL/min", "title": "Rinseback Flow Rate"}, - } + -def create_custom_treatment_record(): +def create_custom_treatment_record( bloodFlowRate, dialysateFlowRate, duration, + heparinDispensingRate, heparinBolusVolume, + heparinStopTime, salineBolus, dialysateTemperature, + bloodPressureMeasurement, rinsebackFlowRate + ): + slider_object = waitForObject(names.pretreatment_create) + child = object.children(slider_object)[0] + child = object.children(child)[0] + child = object.children(child)[1] + child = object.children(child)[2] + child1 = object.children(child)[5] + move = object.children(child)[2] + set_random_slider_weight(value = 400, slider_object = child) + + custom_treatment = waitForObject(names.custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) test.log(f"user successfully authenticated.") + + + mouseClick(waitForImage("blood",{ "tolerant": True, "threshold": 99.999 })) mouseClick(waitForImage("dialysate",{ "tolerant": True, "threshold": 99.999 })) mouseClick(waitForImage("duration",{ "tolerant": True, "threshold": 99.999 })) @@ -171,13 +206,65 @@ hd = HDSimulator() - unittests.test_python_version() + hd._handler_ui_first_check_in(message = None) - mouseClick(waitForObject(names.input_patient_id)) + tapObject(waitForObject(names.input_patient_id)) type(waitForObject(names.input_patient_id), PATIENT_ID) - mouseClick(waitForObject(names.confirm_button)) + tapObject(waitForObject(names.confirm_button)) + hd.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 + ]) + """ + create_custom_treatment_record( + bloodFlowRate = CREATE_TREATMENT_SLIDER_VALUES["bloodFlowRate"][0], + dialysateFlowRate = CREATE_TREATMENT_SLIDER_VALUES["dialysateFlowRate"][0], + duration = CREATE_TREATMENT_SLIDER_VALUES["duration"][0], + heparinDispensingRate = CREATE_TREATMENT_SLIDER_VALUES["heparinDispensingRate"][0], + heparinBolusVolume = CREATE_TREATMENT_SLIDER_VALUES["heparinBolusVolume"][0], + heparinStopTime = CREATE_TREATMENT_SLIDER_VALUES["heparinStopTime"][0], + salineBolus = CREATE_TREATMENT_SLIDER_VALUES["salineBolus"][0], + dialysateTemperature = CREATE_TREATMENT_SLIDER_VALUES["dialysateTemperature"][0], + bloodPressureMeasurementInterval = CREATE_TREATMENT_SLIDER_VALUES["bloodPressureMeasurementInterval"][0], + rinsebackFlowRate = CREATE_TREATMENT_SLIDER_VALUES["rinsebackFlowRate"][0], + ) + verify_custom_treatment_record() + """ + """ + create_custom_treatment_record( + bloodFlowRate = CREATE_TREATMENT_SLIDER_VALUES["bloodFlowRate"][1], + dialysateFlowRate = CREATE_TREATMENT_SLIDER_VALUES["dialysateFlowRate"][1], + duration = CREATE_TREATMENT_SLIDER_VALUES["duration"][1], + heparinDispensingRate = CREATE_TREATMENT_SLIDER_VALUES["heparinDispensingRate"][1], + heparinBolusVolume = CREATE_TREATMENT_SLIDER_VALUES["heparinBolusVolume"][1], + heparinStopTime = CREATE_TREATMENT_SLIDER_VALUES["heparinStopTime"][1], + salineBolus = CREATE_TREATMENT_SLIDER_VALUES["salineBolus"][1], + dialysateTemperature = CREATE_TREATMENT_SLIDER_VALUES["dialysateTemperature"][1], + bloodPressureMeasurementInterval = CREATE_TREATMENT_SLIDER_VALUES["bloodPressureMeasurementInterval"][1], + rinsebackFlowRate = CREATE_TREATMENT_SLIDER_VALUES["rinsebackFlowRate"][1], + ) + + verify_request_rejection_mode(hd) - create_custom_treatment_record() + create_custom_treatment_record( + bloodFlowRate = CREATE_TREATMENT_SLIDER_VALUES["bloodFlowRate"][2], + dialysateFlowRate = CREATE_TREATMENT_SLIDER_VALUES["dialysateFlowRate"][2], + duration = CREATE_TREATMENT_SLIDER_VALUES["duration"][2], + heparinDispensingRate = CREATE_TREATMENT_SLIDER_VALUES["heparinDispensingRate"][2], + heparinBolusVolume = CREATE_TREATMENT_SLIDER_VALUES["heparinBolusVolume"][2], + heparinStopTime = CREATE_TREATMENT_SLIDER_VALUES["heparinStopTime"][2], + salineBolus = CREATE_TREATMENT_SLIDER_VALUES["salineBolus"][2], + dialysateTemperature = CREATE_TREATMENT_SLIDER_VALUES["dialysateTemperature"][2], + bloodPressureMeasurementInterval = CREATE_TREATMENT_SLIDER_VALUES["bloodPressureMeasurementInterval"][2], + rinsebackFlowRate = CREATE_TREATMENT_SLIDER_VALUES["rinsebackFlowRate"][2], + ) + + verify_request_continue_mode(hd) + + + #verify_request_rejection_mode(hd) #set_operating_parameters(heparin_type = HEPARIN_TYPE, # acid_concentrate = ACID_CONCENTRATE[1], @@ -187,6 +274,12 @@ #hd.cmd_send_pre_treatment_patient_connection_confirm_response(accepted = 1, reason = 1) #hd.cmd_send_pre_treatment_prime_start_response(accepted = 1, reason = 1) #hd.cmd_send_pre_treatment_continue_to_treament_response( accepted=1, reason= 0) + hd.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 + ]) hd.cmd_initiate_treatment_response(response= 1, reason=0) time.sleep(2) #hd.cmd_send_pre_treatment_patient_connection_confirm_response(accepted = 1, reason = 0) @@ -196,7 +289,7 @@ time.sleep(20) - - + + """ utils.tstDone()