コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        public void GivenMarketingExportDefinitionsExists(string ExportName)
        {
            //in this instance we cannot use the default XpathHelper one
            var visibleDialog = "//div[contains(@class,'x-window x-resizable-pinned') and contains(@style,'visible')]";

            ExportName += uniqueStamp;
            //navigate
            BBCRMHomePage.OpenMarketingAndCommunicationsFA();
            MarketingAndCommFunctionalArea.OpenLink("Packages", "Export definitions");
            BaseComponent.GetEnabledElement(
                "//div[contains(@class,'xtb-text bbui-pages-section-tbarcaption') and ./text()='Marketing export definitions']");
            //click Add
            Panel.ClickSectionAddButton("Marketing export definitions");
            BaseComponent.WaitClick(
                "//div[contains(@class, 'x-menu x-menu-floating x-layer') and contains(@style, 'visible')]//span[./text()='Direct marketing']");
            //click save tab
            Dialog.WaitClick("//span[contains(@class,'x-tab-strip-text') and ./text()='Set save options']");
            //set name field
            ExportDefinitionDialog.SetTextField(visibleDialog + "//input[contains(@id,'_NAME_value')]", ExportName);
            //give the "save and close" button validation time to catch up
            ExportDefinitionDialog.SetTextField(visibleDialog + "//textarea[contains(@id,'_DESCRIPTION_value')]", ExportName);
            ExportDefinitionDialog.SetTextField(visibleDialog + "//textarea[contains(@id,'_DESCRIPTION_value')]", ExportName);
            ExportDefinitionDialog.SetTextField(visibleDialog + "//textarea[contains(@id,'_DESCRIPTION_value')]", ExportName);
            ExportDefinitionDialog.SaveAndClose();
        }
コード例 #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);
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        public void GivenAStaticSelectionCopyOfQueryExists(string selection, string query)
        {
            BBCRMHomePage.OpenAnalysisFA();
            AnalysisFunctionalArea.InformationLibrary();

            IDictionary <string, string> queryRow = new Dictionary <string, string> {
                { "Name", query }
            };

            if (!InformationLibraryPanel.QueryExists(queryRow))
            {
                CreateUnacknowledgedRevenueSelection(query);
            }

            IDictionary <string, string> selectionRow = new Dictionary <string, string> {
                { "Name", selection }
            };

            if (InformationLibraryPanel.QueryExists(selectionRow))
            {
                InformationLibraryPanel.DeleteQuery(selectionRow);
                //re-nvaigate should not be necessary.  only done due to filed bug 490200
                BBCRMHomePage.OpenAnalysisFA();
                AnalysisFunctionalArea.InformationLibrary();
            }

            InformationLibraryPanel.CopyQueryAsStaticSelection(selection, queryRow);
        }
コード例 #7
0
ファイル: BatchSteps.cs プロジェクト: blackbaud/uat-kit
        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;
            }
        }
コード例 #8
0
        public void WhenIAddAd_HocQueryType(string queryType)
        {
            try
            {
                BBCRMHomePage.OpenAnalysisFA();               //open the analysis functional area
                AnalysisFunctionalArea.InformationLibrary();  //open the information library
                InformationLibraryPanel.SelectTab("Queries"); //Select the queries tab

                string querystring = "//div/table/tbody/tr//td/table/tbody/tr//td/div/../..//td/table/tbody/tr/td/em/button[./text() = 'Add an ad-hoc query']";

                InformationLibraryPanel.WaitClick(querystring, 10);                                       //click on the "ad-hoc query" button

                Dialog.SetDropDown(Dialog.getXInput("AdHocQueryNewForm", "RECORDTYPE_value"), queryType); //start the adhoc query for the selected querytype
                string gridRowXPath = "";

                if (queryType == "Constituent")
                {
                    //Fundraisers
                    gridRowXPath = "//div[contains(@id,'AdHocQueryNewForm')]//div[contains(@id, 'GROUPTYPE-Constituent-bd')]/div[3]/table";
                }
                else if (queryType == "Revenue")
                {
                    gridRowXPath = "//div[contains(@id,'AdHocQueryNewForm')]//div[contains(@id, 'GROUPTYPE-Revenue-bd')]/div[2]/table";
                }
                InformationLibraryPanel.WaitClick(gridRowXPath, 20); //click on that row
                InformationLibraryPanel.WaitClick(Dialog.getXOKButton, 20);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not add an adhoc query. " + ex.Message);
            }
        }
