public void WhenIAddConstituent(string lastName, Table batchRows) { try { if (lastName != "Testing") { lastName += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var batchRow = batchRows.Rows[0]; // select only the first row of the batch BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area ConstituentsFunctionalArea.AddAnIndividual(); IndividualDialog.SetLastName(lastName); IndividualDialog.SetIndividualFields(batchRow); IndividualDialog.ClickButton("Validate", 50); IndividualDialog.Save(); } catch (Exception ex) { throw new Exception("Error: could not add a constituent with the specified last name. " + ex.Message); } }
public void WhenIAddConstituent(Table batchRows) { try { BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area string lastName = ""; if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var batchRow = batchRows.Rows[0]; // select only the first row of the batch if (batchRow.Keys.Contains("Last name") && (!String.IsNullOrEmpty(batchRow["Last name"]))) { batchRow["Last name"] += uniqueStamp; lastName = batchRow["Last name"]; //Add an individual constituent ConstituentsFunctionalArea.AddAnIndividual(batchRow, timeout: 30); } } catch (Exception ex) { throw new Exception("Error: could not search for specified name. " + ex.Message); } }
public void GivenIAddOrganization(Table orgTable) { try { var organizationDialogId = "OrganizationAddForm"; if (orgTable.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var batchRow = orgTable.Rows[0]; // select only the first row of the batch // give the organization a unique name wih the stamp if (batchRow.Keys.Contains("Name") && (!String.IsNullOrEmpty(batchRow["Name"]))) { batchRow["Name"] += uniqueStamp; } BBCRMHomePage.OpenConstituentsFA(); //open the add org form ConstituentsFunctionalArea.OpenLink("Add an organization"); //fill in a couple of fields for the org Dialog.SetFields(organizationDialogId, batchRow, SupportedFields); } catch (Exception ex) { throw new Exception("Error: could not add an organization. " + ex.Message); } }
public void WhenIAddAPlanToAAProspectWithFundraiser(string prospectName, string fundraiserName, string planName) { try { prospectName += uniqueStamp; //The unique stamp is a series of numbers added to the end to keep names distinctive fundraiserName += uniqueStamp; //The unique stamp is a series of numbers added to the end to keep names distinctive planName += uniqueStamp; //The unique stamp is a series of numbers added to the end to keep names distinctive BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area SearchProspect(prospectName); //find the prospect ConstituentPanel.SelectTab("Prospect"); ConstituentPanel.SelectInnerTab("Plans"); // go to the plans tab for the prospect Panel.ClickSectionAddButton("Plans", "Add"); // click to add a plan string xLinkPath = "//a[contains(@id,'bbui-gen-tbaraction-')]/span[./text() = 'Add Prospect Plan']"; Panel.WaitClick(xLinkPath, 15); Dialog.OpenTab("Details"); //open the details tab // add plan name, plan type, start date and fundraiser data to the new plan Dialog.SetTextField("//input[contains(@id,'_PROSPECTPLAN_NAME_value')]", planName); Dialog.SetDropDown("//input[contains(@id,'_PROSPECTPLANTYPECODEID_value')]", "Annual Giving"); Dialog.SetTextField("//input[contains(@id,'_STARTDATE_value')]", DateTime.Today.ToShortDateString()); Dialog.SetSearchList(Dialog.getXInput("dataformdialog_", "_PRIMARYMANAGERFUNDRAISERID_value"), Dialog.getXInput("searchdialog", "_KEYNAME_value"), fundraiserName); } catch (Exception ex) { throw new Exception("Error: could not add a plan to a prospect. " + ex.Message); } }
public void WhenIGoToTheUNCChangeManagementPageForEditing(Table changeRows) { try { BBCRMHomePage.OpenConstituentsFA(); // open constituent functional area string xPathLink = "//button[contains(@class,'bui-linkbutton')]/div[text()='UNC Change Management']"; //click on the UNC Change Management Button ConstituentPanel.WaitClick(xPathLink); if (changeRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var changeRow = changeRows.Rows[0]; // select only the first row changeRow["Name"] = changeRow["Name"] + uniqueStamp; //Use the unique stamp at the end of the name //select the row for the particular constituent Panel.SelectSectionDatalistRow(changeRow, "Constituent Change Requests"); } catch (Exception ex) { throw new Exception("Error: could not go to the Change Management page for an edit address change request. " + ex.Message); } }
public void WhenIAddFriendConstituencyTo(string lastName, Table friends) { try { lastName += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area ConstituentsFunctionalArea.ConstituentSearch(lastName); // search by last name for a constituent string formName = "ConstituencyAddForm"; if (friends == null || friends.Rows.Count == 0) // if there is only one row { ConstituentPanel.AddConstituency("User-defined"); //click the user-defined link Dialog.OK(); Dialog.SetTextField(Dialog.getXInput(formName, "_CONSTITUENCYCODEID_value"), "Friend"); // ad a friend constituency } else { foreach (var friend in friends.Rows) //add the friend constituency to several { ConstituentPanel.AddConstituency("Friend", friend); } } } catch (Exception ex) { throw new Exception("Error: could not add the friend constituency. " + ex.Message); } }
public void WhenIAddIndividualWithAddress(Table table) { foreach (var individual in table.Rows) { individual["Last name"] = individual["Last name"] + uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); //ConstituentsFunctionalArea.AddAnIndividual(individual, groupCaption: "Add Records"); //select link to add constit Panel.WaitClick(VisiblePanel + "//button[not(contains(@class,'bbui-pages-actiongroup-tooltip-header'))]/div[./text()='Add an individual']"); //populate dialog Dialog.SetTextField("//input[contains(@id,'_LASTNAME_value')]", individual["Last name"]); Dialog.SetTextField("//input[contains(@id,'_FIRSTNAME_value')]", individual["First name"]); Dialog.SetTextField("//input[contains(@id,'_TITLECODEID_value')]", individual["Title"]); Dialog.SetTextField("//input[contains(@id,'_NICKNAME_value')]", individual["Nickname"]); Dialog.SetDropDown("//input[contains(@id,'_ADDRESS_INFOSOURCECODEID_value')]", individual["Information source"]); //address Dialog.SetTextField("//input[contains(@id,'_ADDRESS_ADDRESSTYPECODEID_value')]", individual["Address type"]); Dialog.SetTextField("//input[contains(@id,'_ADDRESS_COUNTRYID_value')]", individual["Country"]); Dialog.SetTextField("//textarea[contains(@id,'_ADDRESS_ADDRESSBLOCK_value')]", individual["Address"]); Dialog.SetTextField("//input[contains(@id,'_ADDRESS_CITY_value')]", individual["City"]); Dialog.SetTextField("//input[contains(@id,'_ADDRESS_STATEID_value')]", individual["State"]); Dialog.SetTextField("//input[contains(@id,'_ADDRESS_POSTCODE_value')]", individual["ZIP"]); //save dialog Dialog.Save(); //check the Constituents in question has been loaded string checkValue = individual["First name"] + " " + individual["Last name"]; Panel.GetEnabledElement(string.Format("//h2/span[contains(./text(),'{0}')]", checkValue), 15); } }
public void WhenIAddConstituent(string lastName) { lastName += uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.AddAnIndividual(); IndividualDialog.SetLastName(lastName); IndividualDialog.Save(); }
private void GetConstituentPanel(string lastName) { if (!ConstituentPanel.IsLastName(lastName)) { BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.ConstituentSearch(lastName); } }
public void WhenIGoToThePlanForProspect(string plan, string prospect) { prospect += uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.ConstituentSearch(prospect); plan += uniqueStamp; ConstituentPanel.GoToPlan(plan); }
public void WhenIAddIndividualSWithAddress(Table individualAddress) { foreach (TableRow individual in individualAddress.Rows) { individual["Last name"] = individual["Last name"] + uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.AddAnIndividual(individual, timeout: 120, constituentMatching: false); } }
private void GetConstituentPanel(string lastName) { if (!ConstituentPanel.IsLastName(lastName)) { BBCRMHomePage.OpenConstituentsFA(); //Open the Constituent Functional area ConstituentsFunctionalArea.ConstituentSearch(lastName); // search for the constituent using the last name } }
public void GivenFundraiserExists(string lastName) { lastName += uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.AddAnIndividual(); IndividualDialog.SetLastName(lastName); IndividualDialog.Save(); ConstituentPanel.AddConstituency("Fundraiser"); }
public void GivenIHaveSelectedTheConstituentSearchDialog() { BBCRMHomePage.OpenConstituentsFA(); // Or customise like this ... // BBCRMHomePage.OpenFunctionalArea("My custom Functional Area Caption"); ConstituentsFunctionalArea.OpenConstituentSearchDialog(); // Or customise like this ... //FunctionalArea.OpenLink("My custom link caption"); }
public void WhenIOpenAndRunTheReportFor(string reportName, string surname) { // find the constituent BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.OpenLink(reportName); SearchDialog.SetLastNameToSearch(surname + uniqueStamp); SearchDialog.Search(); SearchDialog.SelectFirstResult(); // run the report Panel.WaitClick("//button[./text()='View report']"); }
public void GivenConstituentExists(Table constituents) { foreach (var constituent in constituents.Rows) { if (constituent.ContainsKey("Last name") && !string.IsNullOrEmpty(constituent["Last name"])) { constituent["Last name"] += uniqueStamp; } BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.AddAnIndividual(constituent); } }
private void SearchAndSelectConstituent(string ConstituentName) { var names = new string[2]; names = ConstituentName.Split(' '); BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.OpenConstituentSearchDialog(); SearchDialog.SetFirstNameToSearch(names[0]); SearchDialog.SetLastNameToSearch(names[1] + uniqueStamp); SearchDialog.Search(); SearchDialog.SelectFirstResult(); }
private void GetConstituentPanel(string lastName) { if (!ConstituentPanel.IsLastName(lastName)) { BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.ConstituentSearch(lastName); } //if (!Panel.IsPanelType("individual") || !ConstituentPanel.IsConstituentPanelHeader(lastName)) //{ // BBCRMHomePage.OpenConstituentsFA(); // ConstituentsFunctionalArea.ConstituentSearch(lastName); //} }
public void GivenIStartAnAddChangeRequestForConstituent() { try { BBCRMHomePage.OpenConstituentsFA(); // open the constituent functional area //click on the link to open form to add a new individual by request ConstituentPanel.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='UNC Request Add a New Individual']", 10); } catch (Exception ex) { throw new Exception("Error: could not start a change request. " + ex.Message); } }
private void GetConstituentPanel(string lastName) { try { if (!ConstituentPanel.IsLastName(lastName)) { BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area ConstituentsFunctionalArea.ConstituentSearch(lastName); // search by last name for a constituent } } catch (Exception ex) { throw new Exception("Error: could not open the constituent panel. " + ex.Message); } }
public void GivenStaffConstituentExists(string lastName) { try { lastName += uniqueStamp; // the unique stamp is a series of numbers to keep names different from each other BBCRMHomePage.OpenConstituentsFA(); // open the constituents functional area ConstituentsFunctionalArea.AddAnIndividual(); // add a new constituent IndividualDialog.SetLastName(lastName); IndividualDialog.Save(); ConstituentPanel.AddConstituency("Staff"); // add the staff constituency } catch (Exception ex) { throw new Exception("Error: Could not add a staff constituency. " + ex.Message); } }
public void GivenFundraiserExists(string lastName) { try { lastName += uniqueStamp; //The unique stamp is a series of numbers added to the end to keep names distinctive BBCRMHomePage.OpenConstituentsFA(); //Open the Constituent Functional area ConstituentsFunctionalArea.AddAnIndividual(); // add a constituent IndividualDialog.SetLastName(lastName); // enter the last name IndividualDialog.Save(); ConstituentPanel.AddConstituency("Fundraiser"); // add the fundrasiser constituency } catch (Exception ex) { throw new Exception("Error: could not add a fundraiser. " + 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 GivenConstituentExists(Table constituents) { try { //find each constituent in a batch and add the unique stamp to the last name foreach (var constituent in constituents.Rows) { if (constituent.ContainsKey("Last name") && !string.IsNullOrEmpty(constituent["Last name"])) { constituent["Last name"] += uniqueStamp; } BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area ConstituentsFunctionalArea.AddAnIndividual(constituent, timeout: 30); } } catch (Exception ex) { throw new Exception("Error: could not find the given constituent. " + ex.Message); } }
public static void SearchAndSelectConstituent(string ConstituentName, bool SplitName) { BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.OpenConstituentSearchDialog(); if (SplitName) { var names = new string[2]; names = ConstituentName.Split(' '); SearchDialog.SetFirstNameToSearch(names[0]); SearchDialog.SetLastNameToSearch(names[1] + uniqueStamp); } else { SearchDialog.SetLastNameToSearch(ConstituentName + uniqueStamp); } SearchDialog.Search(); SearchDialog.SelectFirstResult(); }
public static void SearchAndSelectConstituent(string constituentName, bool splitName) { BaseComponent.GetEnabledElement("//button[./text()='Constituents']"); BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.OpenConstituentSearchDialog(); if (splitName) { var names = new string[2]; names = constituentName.Split(' '); SearchDialog.SetFirstNameToSearch(names[0]); SearchDialog.SetLastNameToSearch(names[1] + uniqueStamp); } else { SearchDialog.SetLastNameToSearch(constituentName + uniqueStamp); } SearchDialog.Search(); SearchDialog.SelectFirstResult(); }
public void ThenConstituentHasTheTitleBirthDateAndStateAddress(string constituent, string title, string birthDate, string state) { constituent += uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.ConstituentSearch(constituent); if (!ConstituentPanel.IsTitle(title)) { throw new ArgumentException(String.Format("'{0}' is not the constituent's title.", title)); } if (!ConstituentPanel.IsBirthDate(birthDate)) { throw new ArgumentException(String.Format("'{0}' is not the constituent's birth date.", birthDate)); } if (!ConstituentPanel.IsStateAddress(state)) { throw new ArgumentException(String.Format("'{0}' is not the constituent's state address.", state)); } }
public void GivenIAddOrganizationS(Table table) { dynamic objectData = table.CreateDynamicInstance(); objectData.Name += uniqueStamp; var organizationDialogId = "OrganizationAddForm"; //fields for add an organization IDictionary <string, CrmField> SupportedFields = new Dictionary <string, CrmField> { { "Name", new CrmField("_NAME_value", FieldType.TextInput) }, { "Industry", new CrmField("_INDUSTRYCODEID_value", FieldType.Dropdown) } }; //navigate to Constituents > Add organization BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.OpenLink("Add an organization"); //set fields Dialog.SetField(organizationDialogId, "Name", objectData.Name, SupportedFields); Dialog.SetField(organizationDialogId, "Industry", objectData.Industry, SupportedFields); Dialog.Save(); }
public void WhenIAddSpouse(string lastName, Table batchRows) { try { lastName += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var batchRow = batchRows.Rows[0]; // select only the first row of the batch BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area ConstituentsFunctionalArea.AddAnIndividual(); // add an individual IndividualDialog.SetLastName(lastName); IndividualDialog.SetIndividualFields(batchRow); //set the individual's fields according to the batch parameter IndividualDialog.ClickButton("Validate", 50); //validate the address } catch (Exception ex) { throw new Exception("Error: could not add a spouse. " + ex.Message); } }
public void GivenProspectIsAssociatedWithMajorGivingPlan(string prospect, Table plans) { prospect += uniqueStamp; BBCRMHomePage.OpenConstituentsFA(); ConstituentsFunctionalArea.ConstituentSearch(prospect); foreach (var plan in plans.Rows) { if (plan.ContainsKey("Plan name") && !string.IsNullOrEmpty(plan["Plan name"])) { plan["Plan name"] += uniqueStamp; } if (plan.ContainsKey("Outlines")) { var outline = plan["Outlines"]; plan["Outlines"] = null; ConstituentPanel.AddMajorGivingPlan(plan, outline); } else { ConstituentPanel.AddMajorGivingPlan(plan, string.Empty); } } }