Index: suite_leahi/tst_new_design_createrx/test.py =================================================================== diff -u -r3c726f3c26d2910ac6148bd72cae713582899ec8 -re82a2e9bb2d083c36604e19a090f8e620ad770fb --- suite_leahi/tst_new_design_createrx/test.py (.../test.py) (revision 3c726f3c26d2910ac6148bd72cae713582899ec8) +++ suite_leahi/tst_new_design_createrx/test.py (.../test.py) (revision e82a2e9bb2d083c36604e19a090f8e620ad770fb) @@ -1,80 +1,69 @@ -# 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,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 * +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") +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) 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") + waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="Patient ID" + 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") + dialysate_flow_rate = utility.findObjectById(parent_obj, "_dialysateFlowRate") utility.set_value_based_on_target(dialysate_flow_rate, 75) - duration = utility.findObjectById(parent_obj,"_duration") + duration = utility.findObjectById(parent_obj,"_duration") utility.set_value_based_on_target(duration, 75) - right_obj = waitForObject(names.o_PreTreatmentCreate_rightColumn_Column) + 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") + 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") + 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) + 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, + vTreatmentModalityRejectReason = 0, vHDFTreatmentModeRejectReason = 0, vBloodFlowRateRejectReason = 1, vDialysateFlowRateRejectReason = 0, @@ -99,11 +88,87 @@ 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 !") - + 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() + +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) + 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(str(substitution_fluid_volume_obj.visible),True,"Substitution Fluid volume button is visible") + test.endSection() + +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") + test.startSection("Create treatment page") + + #create treatment in HD Mode + verify_create_treatment_HD() + verify_create_treatment_HDF() + test.endSection() +