コード例 #9
0
 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);
     }
 }
コード例 #10
0
        public void GivenSearchForEvent(string eventName)
        {
            try
            {
                BBCRMHomePage.OpenEventsFA();                // open event functional area
                EventsFunctionalArea.EventSearch(eventName); // search for an event
                EventPanel.OpenTab("Registrations");
                String xRegistrantName = "//input[contains(@id,'_CONSTITUENTNAME_value')]";
                Panel.SetTextField(xRegistrantName, "Crispin"); // search for the Kelli Crispin registrant with the "Crispin" char string
                Panel.GetDisplayedElement(xRegistrantName).SendKeys(Keys.Enter);
                string xSelectedRow;
                xSelectedRow = "//div[contains(@id,'ext-gen')]/div/table/tbody/tr[1]/td[4]/div/a";
                Dialog.WaitClick(xSelectedRow, 15);

                //click on the link to remove a registrant
                Dialog.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='Delete registrant']", 10);
                //click on the link to remove a spouse

                Dialog.Yes();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not search for the event. " + ex.Message);
            }
        }
コード例 #11
0
 public void GivenIHaveLoggedIntoTheBBCRMHomePage()
 {
     //Go to the home page
     // OpenQA.Selenium.IWebDriver driver = BBCRMHomePage.Driver;
     BBCRMHomePage.Login();
     UserAccount = GetUserAccount();
 }
コード例 #12
0
        public void GivenStartImportOfRegistrants(Table registrants)
        {
            try
            {
                string getXSearchInput = "//div[contains(@class,'bbui-pages-contentcontainer') and not(contains(@class,'hide'))]//input[@placeholder='Search']";
                BBCRMHomePage.OpenFunctionalArea("Administration"); //open the admin functional area
                Dialog.WaitClick("//div[contains(h3,'Tools')]//button[contains(@class,'linkbutton')]/div[text()='Import']", 15);

                var registrant = registrants.Rows[0];
                if (registrant.ContainsKey("Name") && !String.IsNullOrEmpty(registrant["Name"]))
                {
                    Dialog.SetTextField(getXSearchInput, registrant["Name"]);
                    Dialog.GetDisplayedElement(getXSearchInput).SendKeys(Keys.Tab);
                }
                System.Threading.Thread.Sleep(4000); //pause because otherwise the code runs so rapidly that the next line is not invoked in time
                string xSelectedRow = "//div[contains(@id,'bbui-gen-pagecontainer')]//div[contains(@id, '')]//div[@class='x-grid3-body']/div[1]//td[2]";
                xSelectedRow = "//div[contains(@id,'ext-gen')]/div/table/tbody/tr[1]/td[3]/div/a";
                // Dialog.WaitClick(Dialog.getXGridRowSelector("bbui-gen-pagecontainer", "", 1), 6);  //click on the selected row
                Dialog.WaitClick(xSelectedRow, 15);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not start the import of registrants. " + ex.Message);
            }
        }
コード例 #13
0
        public void WhenICreateAnInvitation(string eventName)
        {
            string invitationName;
            string xTab;

            eventName += uniqueStamp;
            BBCRMHomePage.OpenEventsFA();

            EventsFunctionalArea.EventSearch(eventName);  //search for an event
            invitationName = "Inv" + eventName;
            string caption = "General";

            EventPanel.OpenTab("Invitations");               //open the invitations tab
            EventPanel.ClickSectionAddButton("Invitations"); // add an invitation
            xTab = getXInnerTab(caption);
            EventPanel.getXTab(xTab);

            string xEmailString;

            xEmailString = Dialog.getXInput("InvitationAddForm", "_NAME_value");
            xTab         = getXInnerTab(caption);
            Dialog.WaitClick(xTab, 10);                                                                           //open the general subtab in the popup
            Dialog.SetTextField(xEmailString, invitationName);                                                    // enter the invitation name
            Dialog.SetTextField("//input[contains(@id, '_MAILDATE_value')]", DateTime.Today.ToShortDateString()); //add in the date
            xEmailString = Dialog.getXInput("PackageSearch", "_NAME_value");

            caption = "Processing Options";
            xTab    = getXInnerTab(caption);
            Dialog.WaitClick(xTab, 10);
            Dialog.SetCheckbox("//input[contains(@id, '_CHANNELCODE_1')]", true);  //set the "send through email" radio button to true
            // enter email package name
            Dialog.SetSearchList(Dialog.getXInput("InvitationAddForm", "_EMAILPACKAGEID_value"), xEmailString, "UDO FY16 Carolina Connection Email Package");
            Dialog.Save();
        }
