public void WhenIPrepareTheBatchForCommit() { BatchDialog.OpenTab("Main"); //Check is visible BaseComponent.GetEnabledElement("//button[contains(@class,' x-btn-text') and ./text()='Update projected totals']"); //Update projected totals Dialog.ClickButton("Update projected totals", null); BaseComponent.GetEnabledElement("//button[./text()='OK']"); Dialog.OK(); //Validate BatchDialog.Validate(); //Save and close BatchDialog.SaveAndClose(); }
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); }