Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
 private void GetEventPanel(string eventName)
 {
     if (!Panel.IsPanelHeader(eventName))
     {
         BBCRMHomePage.OpenEventsFA();
         EventsFunctionalArea.EventSearch(eventName);
     }
 }
Ejemplo n.º 6
0
 public void WhenIAddCoordinatorToEvent(string constituentLastName, string eventName)
 {
     constituentLastName += uniqueStamp;
     eventName           += uniqueStamp;
     BBCRMHomePage.OpenEventsFA();
     EventsFunctionalArea.EventSearch(eventName);
     EventPanel.AddCoordinator(constituentLastName);
 }
 public void WhenIAddEvents(Table eventsToAdd)
 {
     BBCRMHomePage.OpenEventsFA();
     foreach (var eventToAdd in eventsToAdd.Rows)
     {
         eventToAdd["Name"] += uniqueStamp;
         EventsFunctionalArea.AddEvent(eventToAdd);
     }
 }
Ejemplo n.º 8
0
 public void GivenLocationExists(string locationName)
 {
     BBCRMHomePage.OpenEventsFA();
     EventsFunctionalArea.Locations();
     if (!LocationsPanel.LocationExists(locationName))
     {
         LocationsPanel.AddLocation(locationName);
     }
 }
 public void GivenEventManagementTemplateExists(string templateName)
 {
     BBCRMHomePage.OpenEventsFA();
     EventsFunctionalArea.EventManagementTemplates();
     if (!EventManagementTemplatesPanel.TemplateExists(templateName))
     {
         EventManagementTemplatesPanel.AddTemplate(templateName);
     }
 }
 public void GivenAnEventExists(Table events)
 {
     foreach (var e in events.Rows)
     {
         e["Name"] += uniqueStamp;
         BBCRMHomePage.OpenEventsFA();
         EventsFunctionalArea.AddEvent(e);
     }
 }
Ejemplo n.º 11
0
 private void GetEventPanel(string eventName)
 {
     if (!Panel.IsPanelHeader(eventName))
     {
         BBCRMHomePage.OpenEventsFA();
         //Panel.CollapseSection("Event calendar", "CalendarViewForm"); // this causes an issues sometimes?
         FunctionalArea.OpenLink("Fundraising events", "Event search");
         //Panel.WaitClick("//button[not(contains(@class,'actiongroup-tooltip-header'))]/div[./text()='Event search']");
         BaseComponent.SetTextField("//div[contains(@style,'visible')]//input[contains(@id,'_NAME_value')]", eventName);
         SearchDialog.Search();
         SearchDialog.SelectFirstResult();
     }
 }
Ejemplo n.º 12
0
 public void GivenLocationExists(string locationName)
 {
     try
     {
         //Open events functional area and then add a location
         locationName += uniqueStamp;              // the unique stamp is a series of numbers to keep names different from each other
         BBCRMHomePage.OpenEventsFA();             // open event functional area
         EventsFunctionalArea.Locations();
         LocationsPanel.AddLocation(locationName); //add a location
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not find the specified event location. " + ex.Message);
     }
 }
Ejemplo n.º 13
0
 public void WhenIAddCoordinatorToEvent(string constituentLastName, string eventName)
 {
     try
     {
         constituentLastName += 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
         EventsFunctionalArea.EventSearch(eventName);    // search for an event
         EventPanel.AddCoordinator(constituentLastName); // add a coordinator
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not add a coordinator to an event. " + ex.Message);
     }
 }