コード例 #14
0
        public void WhenIAddRegistrantToEvent(string registrant, string eventName, Table registrations)
        {
            try
            {
                registrant += uniqueStamp;                   // the unique stamp is a series of numbers to keep names different from each other
                eventName  += uniqueStamp;                   // the unique stamp is a series of numbers to keep names different from each other
                BBCRMHomePage.OpenEventsFA();                // open event functional area
                Panel.CollapseSection("Event calendar", "CalendarViewForm");
                EventsFunctionalArea.EventSearch(eventName); // search for an event
                EventPanel.AddRegistrant();
                RegistrantDialog.SetRegistrant(registrant);

                foreach (var registrantRow in registrations.Rows)  // find all the registrants in the table
                {
                    if (registrantRow.ContainsKey("Registrant") && !string.IsNullOrEmpty(registrantRow["Registrant"]) &&
                        registrantRow["Registrant"] != "(Unnamed guest)")
                    {
                        registrantRow["Registrant"] += uniqueStamp;                                                        // the unique stamp is a series of numbers to keep names different from each other
                    }
                }

                RegistrantDialog.SetRegistrants(registrations);
                Dialog.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not add a registrant to an event. " + ex.Message);
            }
        }
コード例 #15
0
        public void WhenICreateAMarketingEffort(string marketingName)
        {
            try
            {
                marketingName += uniqueStamp;                            //The unique stamp is a series of numbers to keep names different from each other
                BBCRMHomePage.OpenMarketingAndCommunicationsFA();        //Open marketing functional area
                string xPathLink = "//div[contains(@class,'bbui-pages-contentcontainer') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'bui-linkbutton')]/div[text()='Direct marketing efforts']";
                Panel.WaitClick(xPathLink, 50);                          // click on the Direct Marketing Efforts link
                Panel.ClickSectionAddButton("Direct marketing efforts"); // click on Direct marketing effots link
                string xPath = "//div[contains(@id,'_TEMPLATES_value')]//div[text()='ACK FYXX E-Mail Marketing Effort Template']";
                Dialog.WaitClick(xPath, 45);                             // select the template: 'ACK FYXX E-Mail Marketing Effort Template'
                Dialog.ClickButton("Next", 30);

                //input values into the create effort fields
                Dialog.SetTextField("//input[contains(@id,'_FREEFORMPART_value')]", marketingName);
                Dialog.SetTextField("//textarea[contains(@id,'_EFFORTDESCRIPTION_value')]", "Test Desc");
                Dialog.SetTextField("//input[contains(@id,'EFFORTSITEID_value')]", "Ackland Art Museum");
                Dialog.SetSearchList(Dialog.getXInput("_CREATEEFFORTTAB_caption_tab", "_INDIVIDUALAPPEAL_value"), Dialog.getXInput("_AppealSearch", "_NAME_value"), "17Y - 1/12 Appeal Former Charlotte");
                Dialog.SetTextField("//input[contains(@id,'_EFFORTLAUNCHDATE_value')]", "11/17/2017");

                Dialog.Save(); // Save the fields
            }
            catch (Exception exc)
            {
                throw new Exception("Error: could not create a marketing effort. " + exc.ToString());
            }
        }
コード例 #16
0
        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);
            }
        }
