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 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 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);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
 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 WhenIAddConstituent(string lastName)
 {
     lastName += uniqueStamp;
     BBCRMHomePage.OpenConstituentsFA();
     ConstituentsFunctionalArea.AddAnIndividual();
     IndividualDialog.SetLastName(lastName);
     IndividualDialog.Save();
 }
Example #8
0
 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");
 }
Example #11
0
        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");
        }
Example #12
0
 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);
     }
 }
Example #14
0
        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);
     //}
 }
 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 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 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);
     }
 }
Example #19
0
        private void AddOrganization(string organizationName)
        {
            try
            {
                // add an organization with the org. name given
                ConstituentsFunctionalArea.AddAnIndividual("Organizations", "Add an organization");

                Dialog.SetTextField("//div[contains(@id, '_OrganizationAddForm')]//input[contains(@id,'_NAME_value')]", organizationName);
                Dialog.SetDropDown("//div[contains(@id, '_OrganizationAddForm')]//input[contains(@id,'_INDUSTRYCODEID_value')]", "Foundation");
                Dialog.SetTextField("//div[contains(@id, '_OrganizationAddForm')]//input[contains(@id,'_PHONE_PHONETYPECODEID_value')]", "Business");
                Dialog.SetTextField("//div[contains(@id, '_OrganizationAddForm')]//input[contains(@id,'_PHONE_NUMBER_value')]", "1 (111) 111-1111");
                Dialog.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not enter fields for a test organization. " + ex.Message);
            }
        }
 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();
    }
Example #22
0
        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));
     }
 }
Example #24
0
        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);
         }
     }
 }
 public void WhenIAddConstituent(string lastName)
 {
     try
     {
         if (lastName != "Testing")
         {
             //add the constituent with the specified last name
             lastName += uniqueStamp;        //The unique stamp is a series of numbers to keep constituents different from each other
         }
         BBCRMHomePage.OpenConstituentsFA(); //Open constituent functional area
         // add an individual with the last name given
         ConstituentsFunctionalArea.AddAnIndividual();
         IndividualDialog.SetLastName(lastName);
         IndividualDialog.SetDropDown("//input[contains(@id,'_EMAILADDRESS_EMAILADDRESSTYPECODEID_value')]", "Business");
         IndividualDialog.SetTextField("//input[contains(@id,'_EMAILADDRESS_EMAILADDRESS_value')]", "*****@*****.**");
         IndividualDialog.SetTextField("//input[contains(@id,'_BIRTHDATE_value')]", "11/18/1952");
         IndividualDialog.Save();
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not add constituent with the specified last name. " + ex.Message);
     }
 }
Example #28
0
        public void WhenIAddTestConstituentLastname(string firstName, string lastName, Table batchRows)
        {
            try
            {
                string fullName = lastName + ", " + firstName;
                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.OpenConstituentSearchDialog();
                SearchDialog.SetLastNameToSearch(lastName);
                SearchDialog.SetFirstNameToSearch(firstName);
                SearchDialog.Search();
                try
                {
                    SearchDialog.CheckConstituentSearchResultsContain(fullName);
                    SearchDialog.SelectFirstResult();
                }
                catch
                {
                    Dialog.Cancel();
                    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 GivenProspectExists(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.SetTextField("//input[contains(@id,'_EMAILADDRESS_EMAILADDRESS_value')]", "*****@*****.**");
                IndividualDialog.SetTextField("//input[contains(@id,'_BIRTHDATE_value')]", "12/10/1952");
                IndividualDialog.Save();

                BBCRMHomePage.OpenProspectsFA();  // open the prospect functional area
                //click on the link to create a prospect from a constituent
                Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='Add a Prospect']", 15);
                // add prospect status for the constituent
                Dialog.SetSearchList(Dialog.getXInput("ProspectWithoutConstituentAddForm", "_PROSPECTID_value"), Dialog.getXInput("NonProspectSearch", "_KEYNAME_value"), lastName);
                Dialog.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not determine that the given prospect exists. " + ex.Message);
            }
        }
 public void GivenIHaveOpenedTheConstituentSearchDialog()
 {
     //start a constituent search by opening the search dialog
     BBCRMHomePage.OpenConstituentsFA();  //Open constituent functional area
     ConstituentsFunctionalArea.OpenConstituentSearchDialog();
 }