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 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 WhenISearchForTheTransaction(Table table) { #region data setup //setup date field. StepHelper for date must come before dynamic objects StepHelper.SetTodayDateInTableRow("Date", table); dynamic objectData = table.CreateDynamicInstance(); var dialogId = "TransactionSearch"; string groupCaption = "Transactions"; string taskCaption = "Transaction search"; string transactionType = objectData.TransactionType; objectData.LastName += uniqueStamp; //sorts out date format due to datetime adding 00:00:00 DateTime findDate = objectData.Date; //set fields for Transaction search fields on form IDictionary <string, CrmField> SupportedFields = new Dictionary <string, CrmField> { { "Last/Org/Group name", new CrmField("_KEYNAME_value", FieldType.TextInput) }, { "Transaction type", new CrmField("_TRANSACTIONTYPE_value", FieldType.Dropdown) } }; #endregion //search for pledge transaction BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.OpenLink(groupCaption, taskCaption); BaseComponent.GetEnabledElement("//div[contains(@id,'searchdialog') and contains(@style,'visible')]//span[text()='Transaction Search']", 30); //Set search fields Dialog.SetField(dialogId, "Last/Org/Group name", objectData.LastName, SupportedFields); Dialog.SetField(dialogId, "Transaction type", transactionType, SupportedFields); //Click Search and select first result SearchDialog.Search(); SearchDialog.SelectFirstResult(); switch (transactionType.ToLower()) { case "payment": string paymentName = string.Format("{0} Payment: {1}", findDate.ToShortDateString(), objectData.Amount); BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", paymentName), 15); break; case "pledge": string pledgeName = string.Format("{0} Pledge: {1}", findDate.ToShortDateString(), objectData.Amount); BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", pledgeName), 15); break; case "recurring gift": string RecurringGiftName = string.Empty; if (objectData.SpecificType == "Sponsorship") { RecurringGiftName = string.Format("{0} Sponsorship recurring gift: {1}", findDate.ToShortDateString(), objectData.Amount); } else { RecurringGiftName = string.Format("{0} Recurring gift: {1}", findDate.ToShortDateString(), objectData.Amount); } BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[./text()='{0}']", RecurringGiftName), 15); break; default: FailTest(string.Format("Test failed checking transaction {0}.", transactionType)); break; } }
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 GivenThePledgeSubtypeExists(string subtype) { BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.PledgeSubtypes(); if (!PledgeSubtypePanel.SubtypeExists(subtype)) { PledgeSubtypePanel.AddSubtype(subtype, false); } }
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 WhenNavigateToTheRevenueRecordFor(string constituent) { try { constituent += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.TransactionSearchByConstituent(constituent); //search for transactions by constituent } catch (Exception ex) { throw new Exception("Error: could not navigate to the revenue record for selected constituent. " + ex.Message); } }
public void WhenIStartToAddAPledge(Table pledgeValues) { BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.AddAPledge(); foreach (var pledgeValueRow in pledgeValues.Rows) { if (pledgeValueRow.ContainsKey("Constituent") && pledgeValueRow["Constituent"] != string.Empty) { pledgeValueRow["Constituent"] += uniqueStamp; } PledgeDialog.SetFields(pledgeValueRow); } }
public void WhenIAddAPledge(Table pledges) { foreach (var pledge in pledges.Rows) { BBCRMHomePage.OpenRevenueFA(); if (pledge.ContainsKey("Constituent") && pledge["Constituent"] != string.Empty) { pledge["Constituent"] += uniqueStamp; } RevenueFunctionalArea.AddAPledge(pledge); Dialog.Save(); } }
public void GivenIStartToAddAPayment(Table paymentFieldRows) { BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.AddAPayment(); foreach (var paymentFieldValues in paymentFieldRows.Rows) { if (paymentFieldValues.ContainsKey("Constituent") && paymentFieldValues["Constituent"] != string.Empty) { paymentFieldValues["Constituent"] += uniqueStamp; } PaymentDialog.SetFields(paymentFieldValues); } }
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 GivenOpenTheFunctionalArea(string areaName) { if (areaName == "Constituent") { BBCRMHomePage.OpenConstituentsFA(); //Open constituents functional area } if (areaName == "Revenue") { BBCRMHomePage.OpenRevenueFA(); // open revenue functional area } if (areaName == "Analysis") { BBCRMHomePage.OpenAnalysisFA(); // open analysis functional area //Open prospect management reports Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='" + "Prospect management reports" + "']", 10); } }
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 WhenIStartToAddAPledge(Table pledgeValues) { try { BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.AddAPledge(); //create a new pledge foreach (var pledgeValueRow in pledgeValues.Rows) { if (pledgeValueRow.ContainsKey("Constituent") && pledgeValueRow["Constituent"] != string.Empty) { pledgeValueRow["Constituent"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } PledgeDialog.SetFields(pledgeValueRow); } } catch (Exception ex) { throw new Exception("Error: could not start to add a pledge. " + ex.Message); } }
public void GivenIStartToAddAPayment(Table paymentFieldRows) { try { BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area RevenueFunctionalArea.AddAPayment(); // add a payment foreach (var paymentFieldValues in paymentFieldRows.Rows) { if (paymentFieldValues.ContainsKey("Constituent") && paymentFieldValues["Constituent"] != string.Empty) { paymentFieldValues["Constituent"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } PaymentDialog.SetFields(paymentFieldValues); //set the fields in the payment according to the table parameter } } catch (Exception ex) { throw new Exception("Error: could not start to add a payment. " + ex.Message); } }
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); }
public void WhenIAddAPledge(Table pledges) { try { foreach (var pledge in pledges.Rows) { BBCRMHomePage.OpenRevenueFA(); //Open revenue functional area if (pledge.ContainsKey("Constituent") && pledge["Constituent"] != string.Empty) { pledge["Constituent"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } //add and save a pledge RevenueFunctionalArea.AddAPledge(pledge); //add a pledge Dialog.Save(); //save the pledge } } catch (Exception ex) { throw new Exception("Error: could not add a pledge. " + ex.Message); } }
public void WhenNavigateToTheRevenueRecordFor(string constituent) { constituent += uniqueStamp; BBCRMHomePage.OpenRevenueFA(); RevenueFunctionalArea.TransactionSearchByConstituent(constituent); }