コード例 #17
0
        public void GivenSegmentDoesNotExistWithActivatedMarketingEffortUsingPackage(string segmentName, string template)
        {
            BBCRMHomePage.OpenMarketingAndCommunicationsFA();
            MarketingAndCommFunctionalArea.Segments();

            IDictionary <string, string> segmentRow = new Dictionary <string, string> {
                { "Segment", segmentName }
            };

            if (SegmentsPanel.SegmentExists(segmentRow))
            {
                SegmentsPanel.GoToSegment(segmentRow);
            }
            else
            {
                return;
            }

            IDictionary <string, string> effort = new Dictionary <string, string> {
                { "Marketing effort", template }
            };

            if (SegmentPanel.ActivatedMarketingEffortExists(effort))
            {
                SegmentPanel.DeleteActivatedMarketingEffort(template);
                BBCRMHomePage.OpenMarketingAndCommunicationsFA();
                MarketingAndCommFunctionalArea.Segments();
                SegmentsPanel.GoToSegment(segmentRow);
            }
            SegmentPanel.DeleteSegment();
        }
コード例 #18
0
        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);
            }
        }
コード例 #19
0
        public void GivenAMailPackageExistsWith(Table packages)
        {
            foreach (var package in packages.Rows)
            {
                BBCRMHomePage.OpenMarketingAndCommunicationsFA();
                MarketingAndCommFunctionalArea.Packages();

                IDictionary <string, string> packageRow = new Dictionary <string, string> {
                    { "Channel", "Mail" }
                };
                if (package.ContainsKey("Name") && package["Name"] != string.Empty)
                {
                    packageRow.Add("Name", package["Name"]);
                }
                if (package.ContainsKey("Letter") && package["Letter"] != string.Empty)
                {
                    packageRow.Add("Content", package["Letter"]);
                }
                if (PackagesPanel.PackageExists(packageRow))
                {
                    PackagesPanel.DeletePackage(packageRow);
                }

                PackagesPanel.AddMailPackage();
                PackageDialog.SetFields(package);
                Dialog.Save();
            }
        }
コード例 #20
0
        public void WhenIAddSelectionAd_HocQueryType(string selection)
        {
            try
            {
                BBCRMHomePage.OpenMarketingAndCommunicationsFA(); //open the analysis functional area
                string xPathLink = "//div[contains(@class,'bbui-pages-contentcontainer') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'bui-linkbutton')]/div[text()='Selections']";
                Panel.WaitClick(xPathLink, 20);                   // click on the selections link

                xPathLink = "//button[contains(@class,'bui-linkbutton')]/div[text()='Add a selection']";
                Panel.WaitClick(xPathLink, 20);  // click on the selections link

                //string querystring = "//button[./text() = 'Add an ad-hoc query']";

                //Panel.WaitClick(querystring, 10); //click on the "ad-hoc query" button
                string queryType = "Constituent";
                Dialog.SetDropDown(Dialog.getXInput("AdHocQueryNewForm", "RECORDTYPE_value"), queryType); //start the adhoc query for the selected querytype
                string gridRowXPath = "";
                gridRowXPath = "//div[contains(@id,'AdHocQueryNewForm')]//div[contains(@id, 'GROUPTYPE-Constituent-bd')]/div[3]/table";

                Panel.WaitClick(gridRowXPath, 20); //click on that row
                Panel.WaitClick(Dialog.getXOKButton, 20);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not add an adhoc query. " + ex.Message);
            }
        }
コード例 #21
0
ファイル: EventsSteps.cs プロジェクト: srgleason/uat-kit
 public void GivenAnEventExists(Table events)
 {
     foreach (var e in events.Rows)
     {
         StepHelper.SetTodayDateInTableRow("Start date", e);
         e["Name"] += uniqueStamp;
         //navigate to event and add event
         BBCRMHomePage.OpenEventsFA();
         Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Add new']");
         Panel.WaitClick("//span[./text()='Event']");
         //test for "Cannot read property 'createChild' of null" popup?
         try
         {
             BaseComponent.GetEnabledElement("//span[contains(.,'Cannot read property')]", 5);
             Dialog.OK();
         }
         catch
         {
             //eat exception
         }
         //check is visible
         BaseComponent.GetEnabledElement(XpathHelper.xPath.VisibleBlock + "//span[text()='Add an event']");
         //set fields
         Dialog.SetTextField("//input[contains(@id,'_STARTDATE_value')]", e["Start date"]);
         Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", e["Name"]);
         Dialog.SetTextField("//input[contains(@id,'_EVENTCATEGORYCODEID_value')]", e["Category"]);
         StepHelper.AddEntryOnTheFly();
         Dialog.Save();
     }
 }
