Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r3c726f3c26d2910ac6148bd72cae713582899ec8 -re82a2e9bb2d083c36604e19a090f8e620ad770fb --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 3c726f3c26d2910ac6148bd72cae713582899ec8) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision e82a2e9bb2d083c36604e19a090f8e620ad770fb) @@ -241,3 +241,10 @@ "Install blood tubing set and dialyzer.", ] START_TREATMENT_REJECTION_NOTIFICATION = "[1] Request is not allowed in the current operating mode" + +COLOR_CODES = "#ffa500" +HDF ="HDF" + + + + Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r3c726f3c26d2910ac6148bd72cae713582899ec8 -re82a2e9bb2d083c36604e19a090f8e620ad770fb --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 3c726f3c26d2910ac6148bd72cae713582899ec8) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision e82a2e9bb2d083c36604e19a090f8e620ad770fb) @@ -331,22 +331,20 @@ o_preTreatmentStack_repeater_Repeater = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "repeater", "type": "Repeater", "unnamed": 1 } #New design create Rx -o_createHDTreatment_TouchRect = {"container": o_standByScreen_MainHome, "id": "_createHDTreatment", "type": "TouchRect", "unnamed": 1} -o_PreTreatmentCreate_leftColumn_Column = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_leftColumn", "type": "Column", "unnamed": 1} -o_PreTreatmentCreate_rightColumn_Column = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rightColumn", "type": "Column", "unnamed": 1} -# o_heparinType_LabelUnitContainer = {"container": o_Overlay, "id": "_heparinType", "type": "LabelUnitContainer", "unnamed": 1} -# o_heparinBolusVolume_LabelUnitContainer ={"container": o_Overlay, "id": "_heparinBolusVolume", "type": "LabelUnitContainer", "unnamed": 1} -# o_heparinDispensingRate_LabelUnitContainer ={"container": o_Overlay, "id": "_heparinDispensingRate", "type": "LabelUnitContainer", "unnamed": 1} -# o_heparinDeliveryDuration_LabelUnitContainer ={"container": o_Overlay, "id": "_heparinDeliveryDuration", "type": "LabelUnitContainer", "unnamed": 1} -o_LabelUnitValueAdjuster_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster"} -# o_valueAdjuster_ValueAdjuster = {"container": o_Overlay, "objectName": "_valueAdjuster", "type": "ValueAdjuster", "visible": True} -o_heparinDispensingRate_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster","id": "_heparinDispensingRate", "type": "LabelUnitValueAdjuster"} -o_heparinDeliveryDuration_LabelUnitValueAdjuster ={"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster","id": "_heparinDeliveryDuration", "type": "LabelUnitValueAdjuster"} -o_PreTreatmentCreate_leftColumn_Column_2 = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_leftColumn", "type": "Column", "unnamed": 1} -o_PreTreatmentCreate_rightColumn_Column_2 = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rightColumn", "type": "Column", "unnamed": 1} -o_PreTreatmentCreate_bpMeasurementInterval_LabelUnitContainer = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1} -o_PreTreatmentCreate_hepatitusStatus_LabelUnitContainer = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_hepatitusStatusControl", "type": "ValueAdjusterCustom", "unnamed": 1, "visible": True} -o_PreTreatmentCreate_sodium_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_sodium","objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster"} -o_PreTreatmentCreate_bicarbonate_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bicarbonate","objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster"} -o_PreTreatmentCreate_fluidBolusVolume_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_fluidBolusVolume","objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster"} -o_PreTreatmentCreate_primeRinsebackVolume_LabelUnitValueAdjuster= {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_primeRinsebackVolume","objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster"} +o_createHDTreatment_TouchRect = {"container": o_standByScreen_MainHome, "id": "_createHDTreatment", "type": "TouchRect", "unnamed": 1 } +o_PreTreatmentCreate_leftColumn_Column = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_leftColumn", "type": "Column", "unnamed": 1 } +o_PreTreatmentCreate_rightColumn_Column = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rightColumn", "type": "Column", "unnamed": 1 } +o_LabelUnitValueAdjuster_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster" } +o_heparinDispensingRate_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster", "id": "_heparinDispensingRate", "type": "LabelUnitValueAdjuster" } +o_heparinDeliveryDuration_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_LabelUnitValueAdjuster", "id": "_heparinDeliveryDuration", "type": "LabelUnitValueAdjuster" } +o_PreTreatmentCreate_leftColumn_Column_2 = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_leftColumn", "type": "Column", "unnamed": 1 } +o_PreTreatmentCreate_rightColumn_Column_2 = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rightColumn", "type": "Column", "unnamed": 1 } +o_PreTreatmentCreate_sodium_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_sodium", "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster" } +o_PreTreatmentCreate_bicarbonate_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bicarbonate", "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster" } +o_PreTreatmentCreate_fluidBolusVolume_LabelUnitValueAdjuster = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_fluidBolusVolume", "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster" } +o_PreTreatmentCreate_primeRinsebackVolume_LabelUnitValueAdjuster= {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_primeRinsebackVolume", "objectName": "_LabelUnitValueAdjuster", "type": "LabelUnitValueAdjuster" } +o_PreTreatmentCreate_listView_ListView = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_listView", "type": "ListView", "unnamed": 1 } +o_createHDFTreatment_TouchRect = {"container": o_standByScreen_MainHome, "id": "_createHDFTreatment", "type": "TouchRect", "unnamed": 1 } +o_PreTreatmentCreate_hdfTreatmentMode_LabelUnitContainer = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_hdfTreatmentMode", "type": "LabelUnitContainer", "unnamed": 1 } +o_PreTreatmentCreate_treatmentModalityComboBox_BaseComboBox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_treatmentModalityComboBox", "type": "BaseComboBox", "unnamed": 1 } + Index: suite_leahi/suite.conf =================================================================== diff -u -r4b929ef6eef32479f10e84325b0ad12173474a4d -re82a2e9bb2d083c36604e19a090f8e620ad770fb --- suite_leahi/suite.conf (.../suite.conf) (revision 4b929ef6eef32479f10e84325b0ad12173474a4d) +++ suite_leahi/suite.conf (.../suite.conf) (revision e82a2e9bb2d083c36604e19a090f8e620ad770fb) @@ -1,6 +1,6 @@ AUT=leahi LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_solution_infusion tst_main_treatment tst_service_export_logs tst_device_settings_information_version tst_headerbar_information_popup tst_headerbar_wifi_indicator tst_device_settings_wifi tst_ultrafiltration tst_create_treatment tst_general_alarm_requirements_instruction tst_headerbar_prescription tst_heparin tst_pre_treatment_foundation tst_feature_options tst_end_of_treatment tst_service_institutional +TEST_CASES=tst_solution_infusion tst_main_treatment tst_service_export_logs tst_device_settings_information_version tst_headerbar_information_popup tst_headerbar_wifi_indicator tst_device_settings_wifi tst_ultrafiltration tst_create_treatment tst_general_alarm_requirements_instruction tst_headerbar_prescription tst_heparin tst_pre_treatment_foundation tst_feature_options tst_end_of_treatment tst_service_institutional tst_new_design_createrx VERSION=3 WRAPPERS=Qt 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() +