# Subject/Title: LDT -2174 Treatment Parameters (Create Rx) - SW - 02 - (New Design) - 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 import names 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() def main(): utils.tstStart(__file__) startApplication(utility.aut("-q")) td.td_operation_mode(TDOpModes.MODE_STAN.value) # verify Standby screen test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") #click on the HD Mode test.log("Click on the HD Mode") 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) mouseClick(squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" 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, 75) 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) # heparin_delivery_duration = utility.findObjectById(heparin_obj,"_heparinDeliveryDuration") 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 = 1, 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 ) parent_obj = waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) blood_flow_rate = utility.findObjectById(parent_obj, "_bloodFlowRate") parameter_object = utility.setObjectText(text = "Blood Flow Rate",obj = blood_flow_rate) 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 !")