public void WhenIStartToAddABatchWithTemplateAndDescription(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(); 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); // ThenIAddBatchAmounts(100); EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals } catch (Exception ex) { throw new Exception("Error: could not add a batch with specified template and description. " + ex.Message); } }
public void WhenICommitTheBatch(Table batchRows) { try { if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.BatchEntry(); var batchRow = batchRows.Rows[0]; // select only the first row of the batch if (batchRow.ContainsKey("Description") && batchRow["Description"] != null && batchRow["Description"] != string.Empty) { batchRow["Description"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } BatchEntryPanel.SelectUncommittedBatch(batchRow); //select uncommitted batch according to the table parameter if (BatchEntryPanel.UncommittedBatchExists(batchRow)) // if the selected batch exists { System.Threading.Thread.Sleep(2000); //pause because otherwise the code runs so rapidly that the next line is not invoked in time BatchEntryPanel.SelectSectionDatalistRow(batchRow, "Uncommitted batches"); BatchEntryPanel.CommitSelectedBatch(); //commit the batch } else { throw new ArgumentException(String.Format("Uncommitted batch '{0}' does not exist", batchRow.Values)); } } catch (Exception ex) { throw new Exception("Error: could not commit the batch. " + ex.Message); } }
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 WhenICommitTheBatch(Table batchRows) { if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.BatchEntry(); // reset datalist, if needed string resetButtonPath = XpathHelper.xPath.VisiblePanel + "//button[text()='Reset']"; // ensure that we can find the either enabled or disabled reset button try { BaseComponent.GetEnabledElement(resetButtonPath, 5); BaseComponent.WaitClick(resetButtonPath); } catch { // eat the exception } //clear filters button string clearFiltersPath = XpathHelper.xPath.VisiblePanel + "//button[text()='Clear all filters']"; // Click on the button if it is enabled try { BaseComponent.GetEnabledElement(clearFiltersPath, 5); BaseComponent.WaitClick(clearFiltersPath); } catch { //eat exception as button is not enabled } var batchRow = batchRows.Rows[0]; if (batchRow.ContainsKey("Description") && !string.IsNullOrEmpty(batchRow["Description"])) { batchRow["Description"] += uniqueStamp; } try { BatchEntryPanel.SelectUncommittedBatch(batchRow); } catch { BatchEntryPanel.SelectUncommittedBatch(batchRow); } BatchEntryPanel.CommitSelectedBatch(); ThenTheBatchCommitsWithoutErrorsOrExceptions(); }
public void WhenIStartToAddABatchWithTemplateAndDescriptionforAPledge(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(); 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"].ToString() != "Testmatchingcompany" && 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); if (template == "DEV-Check-MG Payments") { Dialog.Cancel(); // cancel the unneeded popup } EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals EnhancedRevenueBatchDialog.Validate(); //validate batch EnhancedRevenueBatchDialog.ClickButton("Update status", 50); // update the batch status EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_NEXTBATCHWORKFLOWTASKID_value')]", "Validate Data Totals and Other Information"); EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_OWNERID_value')]", "ad\\bbtest1.gst"); Dialog.WaitClick("//div[contains(@id,'dataformdialog_')]//button[text()='Save']", 20); //save the batch EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals EnhancedRevenueBatchDialog.Validate(); //validate the batch EnhancedRevenueBatchDialog.ClickButton("Update status", 20); //update the status EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_NEXTBATCHWORKFLOWTASKID_value')]", "Special Review"); EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_OWNERID_value')]", "ad\\bbtest1.gst"); Dialog.WaitClick("//div[contains(@id,'dataformdialog_')]//button[text()='Save']", 20); //save the batch EnhancedRevenueBatchDialog.UpdateProjectedTotals(); //click on the update projected totals button and receive updated totals EnhancedRevenueBatchDialog.Validate(); //validate the batch EnhancedRevenueBatchDialog.ClickButton("Update status", 20); //update the status EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_NEXTBATCHWORKFLOWTASKID_value')]", "Commit Batch"); EnhancedRevenueBatchDialog.SetDropDown("//input[contains(@id, '_OWNERID_value')]", "ad\\bbtest1.gst"); Dialog.WaitClick("//div[contains(@id,'dataformdialog_')]//button[text()='Save']", 20); //save the batch EnhancedRevenueBatchDialog.SaveAndClose(); } catch (Exception ex) { throw new Exception("Error: could not add a batch with specified template and description for a pledge. " + 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 WhenICommitTheBatch(Table batchRows) { if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.BatchEntry(); var batchRow = batchRows.Rows[0]; if (batchRow.ContainsKey("Description") && batchRow["Description"] != null && batchRow["Description"] != string.Empty) { batchRow["Description"] += uniqueStamp; } BatchEntryPanel.SelectUncommittedBatch(batchRow); BatchEntryPanel.CommitSelectedBatch(); }
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 WhenIAddABatchWithTemplateAndDescription(string template, string description, Table batchRows) { description += uniqueStamp; StepHelper.SetTodayDateInTableRow("Date", batchRows); StepHelper.SetTodayDateInTableRow("Installment start date", batchRows); BBCRMHomePage.OpenRevenueFA(); BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + "//span[text()='Revenue']"); RevenueFunctionalArea.BatchEntry(); BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + "//span[text()='Batch Entry']"); 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; } } //Set fields in batch SetGridRows(batchRows); }