public void WhenIAddABatchWithCheckTemplateAndDescriptionAndProjectedNumberAndProjectedAmount(string template, string description, string ProjectedNumber, string ProjectedAmount, Table batchRows) { try { description += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.BatchEntry(); //Open the batch entry page BatchEntryPanel.OpenTab("Uncommitted Batches"); // Open the Uncommitted Batches tab BatchEntryPanel.ClickSectionAddButton("Uncommitted batches", "Add"); // add an uncommitted batch Dialog.SetDropDown(Dialog.getXInput("Batch2AddForm", "BATCHTEMPLATEID"), template); // enter the template name Dialog.SetTextField(Dialog.getXTextArea("Batch2AddForm", "DESCRIPTION"), description); // enter the batch desx. Dialog.SetTextField("//input[contains(@id, '_PROJECTEDNUMBEROFRECORDS_value')]", ProjectedNumber); // add projected number of records Dialog.SetTextField("//input[contains(@id, '_PROJECTEDTOTALAMOUNT_value')]", ProjectedAmount); // add propected dollar amount Dialog.Save(); foreach (var batchRow in batchRows.Rows) { if (batchRow.Keys.Contains("Constituent") && batchRow["Constituent"] != null && batchRow["Constituent"] != string.Empty) { batchRow["Constituent"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } } EnhancedRevenueBatchDialog.SetGridRows(batchRows); EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals BatchDialog.Validate(); //click the validate button BatchDialog.SaveAndClose(); } catch (Exception ex) { throw new Exception("Error: could not add a batch with template and description. " + ex.Message); } }
public void WhenSaveTheBatchAndCommitIt(Table batch) { EnhancedRevenueBatchDialog.UpdateProjectedTotals(); BatchDialog.Validate(); BatchDialog.SaveAndClose(); WhenICommitTheBatch(batch); }
public void WhenIAddABatchWithTemplateAndDescription(string template, string description, Table batchRows) { try { description += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.BatchEntry(); //Open the batch entry page BatchEntryPanel.AddBatch(template, description); //add a new batch according to the template name and description foreach (var batchRow in batchRows.Rows) { if (batchRow.Keys.Contains("Constituent") && batchRow["Constituent"] != null && batchRow["Constituent"] != string.Empty) { batchRow["Constituent"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } } EnhancedRevenueBatchDialog.SetGridRows(batchRows); EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals BatchDialog.Validate(); //click the validate button BatchDialog.SaveAndClose(); } catch (Exception ex) { throw new Exception("Error: could not add a batch with template and description. " + ex.Message); } }
public void ThenTheCellValueIsForRow(string caption, string value, int rowNumber) { if (BatchDialog.GetGridCellValue(caption, rowNumber) != value) { throw new Exception(String.Format("Row '{0}', column '{1}' does not have the value '{2}'", rowNumber, caption, value)); } }
public void WhenEditTheSelectedConstituent(Table fieldMappings) { if (fieldMappings.RowCount != 1) { throw new ArgumentException("Only provide 1 row of field values"); } BatchDialog.EditConstituent(fieldMappings.Rows[0]); IndividualDialog.Save(); }
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 WhenSaveTheBatchAndCommitIt(Table batch) { try { Dialog.OpenTab("Main"); EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals BatchDialog.Validate(); //click the validate button BatchDialog.SaveAndClose(); WhenICommitTheBatch(batch); //commit the batch } catch (Exception ex) { throw new Exception("Error: could not save the batch and commit it. " + ex.Message); } }
public void WhenIStartToAddABatchWithTemplateAndDescription(string template, string description, Table batchRows) { description += uniqueStamp; BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.BatchEntry(); BatchEntryPanel.AddBatch(template, description); foreach (var batchRow in batchRows.Rows) { if (batchRow.Keys.Contains("Constituent") && batchRow["Constituent"] != null && batchRow["Constituent"] != string.Empty) { batchRow["Constituent"] += uniqueStamp; } } BatchDialog.SetGridRows(batchRows); EnhancedRevenueBatchDialog.UpdateProjectedTotals(); }
public void WhenIAddABatchWithTemplateAndDescription(string template, string description, Table batchRows) { description += uniqueStamp; BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.BatchEntry(); BatchEntryPanel.AddBatch(template, description); foreach (var batchRow in batchRows.Rows) { if (batchRow.Keys.Contains("Constituent") && batchRow["Constituent"] != null && batchRow["Constituent"] != string.Empty) { batchRow["Constituent"] += uniqueStamp; } } EnhancedRevenueBatchDialog.SetGridRows(batchRows); Dialog.WaitClick("//button[./text()='Update projected totals']"); Dialog.WaitClick("//button[./text()='OK']"); BatchDialog.Validate(); 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); }
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); } }
public void WhenSetTheRevenueTypeForRowTo(int rowIndex, string paymentMethod) { BatchDialog.SetGridCell("Revenue type", paymentMethod, rowIndex); }