コード例 #22
0
        public void WhenISearchForAExclusionSelection(string selection)
        {
            IWebElement statusElement = null;

            try
            {
                BBCRMHomePage.OpenMarketingAndCommunicationsFA(); //Open marketing functional area
                string xPathLink = "//div[contains(@class,'bbui-pages-contentcontainer') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'bui-linkbutton')]/div[text()='Selections']";
                Panel.WaitClick(xPathLink, 20);                   // click on the selections link
                xPathLink = "//button[contains(@class,'bui-linkbutton')]/div[text()='Selection search']";
                Panel.WaitClick(xPathLink, 20);                   // click on the selection search link
                string xSearchPath = "//*[contains(@class,'bbui-dialog-search') and not(contains(@style,'hidden'))]//*[starts-with(@id, 'ctrl_') and contains(@id, '_NAME_value')]";
                Dialog.SetTextField(xSearchPath, selection);
                Dialog.ClickButton("Search", 30);

                string xPath = "//div[contains(@class,'x-grid-empty')and text()='No records found']";
                // use x-grid-empty class to see if there was a result.
                statusElement = Panel.GetDisplayedElement(xPath, 15);
                Dialog.Cancel();
            }

            catch (Exception ex)
            {
                if (statusElement != null)
                {
                    throw new Exception("Error: Could not search for an exclusion. " + ex.Message);
                }
                else
                {
                    throw new Exception("Error: the exclusion already exists. " + ex.Message);
                }
            }
        }
コード例 #23
0
        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);
            }
        }
コード例 #24
0
        public void GivenImportMappingFile(string filename, string mappingname, Table mappingTable)
        {
            try
            {
                string batchtemplatename;

                if (mappingname.ToLower().Contains("interaction"))
                {
                    batchtemplatename = "Interaction Batch";
                }
                else
                {
                    batchtemplatename = "UNC Educational Involvement Import Batch";
                }
                BBCRMHomePage.OpenFunctionalArea("Administration"); //open the admin functional area and then click on import button
                Panel.WaitClick("//div[contains(h3,'Tools')]//button[contains(@class,'linkbutton')]/div[text()='Import']", 15);
                Panel.WaitClick("//a[contains(@class,'linkbutton')]/div[text()='Import file templates']", 10);

                //var mappingRow = mappingTable.Rows[0];
                //Panel.SelectSectionDatalistRow(mappingRow, "Import file templates");

                Panel.ClickSectionAddButton("Import file templates");
                Panel.WaitClick(getXMenuItem("Delimited template"));

                Dialog.SetTextField("//div[contains(@id, '_ImportDelimitedFileTemplateAddDataForm')]//input[contains(@id,'_NAME_value')]", mappingname);
                Dialog.SetDropDown("//div[contains(@id, '_ImportDelimitedFileTemplateAddDataForm')]//input[contains(@id,'_BATCHTEMPLATEID_value')]", batchtemplatename);
                Dialog.SetDropDown("//div[contains(@id, '_ImportDelimitedFileTemplateAddDataForm')]//input[contains(@id,'_IMPORTFILESERVER_value')]", filename);
                Dialog.ClickButton("Auto-map", 50);
                Dialog.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Error: The mapping file does not exist. Could not create it. " + ex.Message);
            }
        }
コード例 #25
0
 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);
     }
 }