Ejemplo n.º 14
0
 private void GetEventPanel(string eventName)
 {
     try
     {
         if (!Panel.IsPanelHeader(eventName))
         {
             BBCRMHomePage.OpenEventsFA();                // open event functional area
             EventsFunctionalArea.EventSearch(eventName); // search for an event
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not get the event panel. " + ex.Message);
     }
 }
Ejemplo n.º 15
0
 public void GivenAnEventExists(Table events)
 {
     try
     {
         foreach (var e in events.Rows)
         {
             e["Name"] += uniqueStamp;         // the unique stamp is a series of numbers to keep names different from each other
             BBCRMHomePage.OpenEventsFA();     // open event functional area
             EventsFunctionalArea.AddEvent(e); // Add an event
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not find that a certain event exists. " + ex.Message);
     }
 }
Ejemplo n.º 16
0
        public void ThenEventDisplaysRegistrantSOnRegistrationsTab(string EventName, Table table)
        {
            IList <dynamic> registrants = table.CreateDynamicSet().ToList();

            //navigate to Event
            EventName += uniqueStamp;

            BBCRMHomePage.OpenEventsFA();
            try
            {
                Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//input[@placeholder='Enter the name of an event']/../span/img", 5); //use this for the timeout
            }
            catch
            {
                try
                {
                    BaseComponent.GetEnabledElement("//span[contains(.,'Cannot read property')]", 5);
                    Dialog.OK();
                }
                catch { }
                FunctionalArea.OpenLink("Fundraising events", "Event search");
            }

            //GetEventPanel(EventName);
            BaseComponent.SetTextField("//div[contains(@style,'visible')]//input[contains(@id,'_NAME_value')]", EventName);
            SearchDialog.Search();
            SearchDialog.SelectFirstResult();

            //Click Registrations tab
            Panel.SelectTab("Registrations");
            foreach (dynamic registrant in registrants)
            {
                string guestOf = registrant.Extra + " " + registrant.RegistrantFirstName + " " + registrant.RegistrantLastName + uniqueStamp;
                guestOf = guestOf.Trim();
                string registeredConstituent = registrant.RegistrantLastName + uniqueStamp + ", " + registrant.RegistrantFirstName;
                //check fields
                if (!string.IsNullOrEmpty(registrant.Extra))
                {
                    BaseComponent.GetEnabledElement(string.Format(XpathHelper.xPath.VisiblePanel + "//div[not(contains(@class,'x-hide-display')) and contains(@class,'bbui-pages-pagesection') and not(contains(@class,'row'))]//a[text()='{0}']", guestOf));
                }
                else
                {
                    BaseComponent.GetEnabledElement(string.Format(XpathHelper.xPath.VisiblePanel + "//div[not(contains(@class,'x-hide-display')) and contains(@class,'bbui-pages-pagesection') and not(contains(@class,'row'))]//a[text()='{0}']", registeredConstituent));
                }
                BaseComponent.GetEnabledElement(string.Format(XpathHelper.xPath.VisiblePanel + "//div[not(contains(@class,'x-hide-display')) and contains(@class,'bbui-pages-pagesection') and not(contains(@class,'row'))]//div[text()='{0}']", Convert.ToString(registrant.Balance)));
            }
        }
Ejemplo n.º 17
0
 public void GivenAnEventExistsThatIncludesRegistrationOption(Table table)
 {
     #region data setup
     //setup date field.  StepHelper for date must come before dynamic objects
     StepHelper.SetTodayDateInTableRow("Start date", table);
     dynamic objectData           = table.CreateDynamicInstance();
     var     eventDialogId        = "EventAddForm";
     var     registrationDialogID = "RegistrationOptionAddForm2";
     objectData.Name += uniqueStamp;
     //sorts out date format due to datetime adding 00:00:00
     DateTime findDate = objectData.StartDate;
     //set the thread culture to get the correct date for the browser
     StepHelper.SetCurrentThreadCultureToConfigValue();
     //fields for add an event
     IDictionary <string, CrmField> EventSupportedFields = new Dictionary <string, CrmField>
     {
         { "Name", new CrmField("_NAME_value", FieldType.TextInput) },
         { "Start date", new CrmField("_STARTDATE_value", FieldType.TextInput) },
         { "Category", new CrmField("_EVENTCATEGORYCODEID_value", FieldType.Dropdown) }
     };
     //fields for Registration form
     IDictionary <string, CrmField> RegistrationSupportedFields = new Dictionary <string, CrmField>
     {
         { "Registration type", new CrmField("_EVENTREGISTRATIONTYPEID_value", FieldType.Dropdown) },
         { "Registration count", new CrmField("_REGISTRATIONCOUNT_value", FieldType.TextInput) },
         { "Registration fee", new CrmField("_AMOUNT_value", FieldType.TextInput) }
     };
     #endregion
     //navigation
     BBCRMHomePage.OpenEventsFA();
     EventsFunctionalArea.AddEvent();
     //set fields for Add an Event
     Dialog.SetField(eventDialogId, "Name", objectData.Name, EventSupportedFields);
     Dialog.SetField(eventDialogId, "Start date", findDate.ToShortDateString(), EventSupportedFields);
     Dialog.SetField(eventDialogId, "Category", objectData.Category, EventSupportedFields);
     Dialog.Save();
     //add registration
     Panel.SelectTab("Options");
     Panel.ClickSectionAddButton("Registration options");
     //add registration options
     Dialog.SetField(registrationDialogID, "Registration type", objectData.RegistrationType, RegistrationSupportedFields);
     Dialog.SetField(registrationDialogID, "Registration count", Convert.ToString(objectData.RegistrationCount), RegistrationSupportedFields);
     Dialog.SetField(registrationDialogID, "Registration fee", Convert.ToString(objectData.RegistrationFee), RegistrationSupportedFields);
     //Save dialog
     Dialog.Save();
 }
Ejemplo n.º 18
0
        public void GivenAnEventExists(Table events)
        {
            foreach (var e in events.Rows)
            {
                e["Name"] += uniqueStamp;
                BBCRMHomePage.OpenEventsFA();
                //spawn form
                Panel.WaitClick("//table[contains(@class,'x-btn bbui-pages-section-collapsesection x-btn-icon')]/tbody/tr[2]/td[2]/em/button");
                Panel.WaitClick("//button[./text()='Add new' and contains(@class,'x-btn-text bbui-valuestyles-new-imageandtext')]");
                Panel.WaitClick("//span[./text()='Event']");

                //set form vars and save
                Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", e["Name"]);
                OpenQA.Selenium.IWebElement _web = Dialog.GetEnabledElement("//input[contains(@id,'_STARTDATE_value')]");
                _web.SendKeys(e["Start date"]);
                Dialog.Save();
            }
        }
        public void WhenIStartToCreateAMulti_EventUsingTemplate(string template, Table events)
        {
            BBCRMHomePage.OpenEventsFA();
            EventsFunctionalArea.AddMultiEvent();
            MultiLevelEventDialog.SetTemplate(template);

            foreach (var eventToAdd in events.Rows)
            {
                eventToAdd["event"] += uniqueStamp;
                if (eventToAdd["parent"] == string.Empty)
                {
                    MultiLevelEventDialog.AddExistingEvent(eventToAdd["event"]);
                }
                else
                {
                    MultiLevelEventDialog.AddChildEvent(eventToAdd["event"], eventToAdd["parent"] + uniqueStamp);
                }
            }
        }
Ejemplo n.º 20
0
        public void WhenIStartToCreateAMulti_EventUsingTemplate(string template, Table events)
        {
            BBCRMHomePage.OpenEventsFA();
            EventsFunctionalArea.AddMultiEvent();
            Dialog.SetDropDown("//input[contains(@id,'_EVENTMANAGEMENTTEMPLATEID_value')]", template + uniqueStamp);

            foreach (var eventToAdd in events.Rows)
            {
                eventToAdd["event"] += uniqueStamp;
                if (eventToAdd["parent"] == string.Empty)
                {
                    MultiLevelEventDialog.AddExistingEvent(eventToAdd["event"]);
                }
                else
                {
                    MultiLevelEventDialog.AddChildEvent(eventToAdd["event"], eventToAdd["parent"] + uniqueStamp);
                }
            }
        }
Ejemplo n.º 21
0
 public void WhenIAddEvents(Table eventsToAdd)
 {
     try
     {
         BBCRMHomePage.OpenEventsFA();  // open event functional area
         Panel.CollapseSection("Event calendar", "CalendarViewForm");
         foreach (var eventToAdd in eventsToAdd.Rows)
         {
             if (eventToAdd["Name"].Substring(0, 3) != "UDO")
             {
                 eventToAdd["Name"] += uniqueStamp;     // the unique stamp is a series of numbers to keep names different from each other
             }
             EventsFunctionalArea.AddEvent(eventToAdd); // add an event
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not add an event. " + ex.Message);
     }
 }
Ejemplo n.º 22
0
        public void WhenISearchForEvent(string eventName, Table events)
        {
            TableRow eventrow = events.Rows[0];

            try
            {
                BBCRMHomePage.OpenEventsFA();  // open event functional area
                try
                {
                    EventsFunctionalArea.EventSearch(eventName);  // search for an event
                }
                catch
                {
                    EventsFunctionalArea.AddEvent(eventrow);  //add an event if it does not exist
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error: could not create a test event. " + ex.Message);
            }
        }
Ejemplo n.º 23
0
        public void WhenIAddRegistrantToEvent(string registrant, string eventName, Table registrations)
        {
            registrant += uniqueStamp;
            eventName  += uniqueStamp;
            BBCRMHomePage.OpenEventsFA();
            EventsFunctionalArea.EventSearch(eventName);
            EventPanel.AddRegistrant();
            RegistrantDialog.SetRegistrant(registrant);

            foreach (var registrantRow in registrations.Rows)
            {
                if (registrantRow.ContainsKey("Registrant") && !string.IsNullOrEmpty(registrantRow["Registrant"]) &&
                    registrantRow["Registrant"] != "(Unnamed guest)")
                {
                    registrantRow["Registrant"] += uniqueStamp;
                }
            }

            RegistrantDialog.SetRegistrants(registrations);
            Dialog.Save();
        }
Ejemplo n.º 24
0
        public void GivenEventExistsWithRegistrationOption(string eventName, string StartDate, Table options)
        {
            DateTime actualStartDate = StepHelper.SetTodayDateForVariable(StartDate);

            eventName += uniqueStamp;
            //navigate to event and add event
            BBCRMHomePage.OpenEventsFA();
            try
            {
                Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Add new']", 15);
                Panel.WaitClick("//span[./text()='Event']", 15);
            }
            catch
            {
                try
                {
                    BaseComponent.GetEnabledElement("//span[contains(.,'Cannot read property')]", 5);
                    Dialog.OK();
                }
                catch { }
                Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Add new']", 15);
                Panel.WaitClick("//span[./text()='Event']", 15);
            }

            //check is visible
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisibleBlock + "//span[text()='Add an event']");
            //set fields
            Dialog.SetTextField("//input[contains(@id,'_STARTDATE_value')]", actualStartDate.ToShortDateString());
            Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", eventName);
            Dialog.SetTextField("//input[contains(@id,'_EVENTCATEGORYCODEID_value')]", "Sport");
            StepHelper.AddEntryOnTheFly();
            Dialog.Save();

            foreach (var option in options.Rows)
            {
                EventPanel.AddRegistrationOption(option);
            }
        }
Ejemplo n.º 25
0
        public void WhenIAddEvents(Table eventsToAdd)
        {
            BBCRMHomePage.OpenEventsFA();
            foreach (var eventToAdd in eventsToAdd.Rows)
            {
                eventToAdd["Name"] += uniqueStamp;
                BBCRMHomePage.OpenEventsFA();
                //spawn form
                Panel.WaitClick("//table[contains(@class,'x-btn bbui-pages-section-collapsesection x-btn-icon')]/tbody/tr[2]/td[2]/em/button");
                Panel.WaitClick("//button[./text()='Add new' and contains(@class,'x-btn-text bbui-valuestyles-new-imageandtext')]");
                Panel.WaitClick("//span[./text()='Event']");

                //set form vars and save
                Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", eventToAdd["Name"]);
                OpenQA.Selenium.IWebElement _web = Dialog.GetEnabledElement("//input[contains(@id,'_STARTDATE_value')]");
                _web.SendKeys(eventToAdd["Start date"]);
                if (eventToAdd["Location"] != null && !string.IsNullOrEmpty(eventToAdd["Location"].ToString()))
                {
                    Dialog.SetTextField("//input[contains(@id,'_EVENTLOCATIONID_value')]", eventToAdd["Location"]);
                }
                Dialog.Save();
            }
        }
Ejemplo n.º 26
0
        public void GivenAnEventExists(string eventName, DateTime StartDate)
        {
            StepHelper.SetCurrentThreadCultureToConfigValue();
            if (eventName == string.Empty)
            {
                throw new MissingFieldException("no value provided in the table for the field 'Name'");
            }

            BBCRMHomePage.OpenEventsFA();
            var headers = new string[3] {
                "Name", "Start date", "Category"
            };
            var firstRow = new string[3] {
                eventName, StartDate.ToShortDateString(), "Sport"
            };

            var events = new Table(headers);

            events.AddRow(firstRow);

            GivenAnEventExists(events);
            //check is visible to allow extra time for page load
            BaseComponent.GetEnabledElement(string.Format("//span[text()='{0}']", eventName + uniqueStamp), 240);
        }
Ejemplo n.º 27
0
 public void GivenISelectEvent(string TargetEvent)
 {
     BBCRMHomePage.OpenEventsFA();
     EventsFunctionalArea.EventSearch(TargetEvent += uniqueStamp);
 }