Exemplo n.º 1
0
        public void WhenILoadCommitmentsForConstituentAndApplyAmountOf(string constituentName, string amount)
        {
            string applyCommitments = "BatchRevenueApplyCommitmentsCustom";

            //navigate to Revenue tab > Apply
            BatchDialog.OpenTab("Revenue");
            BatchDialog.ClickButton("Apply", applyCommitments);
            //Click Load commitments
            BatchDialog.ClickButton("Load commitments", applyCommitments);
            //search for and select constituent
            //TODO - need to refactor this bit of code for searching and selecting a constituent
            string[] names = constituentName.Split(' ');
            Dialog.SetTextField("//div[contains(@id,'searchdialog') and contains(@style,'visible')]//input[contains(@id,'_KEYNAME_value')]", names[1] + uniqueStamp);
            Dialog.SetTextField("//div[contains(@id,'searchdialog') and contains(@style,'visible')]//input[contains(@id,'_FIRSTNAME_value')]", names[0]);
            SearchDialog.Search();
            SearchDialog.Select();
            //Click Auto apply
            BatchDialog.ClickButton("Auto apply", applyCommitments);
            //Check if visible and click ok
            BaseComponent.GetEnabledElement(string.Format(("//td[contains(@class,'x-grid3-col x-grid3-cell x-grid3-td-APPLIED')]/div[text()='{0}']"), Convert.ToString(amount)));
            BatchDialog.ClickButton("OK", applyCommitments);
        }
Exemplo n.º 2
0
        public void WhenIAddAdditionalApplications(Table table)
        {
            //check is visible
            BaseComponent.GetEnabledElement("//label[contains(@id, '_AMOUNT_caption')]");
            IList <dynamic> objectData = table.CreateDynamicSet().ToList();
            string          dialogId   = "BatchRevenueApplyCommitmentsCustom";
            string          gridId     = "_ADDITIONALAPPLICATIONSSTREAM";
            int             i          = 1;

            foreach (dynamic application in objectData)
            {
                //Add additional application
                string gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Additional applications"));
                Dialog.SetGridDropDown(gridXPath, application.AdditionalApplications);
                //Add applied amount
                gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Applied amount"));
                Dialog.SetGridTextField(gridXPath, application.AppliedAmount);
                //Add designation
                gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Designation"));
                Dialog.SetGridTextField(gridXPath, application.Designation);
                //Click Ok
                BatchDialog.ClickButton("OK", dialogId);
            }
        }