Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a -r773bdca9f28d573177bb59389312e1a24b2f138c --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -229,5 +229,8 @@ PRESCRIPTION_SETTINGS_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate" ,"Dialysate Temperature"] RED_COLOR = "#c53b33" WHITE_COLOR = "#fefefe" +HDF = "HDF" +BUTTON_TYPE = ["Select Rx","Clear All"] +Blood_flow_value = "-- --" Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a -r773bdca9f28d573177bb59389312e1a24b2f138c --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -370,7 +370,9 @@ o_preTreatmentStack_confirmButton_ConfirmButton = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_confirmButton", "type": "ConfirmButton" , "visible": True } o_ufRate_LabelUnitText = {"container": o_Overlay, "objectName": "_ufRate", "type": "LabelUnitText" } o_newTreatmentDuration_LabelUnitText = {"container": o_Overlay, "objectName": "_newTreatmentDuration", "type": "LabelUnitText" } - +o_numRect_Rectangle = {"container": o_Overlay, "id": "_numRect", "type": "Rectangle", "unnamed": 1 } +o_Vitals_Popup_CloseButton = {"container": o_Overlay, "id": "_closeButton", "type": "CloseButton", "unnamed": 1 } +o_vitals_Interval_TitleText = {"container": o_Overlay, "type": "TitleText", "unnamed": 1 } #Isolated UF o_isolatedUfButton_TouchRect = {"container": o_Overlay, "objectName": "_isolatedUfButton", "type": "TouchRect" } o_valueAdjuster_ValueAdjuster = {"container": o_Overlay, "objectName": "_valueAdjuster", "type": "ValueAdjuster" } @@ -386,4 +388,39 @@ o_vitals_close_btn = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1 } o_treatmentHome_notification_NotificationBarSmall = {"container": mainTreatmentScreen, "objectName": "_notification", "type": "NotificationBarSmall" } - +#Rinseback +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRinsebackStack", "type": "EndTreatmentRinsebackStack", } +o_EndTreatmentRinsebackStack_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback", } +o_EndTreatmentRinseback_arterialRangeBar_TreatmentPressureComponent= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_arterialRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_venousRangeBar_TreatmentPressureComponent= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_venousRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_tmpRangeBar_TreatmentPressureComponent = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_tmpRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_deliveredVolumeText_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_deliveredVolumeText", "type": "Text", } +o_EndTreatmentRinseback_flowRateValue_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_flowRateValue", "type": "Text", } +o_EndTreatmentRinseback_endButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_endButton", "type": "TouchRect", } +o_EndTreatmentRinseback_pauseResumeButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_pauseResumeButton", "type": "TouchRect", } +o_EndTreatmentRinseback_NotificationBar_NotificationBarSmall = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "type": "Text", "unnamed": 1 } +o_EndTreatmentRinseback_targetVolumeProgress_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_targetVolumeProgress", "type": "ProgressCircle", } +o_EndTreatmentRinseback_timeout_TimeText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_timeout", "type": "TimeText", } +o_EndTreatmentRinseback_decrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_decrementFlowRateButton", "type": "ArrowButton", } +o_EndTreatmentRinseback_incrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_incrementFlowRateButton", "type": "ArrowButton", } +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackComplete", "type": "EndTreatmentRinsebackComplete", } +o_EndTreatmentRinsebackComplete_instructionView_InstructionView = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete, "id": "_instructionView", "type": "InstructionView", "unnamed": 1 } +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackInit", "type": "EndTreatmentRinsebackInit", } +o_EndTreatmentRinsebackInit_description_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_description", "type": "Text", } +o_EndTreatmentRinsebackInit_TimeText_hour_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_TimeText_hour", "type": "Text", } +o_EndTreatmentRinsebackInit_TimeText_minute_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_TimeText_minute", "type": "Text", } +o_EndTreatmentRinsebackInit_NotificationBar_NotificationBarSmall= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_EndTreatmentRinsebackInit_beginRinsebackTouchRect_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "id": "_beginRinsebackTouchRect", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_Title_Text = {"container": o_Overlay, "id": "_messageText", "type": "TitleText", "unnamed": 1 } +o_Blood_Return_Complete_Recirculate_TouchRect = {"container": o_Overlay, "id": "_additionalTouch", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_End_Treatment_TouchRect = {"container": o_Overlay, "id": "_cancelTouch", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_Fluid_Bolus_TouchRect = {"container": o_Overlay, "id": "_confirmTouch", "type": "ConfirmButton", "unnamed": 1 } +o_treatmentHome_treatmentVitals_TreatmentVitals = {"container": mainTreatmentScreen, "objectName": "treatmentVitals", "type": "TreatmentVitals" } +o_bpMeasurementIntervalControl_ValueAdjusterCustom = {"container": o_Overlay, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1 } +o_measureVitalsButton_TouchRect = {"container": o_Overlay, "id": "_measureVitalsButton", "type": "TouchRect", "unnamed": 1 } +o_notification_bar = {"container": o_Overlay, "objectName": "NotificationBar", "type": "NotificationBarSmall" } +o_last_read = {"container": mainTreatmentScreen, "id":"_lastRecorded" , "type": "Text", "unnamed": 1 } +o_vitalCountdown_Text = {"container": o_Gui_MainView, "objectName": "_vitalCountdown", "type": "Text" } +o_PreTreatmentCreate_prescriptionDotMenu_BaseComboBox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_prescriptionDotMenu", "type": "BaseComboBox", "unnamed": 1, "visible": True} +o_preTreatmentStack_PreTreatmentBase_PreTreatmentBase_2 = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentBase", "occurrence": 7, "type": "PreTreatmentBase", "visible": False} Index: suite_leahi/tst_create_treatment/test.py =================================================================== diff -u -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 -r773bdca9f28d573177bb59389312e1a24b2f138c --- suite_leahi/tst_create_treatment/test.py (.../test.py) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) +++ suite_leahi/tst_create_treatment/test.py (.../test.py) (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -1,508 +1,283 @@ -# Subject/Title: LDT -2174 Treatment Parameters (Create Rx) - SW - 02 - (New Design) - Q&R - 15: SIT - Software Integration Tests - Squish Qt +# Subject/Title: LDT -3672 SW Misc & Enhc - SW - 02 - New Design - CreateRx - Q&R - 15: SIT - Software Integration Tests - Squish Qt # # Functionalities: Testing all functionalities of Treatment parameters validation mode(Create RX) # # Steps: # 1 Create RX: -# - Validate all the values in Create Rx page -# - Verify the validate functionality -# - Verify the confirm button functionality -# - Verify the qr code functionality -# - Verfiy the edit button functionality -# - Verify the clear all button functionality -# - Verify the reject button functionality +# - Verify the treatment modality set to HD +# - Verify the treatment modality set to HDF +# - When Treatment mode set to HDF check the below buttons are visible +# - a.In HDF mode HDF operation Mode button is visible +# - b.In HDF mode Substitution Fluid Volume button is visible + import names -from names import * -import squish -from leahi_dialin.ui import utils -from configuration import config -from configuration import utility -from leahi_dialin.ui.td_messaging import TD_Messaging -from leahi_dialin.common.td_defs import TDOpModes -from builtins import int as pyInt -from squish import * +from names import * +import squish +from leahi_dialin.ui import utils +from configuration import config,utility,navigation +from leahi_dialin.ui.td_messaging import TD_Messaging +from leahi_dialin.common.td_defs import TDOpModes +from builtins import int as pyInt +from squish import * -td = TD_Messaging() -PRE_TREATMENT_STEP = 0 -PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "BP/HR" , "Ultrafiltration" , "Connection" , "Start"] -COMPLETE_COLOR = '#4696f7' -CURRENT_COLOR = '#000000' -BLOOD_FLOW_RATE = "Blood Flow Rate" -DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" -DURATION = "Duration" -HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" -SALINE_BOLUS_VOLUME = "Saline Bolus Volume" -OFF_TEXT = "OFF" -HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" -HEPARIN_STOP_TIME = "Heparin Stop Time" -DIALYSATE_TEMPERATURE = "Dialysate Temperature" -BLOOD_PRESSURE_MEASUREMENT_INTERVAL = "BP Measurement Interval" -ACID_CONCENTRATE_TITLE = "Acid Concentrate" -BICARBONATE_CONCENTRATE_TITLE = "Bicarbonate Concentrate" -DIALYZER_TYPE_TITLE = "Dialysate Temperature" +td = TD_Messaging() - - -#dictionary consist of slider [minimum value, slider buffer value, width buffer of slider] -CREATE_TREATMENT_PARAMETER = { - "Blood Flow Rate" : [60.0], - "Dialysate Flow Rate" : [75.0], - "Duration" : [75.0], - "Heparin Bolus Volume" : [0.3], - "Heparin Dispensing Rate" : [0.3], - "Heparin Stop Time" : [75.0], - "Saline Bolus Volume" : [200], - "Dialysate Temperature" : [35.5], - "BP Measurement Interval" : [10], - "Rinseback Flow Rate" : [75], -} -CREATE_TREATMENT_PARAMETER_RANGE = { - "Blood Flow Rate" : [50.0], - "Dialysate Flow Rate" : [50.0], - "Duration" : [60.0], - "Heparin Bolus Volume" : [0.2], - "Heparin Dispensing Rate" : [0.2,0.5,1.0], - "Heparin Stop Time" : [60.0], - "Saline Bolus Volume" : [100], - "Dialysate Temperature" : [35.0], - "BP Measurement Interval" : [5], - -} - -CREATE_TREATMENT_PARAMETER_SLIDER = { - "Blood Flow Rate" : [500.0], - "Dialysate Flow Rate" : [600.0], - "Duration" : [480.0], - "Heparin Bolus Volume" : [2.0], - "Heparin Dispensing Rate" : [1.0], - "Heparin Stop Time" : [480.0], - "Saline Bolus Volume" : [300], - "Dialysate Temperature" : [38.0], - "BP Measurement Interval" : [60], - -} - -CREATE_TREATMENT_SLIDER_VALUES = { - "Blood Flow Rate" : [60, 10, 500], - "Dialysate Flow Rate" : [50, 10, 600], - "duration" : [60, 15, 28], - "heparin_dispensing_rate" : [0.2, 0.1, 93], - "heparin_bolus_volume" : [0.2, 0.1, 41], - "heparin_stop_time" : [0, 10, 15.75], - "saline_bolus" : [100, 100, 425], - "dialysate_temperature" : [35, 0.5, 187.5], - "arterial_pressure_limit_high" : [20, 10, 11.931], - "blood_pressure_measurement_interval" : [5, 5, 60], -} - -COLOR_CODES = "#ffa500" -VALIDATE = "VALIDATE" -CONFIRM = "CONFIRM" - -DIALYZER_TYPE = ["Diacap Pro 13H","Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] -ACID_CONCENTRATE = ["2.0 K, 2.00 Ca, 1 Mg", "1.0 K, 2.50 Ca, 1 Mg","2.0 K, 2.50 Ca, 1 Mg","3.0 K, 2.50 Ca, 1 Mg"] -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", - "Duration", "Heparin Bolus Volume", - "Heparin Dispensing Rate", "Heparin Stop Time", - "Acid Concentrate", "Bicarbonate Concentrate", - "Dialyzer Type", "Dialysate Temperature"] - - -CREATE_TREATEMENT_OBJ = [names.o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateFlowRate_LabelUnitContainer, - names.o_PreTreatmentCreate_duration_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer, - names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer ,names.o_PreTreatmentCreate_heparinStopTime_LabelUnitContainer, - names.o_PreTreatmentCreate_acidConcentrate_LabelUnitContainer ,names.o_PreTreatmentCreate_bicarbonateConcentrate_LabelUnitContainer, - names.o_PreTreatmentCreate_dialyzerType_LabelUnitContainer ,names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer, - names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer ] - - -BUTTON_TYPE = ["Select Rx","Edit Rx","Clear All"] -VITALS = ["OFF","5","10","15","20","30","60"] -BICARBONATE = ["Sodium Bicarbonate"] - - -def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): - """ - Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] - @param treatment_step : (int) indicates the Current treatment step - """ - test.startSection("verification of page step indicators") - for page in range(len(treatment_screens)): - bullet_children = object.children(squish.waitForObjectExists(utility.get_bullet_object(screen_obj, page))) - bullet_circle_color = bullet_children[0].color.name - bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(utility.get_text_object(screen_obj, treatment_screens[page])) - #To verify the step indicators of the completed treatment screens - if page < treatment_step: - test.verify(squish.waitForObjectExists(utility.get_bullet_object(screen_obj, page)).complete) - test.verify(not squish.waitForObjectExists(utility.get_bullet_object(screen_obj, page)).current) - test.compare(bullet_circle_color, COMPLETE_COLOR) - test.compare(bullet_border_color, COMPLETE_COLOR) - test.compare(step_title.color.name, ENABLED_COLOR) - #To verify the step indicators of the current treatment screen - elif page == treatment_step: - test.compare(bullet_border_color, COMPLETE_COLOR) - #To verify the step indicators of the remaining treatment screens - else: - test.verify(not squish.waitForObjectExists(utility.get_bullet_object(screen_obj, page)).complete) - test.compare(bullet_circle_color, CURRENT_COLOR) - test.endSection() - -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") - - # set custom values for parameters - test.startSection("Verification of blood flow values") - test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer).text, BLOOD_FLOW_RATE, "Parameter should be -> "+str(BLOOD_FLOW_RATE)) - for blood_flow_rate in CREATE_TREATMENT_PARAMETER_RANGE[BLOOD_FLOW_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, blood_flow_rate) - test.endSection() - - test.startSection("Verification of dialysate flow values") - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_LabelUnitContainer).text, DIALYSATE_FLOW_RATE, "Parameter should be -> "+str(DIALYSATE_FLOW_RATE)) - for dialysate_flow_rate in CREATE_TREATMENT_PARAMETER_RANGE[DIALYSATE_FLOW_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, dialysate_flow_rate) - test.endSection() - - test.startSection("Verification of duration values") - test.compare(waitForObject(names.o_PreTreatmentCreate_duration_LabelUnitContainer).text, DURATION, "Parameter should be -> "+str(DURATION)) - for duration in CREATE_TREATMENT_PARAMETER_RANGE[DURATION]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, duration) - test.endSection() - - test.startSection("Verification of heparin bolus volume values") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer).text, HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(HEPARIN_BOLUS_VOLUME)) - mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster)) - for heparin_bolus_volume in CREATE_TREATMENT_PARAMETER_RANGE[HEPARIN_BOLUS_VOLUME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, heparin_bolus_volume) - test.endSection() - - test.startSection("Verification of heparin dispensing rate values") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer).text, HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(HEPARIN_DISPENSING_RATE)) - mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster)) - for heparin_dispensing_rate in CREATE_TREATMENT_PARAMETER_RANGE[HEPARIN_DISPENSING_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, heparin_dispensing_rate) - test.endSection() - - test.startSection("Verification of heparin stop time values") - #1. Change Duration -> Verify Heparin Stop Time "active" property is set to off - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 60) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.3) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 60) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 75) - heprain_Stop_time = waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster) - test.compare(heprain_Stop_time.isActive,False, "Heprain stop time active property is set to False") - - # 2. Change Heparin Dispensising Rate from 0.2 to OFF -> Verify Heparing Stop Time is set to OFF - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 60) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.3) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 60) - utility.click_left_until_off(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster) - test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTime_OFF_Text).text,"OFF") - - # 3. Change Heparin Dispensising Rate from OFF to 0.2 -> Verify Heparin Stop Time "active" property is set to off - utility.set_value_based_on_target(o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.2) - test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTime_OFF_Text).text,"-- --") - heprain_Stop_time = waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster) - test.compare(heprain_Stop_time.isActive,False, "Heprain stop time active property is set to False") - - # 4. When Duration is set to a value -> Verify the max Heparin Stop Time is the Duration value that is set - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 90) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 90) - test.compare(waitForObjectExists(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster).value,90.0) - obj = waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster) - right_arrow =utility.findObjectById(obj ,"_rightArrow") - test.compare(not right_arrow.enabled, True, "Right arrow is disabled in Heparin stop time field") - - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, "0.2") - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, "120") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_LabelUnitContainer).text, HEPARIN_STOP_TIME, "Parameter should be -> "+str(HEPARIN_STOP_TIME)) - for heparin_stop_time in CREATE_TREATMENT_PARAMETER_RANGE[HEPARIN_STOP_TIME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, heparin_stop_time) - test.endSection() - - test.startSection("Verification of Dialysate Temperature") - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer).text,DIALYSATE_TEMPERATURE , "Parameter should be -> "+str(DIALYSATE_TEMPERATURE)) - for dialysate_temperature in CREATE_TREATMENT_PARAMETER_RANGE[DIALYSATE_TEMPERATURE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,dialysate_temperature) - test.endSection() - - test.startSection("Verification of saline bolus values") - test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer).text, SALINE_BOLUS_VOLUME, "Parameter should be -> "+str(SALINE_BOLUS_VOLUME)) - for saline_bolus in CREATE_TREATMENT_PARAMETER_RANGE[SALINE_BOLUS_VOLUME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, saline_bolus) - test.endSection() - - test.startSection("Verification of acid concentrate type") - test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrate_LabelUnitContainer).text, ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(ACID_CONCENTRATE_TITLE)) - mouseClick(waitForObject(names.o_acidConcentrate_editbutton)) - test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrate_Popup_Text).text, ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(ACID_CONCENTRATE_TITLE)) - mouseClick(waitForObject(names.o_potassium_leftArrow_IconButton)) - mouseClick(waitForObject(names.o_calcium_leftArrow_IconButton)) - mouseClick(waitForObject(names.o_saveButton_TouchRect)) - utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,0) - test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[0])) - test.endSection() - - test.startSection("Verification of dialyzer type") - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer).text, DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(DIALYZER_TYPE_TITLE)) - utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,0) - test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(DIALYZER_TYPE[0])) - test.endSection() - - utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,VITALS,2) - utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) - - #Verify all the parameters are populated - test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster).value, 50.0) - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster).value, 50.0) - test.compare(waitForObject(names.o_PreTreatmentCreate_durationControl_ValueAdjuster).value, 120) - test.compare("{:.1f}".format(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster).value), "0.4") - test.compare("{:.1f}".format(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster).value), "0.2") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster).value, 60.0) - - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster).value, 35.0) - test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster).value, 100.0) - - validateButton = waitForObject(names.o_PreTreatmentButton) - #Check the button text - validateText = waitForObject(utility.setObjectText(text=VALIDATE,obj =names.o_PreTreatmentCreate_Text)) - test.compare(validateText.text, VALIDATE, "Button text should be"+str(VALIDATE)) - test.compare(validateButton.enabled, True, "Validate button is enabled") - mouseClick(waitForObject(validateButton)) - td.td_Treatment_Parameters_Validation( vAccepted = 1, - vBloodFlowRateRejectReason = 0, - vDialysateFlowRateRejectReason = 0, - vTreatmentDurationRejectReason = 0, - vSalineBolusVolumeRejectReason = 0, - vHeparinStopTimeRejectReason = 0, - vHeparinTypeRejectReason = 0, - vAcidConcentrateRejectReason = 0, - vBicarbonateConcentrateRejectReason = 0, - vDialyzerTypeRejectReason = 0, - vBloodPressureMeasureIntervalRejectReason = 0, - vRinsebackFlowRateRejectReason = 0, - vRinsebackVolumeRejectReason = 0, - vArterialPressureLimitWindowRejectReason = 0, - vVenousPressureLimitWindowRejectReason = 0, - vVenousPressureLimitAsymtrcRejectReason = 0, - vTrancembrncPressureLimitWindowRejectReason = 0, - vDialysateTempRejectReason = 0, - vHeparinDispensingRateRejectReason = 0, - vHeparinBolusVolumeRejectReason = 0 - ) - test.compare(waitForObjectExists(names.o_PreTreatmentCreate_qrCode_Image).visible, True,"QR Code is visible") - #Check the confirm button text and perform the mouse click - confirmButton = waitForObject(names.o_PreTreatmentButton) - confirmText = waitForObject(utility.setObjectText(text=CONFIRM,obj =names.o_PreTreatmentCreate_Text)) - test.compare(confirmText.text, CONFIRM, "Button text should be"+str(CONFIRM)) - test.compare(confirmButton.enabled, True, "Confirm button is enabled") - mouseClick(waitForObject(confirmButton)) +def verify_create_treatment_HD(): + test.startSection("Treatment modality is set to HD") + hemodialysis = waitForObject(names.o_createHDTreatment_TouchRect) + hemodialysis_btn = utility.findChildByText(hemodialysis, "Hemodialysis") + mouseClick(hemodialysis_btn) + td.td_Treatment_Parameters_CreateRx(vRejectionReason =0) td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) - test.endSection() - -def verify_editRx_Button(): - test.startSection("Verfiy the edit button functionality") - td.td_operation_mode(TDOpModes.MODE_STAN.value) - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) - - td.td_Treatment_Parameters_Validation( vAccepted = 1, - vBloodFlowRateRejectReason = 0, - vDialysateFlowRateRejectReason = 0, - vTreatmentDurationRejectReason = 0, - vSalineBolusVolumeRejectReason = 0, - vHeparinStopTimeRejectReason = 0, - vHeparinTypeRejectReason = 0, - vAcidConcentrateRejectReason = 0, - vBicarbonateConcentrateRejectReason = 0, - vDialyzerTypeRejectReason = 0, - vBloodPressureMeasureIntervalRejectReason = 0, - vRinsebackFlowRateRejectReason = 0, - vRinsebackVolumeRejectReason = 0, - vArterialPressureLimitWindowRejectReason = 0, - vVenousPressureLimitWindowRejectReason = 0, - vVenousPressureLimitAsymtrcRejectReason = 0, - vTrancembrncPressureLimitWindowRejectReason = 0, - vDialysateTempRejectReason = 0, - vHeparinDispensingRateRejectReason = 0, - vHeparinBolusVolumeRejectReason = 0 + navigation.navigation_pageIndicator_step(config.CREATERX) + patient_id = waitForObject(names.o_PreTreatmentCreate_patientID_LabelUnitContainer) + patient_id_edit = utility.findObjectById(patient_id, "_editButton") + mouseClick(patient_id_edit) + mouseClick(squish.waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry)) + waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + mouseClick(squish.waitForObject(names.o_secondaryPatientID_LabelUnitContainer)) + waitForObject(names.o_secondaryPatientID_LabelUnitContainer).text ="Test1" + type(names.o_pretreatmentPatientIDEntry_TextEntry, "") + mouseClick(waitForObject(names.o_confirmButton_ConfirmButton)) + parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") + utility.set_value_based_on_target(blood_flow_rate, 60) + dialysate_flow_rate = utility.findObjectById(parent_obj, "_dialysateFlowRate") + utility.set_value_based_on_target(dialysate_flow_rate, 80) + duration = utility.findObjectById(parent_obj,"_duration") + utility.set_value_based_on_target(duration, 75) + right_obj = waitForObject(names.o_PreTreatmentCreate_rightColumn_Column) + ultrafiltration_volume = utility.findObjectById(right_obj,"_ufVolume") + utility.set_value_based_on_target(ultrafiltration_volume,0.10) + heparin_rx = utility.findObjectById(right_obj,"_heparinRx") + heparin_right_arrow = utility.findObjectById(heparin_rx, "_rightArrow") + mouseClick(heparin_right_arrow) + heparin_obj = waitForObject(names.o_LabelUnitValueAdjuster_LabelUnitValueAdjuster) + heparin_bolus = utility.findObjectById(heparin_obj,"_heparinBolusVolume") + utility.set_value_based_on_target(heparin_bolus, 0.2) + utility.set_value_based_on_target(names.o_heparinDispensingRate_LabelUnitValueAdjuster,0.3) + utility.set_value_based_on_target(names.o_heparinDeliveryDuration_LabelUnitValueAdjuster, 75) + mouseClick(waitForObject(names.o_confirmButton_ConfirmButton)) + utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) + utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) + utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(squish.waitForObject(Nextbutton)) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_sodium_LabelUnitValueAdjuster, 139) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_bicarbonate_LabelUnitValueAdjuster, 35) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_fluidBolusVolume_LabelUnitValueAdjuster,300) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_primeRinsebackVolume_LabelUnitValueAdjuster,310) + td.td_Treatment_Parameters_Validation( vAccepted = 0, + vTreatmentModalityRejectReason = 0, + vHDFTreatmentModeRejectReason = 0, + vBloodFlowRateRejectReason = 1, + vDialysateFlowRateRejectReason = 0, + vTreatmentDurationRejectReason = 0, + vHeparinDeliveryDurationRejectReason = 0, + vHeparinTypeRejectReason = 0, + vDryBicarbCartSizeRejectReason = 0, + vSodiumRejectReason = 0, + vBicarbonateRejectReason = 0, + vDialyzerTypeRejectReason = 0, + vFluidBolusVolumeRejectReason = 0, + vBloodPressureMeasureIntervalRejecteason = 0, + vRinsebackVolumeRejectReason = 0, + vHepatitusBStatusRejectReason = 0, + vAcidConcentrateIndextRejectReason = 0, + vSubstitutionFluidVolumeRejecteason = 0, + vHeparinBolusVolumeRejectReason = 0, + vHeparinDispensingRateRejecteason = 0, + vDialysateTempRejectReason = 0, + vAcidConcentrateConversionFactorRejectReason = 0, + vUFPreWeightRejectReason = 0, + vUFEstimatedTargetWeightRejectReason = 0, + vUFVolumeRejectReason = 0 ) - mouseClick(waitForObject(names.o_PreTreatmentButton,1000)) - utility.select_different_dropdown(names.o_prescription_menuButton,BUTTON_TYPE,1) - test.startSection("Verification of blood flow values") - test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_LabelUnitContainer).text, BLOOD_FLOW_RATE, "Parameter should be -> "+str(BLOOD_FLOW_RATE)) - for blood_flow_rate in CREATE_TREATMENT_PARAMETER[BLOOD_FLOW_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, blood_flow_rate) - test.endSection() - test.startSection("Verification of dialysate flow values") - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_LabelUnitContainer).text, DIALYSATE_FLOW_RATE, "Parameter should be -> "+str(DIALYSATE_FLOW_RATE)) - for dialysate_flow_rate in CREATE_TREATMENT_PARAMETER[DIALYSATE_FLOW_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, dialysate_flow_rate) + prescription_obj = waitForObject(names.o_PreTreatmentCreate_listView_ListView) + prescription_menu = utility.findChildByText(prescription_obj,"Patient Prescription") + mouseClick(prescription_menu) + parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") + parameter_text = waitForObject(blood_flow_rate) + parameter_text_color = parameter_text.border.color.name + test.compare(config.COLOR_CODES, parameter_text_color, "parameter color should be ' \red for' " + str(parameter_text_color)) + treatment_settings = utility.findChildByText(prescription_obj,"Treatment Settings") + mouseClick(treatment_settings) + test.log("Check confirm button is disabled when the rejection reason is 1") + confirm_button = waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton) + test.compare(confirm_button.enabled,False,"Confirm button is not visible") + mouseClick(prescription_menu) + utility.set_value_based_on_target(blood_flow_rate, 70) + mouseClick(treatment_settings) + mouseClick(confirm_button) + td.td_Treatment_Parameters_Validation( vAccepted = 1, + vTreatmentModalityRejectReason = 1, + vHDFTreatmentModeRejectReason = 0, + vBloodFlowRateRejectReason = 0, + vDialysateFlowRateRejectReason = 0, + vTreatmentDurationRejectReason = 0, + vHeparinDeliveryDurationRejectReason = 0, + vHeparinTypeRejectReason = 0, + vDryBicarbCartSizeRejectReason = 0, + vSodiumRejectReason = 0, + vBicarbonateRejectReason = 0, + vDialyzerTypeRejectReason = 0, + vFluidBolusVolumeRejectReason = 0, + vBloodPressureMeasureIntervalRejecteason = 0, + vRinsebackVolumeRejectReason = 0, + vHepatitusBStatusRejectReason = 0, + vAcidConcentrateIndextRejectReason = 0, + vSubstitutionFluidVolumeRejecteason = 0, + vHeparinBolusVolumeRejectReason = 0, + vHeparinDispensingRateRejecteason = 0, + vDialysateTempRejectReason = 0, + vAcidConcentrateConversionFactorRejectReason = 0, + vUFPreWeightRejectReason = 0, + vUFEstimatedTargetWeightRejectReason = 0, + vUFVolumeRejectReason = 0 + ) + test.log("check it is in create treatment page") + setup_treatement = waitForObject(names.o_headerBar_HeaderBar) + setup_treatement_obj = utility.findChildByText(setup_treatement,"Setup Treatment") + test.compare(str(setup_treatement_obj.text),"Setup Treatment","Page is navigated to Set Up Treatment page") test.endSection() - test.startSection("Verification of duration values") - test.compare(waitForObject(names.o_PreTreatmentCreate_duration_LabelUnitContainer).text, DURATION, "Parameter should be -> "+str(DURATION)) - for duration in CREATE_TREATMENT_PARAMETER[DURATION]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, duration) +def verify_create_treatment_HDF(): + test.startSection("Treatment modality is set to HDF") + td.td_operation_mode(TDOpModes.MODE_STAN.value) + hemodiafiltration = waitForObject(names.o_createHDFTreatment_TouchRect) + hemodiafiltration_btn = utility.findChildByText(hemodiafiltration, "Hemodiafiltration") + mouseClick(hemodiafiltration_btn) + td.td_Treatment_Parameters_CreateRx(vRejectionReason =0) + td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) + navigation.navigation_pageIndicator_step(config.CREATERX) + patient_id = waitForObject(names.o_PreTreatmentCreate_patientID_LabelUnitContainer) + patient_id_edit = utility.findObjectById(patient_id, "_editButton") + mouseClick(patient_id_edit) + mouseClick(waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry)) + waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + squish.mouseClick(squish.waitForObject(names.o_secondaryPatientID_LabelUnitContainer)) + waitForObject(names.o_secondaryPatientID_LabelUnitContainer).text ="Test1" + type(names.o_pretreatmentPatientIDEntry_TextEntry, "") + mouseClick(squish.waitForObject(names.o_confirmButton_ConfirmButton)) + # mouseClick(squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) + # waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + test.log("Check the Treatment modality is HDF") + treatment_modality = waitForObject(names.o_PreTreatmentCreate_treatmentModalityComboBox_BaseComboBox) + test.compare(str(treatment_modality.displayText), config.HDF,"Treatment modality value should be"+str(config.HDF)) + hdf_operating_mode = waitForObject(names.o_PreTreatmentCreate_hdfTreatmentMode_LabelUnitContainer) + test.compare(hdf_operating_mode.visible, True, "HDF Operating mode button is visible") + substitution_fluid_volume = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + substitution_fluid_volume_obj = utility.findObjectById(substitution_fluid_volume,"_subFluidVolume") + test.compare(substitution_fluid_volume_obj.visible,True,"Substitution Fluid volume button is visible") test.endSection() - test.startSection("Verification of heparin bolus volume values") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_LabelUnitContainer).text, HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(HEPARIN_BOLUS_VOLUME)) - mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster)) - test.compare(OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_Off_Text).text, "OFF text should be enabled") - for heparin_bolus_volume in CREATE_TREATMENT_PARAMETER[HEPARIN_BOLUS_VOLUME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, heparin_bolus_volume) - test.endSection() - - test.startSection("Verification of heparin dispensing rate values") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_LabelUnitContainer).text, HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(HEPARIN_DISPENSING_RATE)) - mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster)) - test.compare(OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateControl_OffText).text, "OFF text should be enabled") - for heparin_dispensing_rate in CREATE_TREATMENT_PARAMETER[HEPARIN_DISPENSING_RATE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, heparin_dispensing_rate) - test.endSection() - - test.startSection("Verification of heparin stop time values") - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, "0.2") - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, "120") - test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_LabelUnitContainer).text, HEPARIN_STOP_TIME, "Parameter should be -> "+str(HEPARIN_STOP_TIME)) - for heparin_stop_time in CREATE_TREATMENT_PARAMETER[HEPARIN_STOP_TIME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, heparin_stop_time) - test.endSection() - - test.startSection("Verification of Dialysate Temperature") - test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_LabelUnitContainer).text,DIALYSATE_TEMPERATURE , "Parameter should be -> "+str(DIALYSATE_TEMPERATURE)) - for dialysate_temperature in CREATE_TREATMENT_PARAMETER_RANGE[DIALYSATE_TEMPERATURE]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,dialysate_temperature) - test.endSection() - - test.startSection("Verification of saline bolus values") - test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolusVolume_LabelUnitContainer).text, SALINE_BOLUS_VOLUME, "Parameter should be -> "+str(SALINE_BOLUS_VOLUME)) - for saline_bolus in CREATE_TREATMENT_PARAMETER[SALINE_BOLUS_VOLUME]: - utility.set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, saline_bolus) - test.endSection() +def setSliderValue(sliderObj): + test.startSection("Check the slider value") + mouseDrag(sliderObj, + 6, 28, + 5, 0, + Qt.NoModifier, + Qt.LeftButton) - td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) + longMouseDrag(sliderObj, + 552, 43, + -23, 7, + Qt.NoModifier, + Qt.LeftButton) test.endSection() -def verfiy_clearall_Button(): - test.startSection("Verfiy the clear all button functionality") +def verify_treatement_slider(): + test.startSection("Check the slider function in create rx page") td.td_operation_mode(TDOpModes.MODE_STAN.value) - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) - - td.td_Treatment_Parameters_Validation( vAccepted = 1, - vBloodFlowRateRejectReason = 0, - vDialysateFlowRateRejectReason = 0, - vTreatmentDurationRejectReason = 0, - vSalineBolusVolumeRejectReason = 0, - vHeparinStopTimeRejectReason = 0, - vHeparinTypeRejectReason = 0, - vAcidConcentrateRejectReason = 0, - vBicarbonateConcentrateRejectReason = 0, - vDialyzerTypeRejectReason = 0, - vBloodPressureMeasureIntervalRejectReason = 0, - vRinsebackFlowRateRejectReason = 0, - vRinsebackVolumeRejectReason = 0, - vArterialPressureLimitWindowRejectReason = 0, - vVenousPressureLimitWindowRejectReason = 0, - vVenousPressureLimitAsymtrcRejectReason = 0, - vTrancembrncPressureLimitWindowRejectReason = 0, - vDialysateTempRejectReason = 0, - vHeparinDispensingRateRejectReason = 0, - vHeparinBolusVolumeRejectReason = 0 - ) - mouseClick(waitForObject(names.o_PreTreatmentButton,1000)) - utility.select_different_dropdown(names.o_prescription_menuButton,BUTTON_TYPE,2) - button = waitForObjectExists(names.o_PreTreatmentButton) - test.verify(not button.enabled, "Validate that the button is disabled") + hemodialysis = waitForObject(names.o_createHDTreatment_TouchRect) + hemodialysis_btn = utility.findChildByText(hemodialysis, "Hemodialysis") + mouseClick(hemodialysis_btn) + td.td_Treatment_Parameters_CreateRx(vRejectionReason =0) + td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) + navigation.navigation_pageIndicator_step(config.CREATERX) + patient_id = waitForObject(names.o_PreTreatmentCreate_patientID_LabelUnitContainer) + patient_id_edit = utility.findObjectById(patient_id, "_editButton") + mouseClick(patient_id_edit) + mouseClick(waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry)) + waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + mouseClick(waitForObject(names.o_secondaryPatientID_LabelUnitContainer)) + waitForObject(names.o_secondaryPatientID_LabelUnitContainer).text ="Test1" + type(names.o_pretreatmentPatientIDEntry_TextEntry, "") + mouseClick(waitForObject(names.o_confirmButton_ConfirmButton)) + parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") + setSliderValue(blood_flow_rate) + dialysate_flow_rate = utility.findObjectById(parent_obj, "_dialysateFlowRate") + setSliderValue(dialysate_flow_rate) test.endSection() - - -def verify_custom_treatment_record_rejected(): - """ - Method to verify custom treatment record, if confirmation rejected - """ - test.startSection("Verifying custom treatment record, if confirmation rejected") - td.td_operation_mode(TDOpModes.MODE_STAN.value) - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) - td.td_Treatment_Parameters_Validation( vAccepted = 0, - vBloodFlowRateRejectReason = 1, - vDialysateFlowRateRejectReason = 1, - vTreatmentDurationRejectReason = 1, - vSalineBolusVolumeRejectReason = 1, - vHeparinStopTimeRejectReason = 1, - vHeparinTypeRejectReason = 1, - vAcidConcentrateRejectReason = 1, - vBicarbonateConcentrateRejectReason = 1, - vDialyzerTypeRejectReason = 1, - vBloodPressureMeasureIntervalRejectReason = 1, - vRinsebackFlowRateRejectReason = 1, - vRinsebackVolumeRejectReason = 1, - vArterialPressureLimitWindowRejectReason = 1, - vVenousPressureLimitWindowRejectReason = 1, - vVenousPressureLimitAsymtrcRejectReason = 1, - vTrancembrncPressureLimitWindowRejectReason = 1, - vDialysateTempRejectReason = 1, - vHeparinDispensingRateRejectReason = 1, - vHeparinBolusVolumeRejectReason = 1 - ) - for expected_treatment_title,object in zip(CREATE_TREATMENT_PARAMETERS,CREATE_TREATEMENT_OBJ): - - parameter_object = utility.setObjectText(text = expected_treatment_title,obj =object) - parameter_text = waitForObject(parameter_object) - parameter_text_color = parameter_text.border.color.name - test.compare(COLOR_CODES, parameter_text_color, "parameter color should be ' \red for' " + expected_treatment_title +" , if the confirmation get rejected !") - - test.endSection() - -def verify_custom_treatment_slider(): - test.startSection("Verifying slider functionality of custom treatment") +def verify_create_treatement_clear_all(): + test.startSection("Check the clear all functionality in the create Rx page") td.td_operation_mode(TDOpModes.MODE_STAN.value) - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0 ) - utility.set_value_with_slider(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster,names.o_PreTreatmentCreate_bloodFlowRate_slider_Slider,BLOOD_FLOW_RATE) - utility.set_value_with_slider(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster,names.o_PreTreatmentCreate_dialysateFlowRate_slider_Slider,DIALYSATE_FLOW_RATE) - utility.set_value_with_slider(names.o_PreTreatmentCreate_durationControl_ValueAdjuster,names.o_PreTreatmentCreate_duration_slider_Slider,DURATION) - utility.set_value_with_slider(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster,names.o_PreTreatmentCreate_heprainBolusVolume_slider_Slider,HEPARIN_BOLUS_VOLUME) - utility.set_value_with_slider(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster,names.o_PreTreatmentCreate_heprainDispensingRate_slider_Slider,HEPARIN_DISPENSING_RATE) - utility.set_value_with_slider(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster,names.o_PreTreatmentCreate_heprainStopTime_slider_Slider,HEPARIN_STOP_TIME) - utility.set_value_with_slider(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,names.o_PreTreatmentCreate_dialysateTemperature_slider_Slider,DIALYSATE_TEMPERATURE) - utility.set_value_with_slider(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster,names.o_PreTreatmentCreate_salineBolusVolume_slider_Slider,SALINE_BOLUS_VOLUME) + hemodialysis = waitForObject(names.o_createHDTreatment_TouchRect) + hemodialysis_btn = utility.findChildByText(hemodialysis, "Hemodialysis") + mouseClick(hemodialysis_btn) + td.td_Treatment_Parameters_CreateRx(vRejectionReason =0) + td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) + navigation.navigation_pageIndicator_step(config.CREATERX) + parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") + utility.set_value_based_on_target(blood_flow_rate, 60) + dialysate_flow_rate = utility.findObjectById(parent_obj, "_dialysateFlowRate") + utility.set_value_based_on_target(dialysate_flow_rate, 80) + duration = utility.findObjectById(parent_obj,"_duration") + utility.set_value_based_on_target(duration, 75) + right_obj = waitForObject(names.o_PreTreatmentCreate_rightColumn_Column) + ultrafiltration_volume = utility.findObjectById(right_obj,"_ufVolume") + utility.set_value_based_on_target(ultrafiltration_volume,0.10) + heparin_rx = utility.findObjectById(right_obj,"_heparinRx") + heparin_right_arrow = utility.findObjectById(heparin_rx, "_rightArrow") + mouseClick(heparin_right_arrow) + heparin_obj = waitForObject(names.o_LabelUnitValueAdjuster_LabelUnitValueAdjuster) + heparin_bolus = utility.findObjectById(heparin_obj,"_heparinBolusVolume") + utility.set_value_based_on_target(heparin_bolus, 0.2) + utility.set_value_based_on_target(names.o_heparinDispensingRate_LabelUnitValueAdjuster,0.3) + utility.set_value_based_on_target(names.o_heparinDeliveryDuration_LabelUnitValueAdjuster, 75) + mouseClick(waitForObject(names.o_confirmButton_ConfirmButton)) + utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) + utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) + utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(squish.waitForObject(Nextbutton)) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_sodium_LabelUnitValueAdjuster, 139) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_bicarbonate_LabelUnitValueAdjuster, 35) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_fluidBolusVolume_LabelUnitValueAdjuster,300) + utility.set_value_based_on_target(names.o_PreTreatmentCreate_primeRinsebackVolume_LabelUnitValueAdjuster,310) + prescription_obj = waitForObject(names.o_PreTreatmentCreate_listView_ListView) + prescription_menu = utility.findChildByText(prescription_obj,"Patient Prescription") + mouseClick(prescription_menu) + mouseClick(waitForObject(prescription_menu)) + utility.select_different_dropdown(names.o_PreTreatmentCreate_prescriptionDotMenu_BaseComboBox,config.BUTTON_TYPE,1) + test.log("Check the heparin values and edit button") + parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") + blood_flow_rate_obj = utility.findObjectById(blood_flow_rate,"_valueAdjuster") + blood_flow_text = utility.findObjectById(blood_flow_rate_obj,"_text") + test.compare(blood_flow_text.text,config.Blood_flow_value,"Blood flow value should be"+str(blood_flow_text.text)) test.endSection() def main(): utils.tstStart(__file__) - startApplication(config.AUT_NAME + " -q") - + startApplication(utility.aut("-q")) td.td_operation_mode(TDOpModes.MODE_STAN.value) - # verify Standby screen test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) - test.startSection("Verfiy the treatement parameter validation") - verify_page_step_indicator(screen_obj=names.o_PreTreatmentCreate_gridSteps_Grid, treatment_step=PRE_TREATMENT_STEP, treatment_screens=PRE_TREATMENT_SCREENS) - test.log("Verify the Patient ID field") - mouseClick(waitForObject(names.o_PatientIDEntry_TextEntry)) - waitForObject(names.o_PatientIDEntry_TextEntry).text ="3456" - verify_create_custom_treatment_parameter() - test.endSection() - test.startSection("Verify the slider function without Patient ID") - verify_custom_treatment_slider() + #create treatment in HD Mode + test.startSection("Check the create treatement in HD and HDF Mode") + verify_create_treatment_HD() + verify_treatement_slider() + verify_create_treatment_HDF() + verify_create_treatement_clear_all() test.endSection() - - verify_editRx_Button() - verfiy_clearall_Button() - verify_custom_treatment_record_rejected() - utils.tstDone() - Index: suite_leahi/tst_create_treatment/verificationPoints/VP1 =================================================================== diff -u --- suite_leahi/tst_create_treatment/verificationPoints/VP1 (revision 0) +++ suite_leahi/tst_create_treatment/verificationPoints/VP1 (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -0,0 +1,4 @@ + + + + Index: suite_leahi/tst_end_of_treatment/test.py =================================================================== diff -u -r7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a -r773bdca9f28d573177bb59389312e1a24b2f138c --- suite_leahi/tst_end_of_treatment/test.py (.../test.py) (revision 7fa3503b0eeaf8e05f4f885d7af4ea2947d90e0a) +++ suite_leahi/tst_end_of_treatment/test.py (.../test.py) (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -118,16 +118,7 @@ heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText test.compare(config.MIN_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(config.MIN_HEARTRATE)) ultrafiltration_edit = waitForObjectExists(names.o_editButton_ultrafiltration_IconButton) - test.compare(ultrafiltration_edit.enabled,True,"Ultrafiltration edit button is enabled") - mouseClick(waitForObject(names.o_editButton_ultrafiltration_IconButton)) - #check isolated,pause uf and edit uf button state - isolateduf_button = waitForObjectExists(names.o_isolatedUfButton_TouchRect) - test.compare(isolateduf_button.enabled,True,"Isolated UF button is enabled") - edituf_button =waitForObjectExists(names.o_editButton_TouchRect) - test.compare(not edituf_button.enabled,True,"Edit UF button is disabled") - pauseuf_button = waitForObjectExists(names.o_pauseResumeButton_TouchRect) - test.compare(not pauseuf_button.enabled,True,"Pause UF button is disabled") - mouseClick(names.o_image_Image) + test.compare(ultrafiltration_edit.enabled,False,"Ultrafiltration edit button is enabled") treatment_parameters_edit = waitForObjectExists(names.o_treatmentHome_editButton_IconButton_2) test.compare(treatment_parameters_edit.enabled,True,"Treatment parameters edit button is disabled") td.td_treatment_set_points (blood_flow = 51, Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u -r30aa33698b5c5b0559841590c4bf0e87f9ccf820 -r773bdca9f28d573177bb59389312e1a24b2f138c --- suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision 30aa33698b5c5b0559841590c4bf0e87f9ccf820) +++ suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision 773bdca9f28d573177bb59389312e1a24b2f138c) @@ -427,15 +427,18 @@ test.endSection() test.startSection("Verify the vitals interval popup") - mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) + parent_obj = waitForObject(names.o_treatmentHome_treatmentVitals_TreatmentVitals) + edit_button = utility.findObjectById(parent_obj,"_editButton") + mouseClick(waitForObject(edit_button)) #check the title text in the popup vitals_titleText = waitForObjectExists(names.o_vitals_Interval_TitleText).text - test.compare("Vitals Interval", vitals_titleText, "Vitals Interval popup text should be ->"+str("Vitals Interval")) + test.compare("Vitals Settings", vitals_titleText, "Vitals Interval popup text should be ->"+str("Vitals Interval")) parent_obj = waitForObject(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom) vitals_interval = utility.findObjectById(parent_obj, "_rightArrow") mouseClick(vitals_interval) # set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5) mouseClick(waitForObject(names.o_confirm_button)) + mouseClick(waitForObject(names.o_vitals_close_btn)) test.endSection() test.startSection("Verify the vitals data send automatically populate on popup") @@ -458,13 +461,18 @@ test.endSection() test.startSection("Check the vitals in main treatment screen") - mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) + parent_obj = waitForObject(names.o_treatmentHome_treatmentVitals_TreatmentVitals) + edit_button = utility.findObjectById(parent_obj,"_editButton") + mouseClick(waitForObject(edit_button)) set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 30) mouseClick(waitForObject(names.o_confirm_button,1000)) + mouseClick(waitForObject(names.o_vitals_close_btn)) validate_time_interval(names.o_vitalCountdown_Text,30) - mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) + + mouseClick(waitForObject(edit_button)) set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5) mouseClick(waitForObject(names.o_confirm_button,1000)) + mouseClick(waitForObject(names.o_vitals_close_btn)) validate_time_interval(names.o_vitalCountdown_Text,5) test.endSection()