コード例 #26
0
        public void GivenIAddASpecialCode(string codeName)
        {
            try
            {
                //I am using only part of the unique stamp since it is too long to fit into the code name input box
                string uniqueString = uniqueStamp;
                uniqueString = uniqueString.Replace(".", "");
                int len = uniqueString.Length;
                len         -= 6;
                uniqueString = uniqueString.Substring(len);
                codeName    += uniqueString;
                BBCRMHomePage.OpenFunctionalArea("Administration"); // open the administration functional area

                //click on the link to open form to add a new special code
                Panel.WaitClick("//button[contains(@class,'linkbutton')]/div[text()='UNC Manage Special Codes']", 10);
                Panel.ClickSectionAddButton("UNC Special Codes", "Add"); // press the add special code button

                //add the name and description
                Dialog.SetTextField("//div[contains(@id,'_UNCSpecialCodeDataFormAddDataForm')]//textarea[contains(@id,'DESCRIPTION_value')]", "Test Description"); //add in the desc.
                System.Threading.Thread.Sleep(2000);                                                                                                               //delay so that the selected special code will be displayed

                Dialog.SetTextField("//div[contains(@id,'UNCSpecialCodeDataFormAddDataForm')]//input[contains(@id,'_SPECIALCODE_value')]", codeName);

                Dialog.Save();
                System.Threading.Thread.Sleep(5000);
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not start to add a special code. " + ex.Message);
            }
        }
コード例 #27
0
        public void ThenAppealMailingsTabAppealMailingListShows(string Appeal, Table table)
        {
            //Verify Appeal Mailing data displays correctly on Appeal
            //select M&C
            BBCRMHomePage.OpenMarketingAndCommunicationsFA();
            //Open Appeal Search
            MarketingAndCommFunctionalArea.OpenLink("Appeal", "Appeal search");
            //search for Appeal in Name field
            Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", Appeal + uniqueStamp);
            //click Search button
            Dialog.ClickButton("Search");
            //Select correct result in grid
            SearchDialog.SelectFirstResult();
            //select Mailings tab
            Panel.SelectTab("Mailings");
            //set data to match data list
            TableRow tableRow = table.Rows[0];

            tableRow["Name"]      += uniqueStamp;
            tableRow["Package"]   += uniqueStamp;
            tableRow["Selection"] += uniqueStamp + " (Ad-hoc Query)";
            StepHelper.SetTodayDateInTableRow("Mail date", tableRow);
            if ((Panel.SectionDatalistRowExists(table.Rows[0], "Appeal mailings") == false))
            {
                throw new Exception("ThenAppealMailingsTabAppealMailingListShows grid not correct!");
            }
        }
コード例 #28
0
        public void GivenEditAGeneralCorresopndenceDescription(String correspondenceName, Table correspondenceTable)
        {
            try
            {
                TableRow CorrespondenceRow = correspondenceTable.Rows[0];
                correspondenceName += uniqueStamp;   //The unique stamp is a series of numbers to keep names different from each other

                if (CorrespondenceRow.Keys.Contains("Name") && (!String.IsNullOrEmpty(CorrespondenceRow["Name"])))
                {
                    CorrespondenceRow["Name"] += uniqueStamp;
                }
                BBCRMHomePage.OpenMarketingAndCommunicationsFA();  //Open marketing functional area

                string xPathLink = "//div[contains(@class,'bbui-pages-contentcontainer') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'bui-linkbutton')]/div[text()='Manage correspondence']";
                Panel.WaitClick(xPathLink, 50);                                                                                                            // click on the General correspondence link}

                Panel.SelectSectionDatalistRow(CorrespondenceRow, "UNC Correspondence processes");                                                         //find the correct row which has the correct general correspondence process
                Panel.WaitClick(Panel.getXSelectedDatalistRowButton("Edit"));
                Dialog.SetTextField("//input[contains(@id,'_DESCRIPTION_value')]", "Test Desc Edited Now");                                                //change the desc.
                Dialog.SetTextField("//textarea[contains(@id,'_COMMENTS_value')]", "This is an edited comment for " + DateTime.Today.ToShortDateString()); //change the comment
            }
            catch (Exception ex)
            {
                if (UserName != "bbtest2.gst")
                {
                    throw new Exception("Error: could not edit a general correspondence. " + ex.Message);
                }
            }
        }
コード例 #29
0
 public void WhenIAddPlanOutlineToMajorGivingSetup(string planName, Table planSteps)
 {
     planName += uniqueStamp;
     BBCRMHomePage.OpenProspectsFA();
     ProspectsFunctionalArea.MajorGivingSetup();
     MajorGivingSetupPanel.AddPlanOutline(planName, planSteps);
 }
 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);
     }
 }