コード例 #1
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!");
            }
        }
コード例 #2
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;
            }
        }
コード例 #3
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
        public void WhenIEditThePlannedSteps(Table table)
        {
            StepHelper.SetTodayDateInTableRow("Actual date", table);
            IList <dynamic> objectData = table.CreateDynamicSet().ToList();
            string          dialogId   = "ProspectPlanEditForm2";
            string          gridId     = "STEPS";
            int             i          = 1;

            Panel.ClickButton("Edit steps");
            foreach (dynamic steps in objectData)
            {
                DateTime actualDate = steps.ActualDate;
                //check objective in row entry
                string gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Objective"));
                BaseComponent.GetEnabledElement(string.Format(gridXPath + string.Format("//div[text()='{0}']", steps.Objective)), 5);
                //change status
                gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Status"));
                Dialog.SetGridDropDown(gridXPath, steps.Status);
                //change status
                gridXPath = Dialog.getXGridCell(dialogId, gridId, i, BaseComponent.GetDatalistColumnIndex(Dialog.getXGridHeaders(dialogId, gridId), "Actual date"));
                Dialog.SetGridTextField(gridXPath, actualDate.ToShortDateString());
                i++;
            }
            Dialog.Save();
        }
コード例 #4
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
        public void ThenCompletedStepsDisplays(Table table)
        {
            StepHelper.SetTodayDateInTableRow("Date", table);
            IList <dynamic> objectData     = table.CreateDynamicSet().ToList();
            string          sectionCaption = "Completed steps";

            foreach (dynamic completedSteps in objectData)
            {
                DateTime findDate = Convert.ToDateTime(completedSteps.Date);
                IDictionary <string, string> rowValues = new Dictionary <string, string>();
                rowValues.Add("Status", completedSteps.Status);
                rowValues.Add("Date", findDate.ToShortDateString());
                rowValues.Add("Objective", completedSteps.Objective);
                rowValues.Add("Stage", completedSteps.Stage);
                if (!string.IsNullOrEmpty(completedSteps.Owner))
                {
                    rowValues.Add("Owner", completedSteps.Owner + uniqueStamp);
                }
                //check rows
                if (!Panel.SectionDatalistRowExists(rowValues, sectionCaption))
                {
                    throw new Exception(string.Format("Expected values not in the grid for completed step {0}.", completedSteps.Objective));
                }
            }
        }
コード例 #5
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();
     }
 }
コード例 #6
0
ファイル: BatchSteps.cs プロジェクト: blackbaud/uat-kit
 public void GivenIAddAnOrganizationRelationship(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     organizationDialogId = "RelationshipIndividualtoOrganizationAddForm2";
     objectData.RelatedOrganization += uniqueStamp;
     //setup fields for Add organizational relationship
     IDictionary <string, CrmField> OrganizationSupportedFields = new Dictionary <string, CrmField>
     {
         { "Related organization", new CrmField("_RECIPROCALCONSTITUENTID_value", FieldType.Searchlist, "OrganizationSearch", "_KEYNAME_value") },
         { string.Format(objectData.Constituent + uniqueStamp + " is the"), new CrmField("_RELATIONSHIPTYPECODEID_value", FieldType.Dropdown) },
         { string.Format(objectData.RelatedOrganization + uniqueStamp + " is the"), new CrmField("_RECIPROCALTYPECODEID_value", FieldType.Dropdown) },
         { "Start date", new CrmField("_RELATIONSHIPSTARTDATE_value", FieldType.TextInput) }
     };
     DateTime startDate = objectData.StartDate;
     #endregion
     //Search for constituent
     StepHelper.SearchAndSelectConstituent(objectData.Constituent, true);
     //click Relationship tab and Add individual relationship
     Panel.SelectTab("Relationships");
     Panel.ClickButton("Add organization");
     //check if visible
     BaseComponent.GetEnabledElement("//span[contains(@class,'x-window-header-text') and ./text()='Add a relationship']");
     //set fields
     Dialog.SetField(organizationDialogId, "Related organization", objectData.RelatedOrganization, OrganizationSupportedFields);
     Dialog.SetField(organizationDialogId, objectData.Constituent + uniqueStamp + " is the", objectData.ConstituentRelationshipType, OrganizationSupportedFields);
     Dialog.SetField(organizationDialogId, "Start date", startDate.ToShortDateString(), OrganizationSupportedFields);
     Dialog.SetCheckbox("//input[contains(@id,'_ISMATCHINGGIFTRELATIONSHIP_value')]", objectData.TheOrganizationWillMatchContributionsForThisRelationship);
     Dialog.Save();
 }
コード例 #7
0
ファイル: EventsSteps.cs プロジェクト: blackbaud/uat-kit
        public void ThenINavigateToPaymentFromEvent(Table table)
        {
            #region data setup
            //setup date field.  StepHelper for date must come before dynamic objects
            StepHelper.SetTodayDateInTableRow("Date", table);
            dynamic objectData     = table.CreateDynamicInstance();
            string  sectionCaption = "Registrations";
            //sorts out date format due to datetime adding 00:00:00
            DateTime findDate    = objectData.Date;
            string   eventAmount = string.Format("{0} on {1}", objectData.PaymentAmount, findDate.ToShortDateString());
            string   constit     = objectData.Surname + uniqueStamp + ", " + objectData.FirstName;
            string   regXPath    = XpathHelper.xPath.VisiblePanel + string.Format("//div[contains(@title,'{0}')]", constit);
            #endregion
            //check is visible
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//div[contains(@class, 'xtb-text bbui-pages-section-tbarcaption') and ./text()='{0}']", sectionCaption));
            //lets reset the filter
            try
            {
                Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Reset']", 5);
            }
            catch { }

            // Click Go to registrant
            BaseComponent.GetEnabledElement(regXPath);
            BaseComponent.WaitClick(regXPath);

            // Click payment history link
            // BaseComponent.WaitClick(XpathHelper.xPath.VisiblePanel + string.Format("//a[contains(@id,'_PAYMENT1TEXT_value') and ./text()='{0}']", eventAmount));
            // should be unique
            string linkXpath = string.Format("//a[contains(@id,'_PAYMENT1TEXT_value') and ./text()='{0}']", eventAmount);
            BaseComponent.GetEnabledElement(linkXpath);
            BaseComponent.WaitClick(linkXpath);
        }
コード例 #8
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
 public void WhenIAddTeamMemberTo(string constituentName, Table teamMembers)
 {
     GetConstituentPanel(constituentName += uniqueStamp);
     foreach (var teamMember in teamMembers.Rows)
     {
         StepHelper.SetTodayDateInTableRow("Start date", teamMember);
         teamMember["Team member"] = teamMember["Team member"] + uniqueStamp;
         teamMember["Role"]        = teamMember["Role"] + uniqueStamp;
         ConstituentPanel.AddTeamMember(teamMember);
     }
 }
コード例 #9
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
        public void ThenTheProspectConstituencyIsAdded(Table table)
        {
            StepHelper.SetTodayDateInTableRow("Date from", table);
            StepHelper.SetTodayDateInTableRow("Date to", table);
            dynamic  objectData = table.CreateDynamicInstance();
            DateTime startDate  = objectData.DateFrom;
            DateTime endDate    = objectData.DateTo;

            //check fields
            Panel.GetEnabledElement(string.Format("//div[contains(@title,'{0}') and ./text()='{0}']", objectData.Description));
            Panel.GetEnabledElement(string.Format("//div[contains(@title,'{0}') and ./text()='{0}']", startDate.ToShortDateString()));
            Panel.GetEnabledElement(string.Format("//div[contains(@title,'{0}') and ./text()='{0}']", endDate.ToShortDateString()));
        }
コード例 #10
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
 public void GivenAMajorGivingPlanIsStartedOn(string constituent, Table table)
 {
     WhenIStartToAddAMajorGivingPlanTo(constituent);
     foreach (var planValues in table.Rows)
     {
         StepHelper.SetTodayDateInTableRow("Start date", planValues);
         if (planValues.ContainsKey("Outlines"))
         {
             MajorGivingPlanDialog.SetOutline(planValues["Outlines"]);
             planValues["Outlines"] = null;
         }
         MajorGivingPlanDialog.SetDetails(planValues);
     }
 }
コード例 #11
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
 public void WhenInsertAStepOnRow(int index, Table steps)
 {
     if (steps.RowCount != 1)
     {
         throw new ArgumentException("Only provide one step row.");
     }
     foreach (var step in steps.Rows)
     {
         StepHelper.SetTodayDateInTableRow("Expected date", step);
         StepHelper.SetTodayDateInTableRow("Actual date", step);
         if (step.ContainsKey("Owner") && !string.IsNullOrEmpty(step["Owner"]))
         {
             step["Owner"] += uniqueStamp;
         }
         MajorGivingPlanDialog.InsertStep(step, index);
     }
 }
コード例 #12
0
ファイル: ConstituentSteps.cs プロジェクト: blackbaud/uat-kit
        public void WhenIEditTheAddressToIndividualConstituent(Table table)
        {
            //set up date before dynamic object
            StepHelper.SetTodayDateInTableRow("Start date", table);
            //create dynamic table object
            dynamic  objectData = table.CreateDynamicInstance();
            DateTime startDate  = Convert.ToDateTime(objectData.StartDate);

            //set fields
            foreach (var EditAddress in table.Rows)
            {
                Dialog.SetTextField("//textarea[contains(@id,'_ADDRESSBLOCK_value')]", objectData.Address);
                Dialog.SetTextField("//input[contains(@id,'_POSTCODE_value')]", objectData.Postcode);
                Dialog.SetTextField("//input[contains(@id,'_HISTORICALSTARTDATE_value')]", startDate.ToShortDateString());
                Dialog.Save();
            }
        }
コード例 #13
0
ファイル: BatchSteps.cs プロジェクト: blackbaud/uat-kit
 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();
 }
コード例 #14
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
 public void ThenTheTeamMemberExists(string groupTitle, Table teamMembers)
 {
     foreach (var teamMember in teamMembers.Rows)
     {
         StepHelper.SetTodayDateInTableRow("Start date", teamMember);
         if (teamMember["Name"] != string.Empty)
         {
             teamMember["Name"] = teamMember["Name"] + uniqueStamp;
         }
         if (teamMember["Role"] != string.Empty)
         {
             teamMember["Role"] = teamMember["Role"] + uniqueStamp;
         }
         if (!ConstituentPanel.TeamMemberExists(teamMember))
         {
             throw new ArgumentException(
                       String.Format("Current constituent page does not have the team member '{0}'", teamMember));
         }
     }
 }
コード例 #15
0
ファイル: BatchSteps.cs プロジェクト: blackbaud/uat-kit
 public void WhenIAddABatchWithTemplateAndDescription(string template, string description, Table batchRows)
 {
     description += uniqueStamp;
     StepHelper.SetTodayDateInTableRow("Date", batchRows);
     StepHelper.SetTodayDateInTableRow("Installment start date", batchRows);
     BBCRMHomePage.OpenRevenueFA();
     BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + "//span[text()='Revenue']");
     RevenueFunctionalArea.BatchEntry();
     BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + "//span[text()='Batch Entry']");
     BatchEntryPanel.AddBatch(template, description);
     foreach (var batchRow in batchRows.Rows)
     {
         if (batchRow.Keys.Contains("Constituent") && batchRow["Constituent"] != null &&
             batchRow["Constituent"] != string.Empty)
         {
             batchRow["Constituent"] += uniqueStamp;
         }
     }
     //Set fields in batch
     SetGridRows(batchRows);
 }
コード例 #16
0
        public void GivenIAddAnAppealMailing(Table table)
        {
            //setup date field.  StepHelper for date must come before dynamic objects
            StepHelper.SetTodayDateInTableRow("Mail date", table);
            dynamic objectData = table.CreateDynamicInstance();
            //sorts out date format due to datetime adding 00:00:00
            DateTime findDate = objectData.MailDate;

            //Naviate to Appeal Mailings
            BBCRMHomePage.OpenMarketingAndCommunicationsFA();
            FunctionalArea.OpenLink("Appeal mailings");
            //Click Add button
            Panel.WaitClick(@"//td[contains(@class,'x-toolbar-cell') and not (contains(@class,'x-hide-display'))]//button[text()='Add']");
            //Populate Add appeal mailing form using Dialog.SetField
            Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", objectData.Name + uniqueStamp);
            //need to convert date to a string
            Dialog.SetTextField("//input[contains(@id,'_MAILDATE_value')]", findDate.ToShortDateString());
            Dialog.SetTextField("//input[contains(@id,'_APPEALID_value')]", objectData.Appeal + uniqueStamp);
            //need to appeand (Ad-hoc Query) string in order to match on input
            Dialog.SetTextField("//input[contains(@id,'_IDSETREGISTERID_value')]", objectData.Selection + uniqueStamp + " (Ad-hoc Query)");
            Dialog.SetTextField("//input[contains(@id,'_MKTPACKAGEID_value')]", objectData.Package + uniqueStamp);
            Dialog.Save();
        }
コード例 #17
0
ファイル: EventsSteps.cs プロジェクト: srgleason/uat-kit
        public void ThenInviteesListDisplaysWhereDeclinedIs(string Declined, Table table)
        {
            string sectionCaption = "Invitees";

            StepHelper.SetTodayDateInTableRow("Invitation sent on", table);
            //name format is assumed to be "firstname Surname" we need to reformat to "surnameUniqustamp, forename" like so:
            string[] inviteeNames = table.Rows[0]["Invitee"].Split(' ');
            string   invitee      = inviteeNames[1] + uniqueStamp + ", " + inviteeNames[0];

            TableRow tr = table.Rows[0];

            tr["Invitee"] = invitee;

            if (Panel.SectionDatalistRowExists(table.Rows[0], sectionCaption) != true)
            {
                throw new Exception("Data for " + invitee + " was not displayed as expected!");
            }
            if (Convert.ToBoolean(Declined) != false)
            {
                //check box is class driven by the style "bbui-pages-datalistgrid-check"
                //so we need to find the declined and then nav to the check
                Panel.GetEnabledElement("//div[contains(@style,'visible')]//td/div[./text()='Declined' and not(contains(@title,'Declined'))]/../../../../../../../../div[contains(@class,'x-grid3-scroller')]/div/div/table/tbody/tr/td[contains(@class,'x-grid3-col x-grid3-cell x-grid3-td-formattedValues[8]  bbui-pages-datalistgrid-check')]");
            }
        }
コード例 #18
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
        public void WhenSetTheDetails(Table table)
        {
            if (table.RowCount != 1)
            {
                throw new ArgumentException("Only provide one row for the details.");
            }
            foreach (var details in table.Rows)
            {
                string startDate = details["Start date"].ToString();
                StepHelper.SetTodayDateInTableRow("Start date", details);
                if (details.ContainsKey("Primary manager") && !string.IsNullOrEmpty(details["Primary manager"]))
                {
                    details["Primary manager"] += uniqueStamp;
                }
                if (details.ContainsKey("Secondary manager") && !string.IsNullOrEmpty(details["Secondary manager"]))
                {
                    details["Secondary manager"] += uniqueStamp;
                }
                if (details.ContainsKey("Plan name") && !string.IsNullOrEmpty(details["Plan name"]))
                {
                    details["Plan name"] += uniqueStamp;
                }
                MajorGivingPlanDialog.SetDetails(details);
                DateTime actualStartDate = DateTime.MinValue;

                if (startDate.ToLower().Equals("today"))
                {
                    actualStartDate = DateTime.Now;
                }
                MajorGivingPlanDialog.SetPrimaryManagerStartDate(actualStartDate.ToShortDateString());
                if (details.ContainsKey("Secondary manager") && !string.IsNullOrEmpty(details["Secondary manager"]))
                {
                    MajorGivingPlanDialog.SetSecondaryManagerStartDate(actualStartDate.ToShortDateString());
                }
            }
        }
コード例 #19
0
ファイル: MajorGivingSteps.cs プロジェクト: blackbaud/uat-kit
        public void GivenIAddConstituenciesToTheFollowingConstituents(Table table)
        {
            StepHelper.SetTodayDateInTableRow("Date from", table);
            StepHelper.SetTodayDateInTableRow("Date to", table);
            IList <dynamic> tableData = table.CreateDynamicSet().ToList();

            foreach (dynamic row in tableData)
            {
                //variables
                DateTime startDate = row.DateFrom;
                DateTime endDate   = row.DateTo;
                //navigation
                GetConstituentPanel(row.Surname + uniqueStamp);
                ConstituentPanel.SelectInfoTab();
                ConstituentPanel.SelectInnerTab("Constituencies");
                //set values
                Panel.ClickSectionAddButton("Constituencies");
                Panel.WaitClick(string.Format("//div[contains(@style,'visibility: visible')]//span[./text()='{0}']", row.Constituency));
                Dialog.SetTextField("//input[contains(@id,'_DATEFROM_value')]", startDate.ToShortDateString());
                Dialog.SetTextField("//input[contains(@id,'_DATETO_value')]", endDate.ToShortDateString());
                //save
                Dialog.Save();
            }
        }
コード例 #20
0
ファイル: EventsSteps.cs プロジェクト: srgleason/uat-kit
        public void GivenInvitationToTheEventIncludesAMailPackage(string EventName, Table table)
        {
            #region data setup
            //setup date field.  StepHelper for date must come before dynamic objects
            StepHelper.SetTodayDateInTableRow("Mail date", table);
            dynamic objectData = table.CreateDynamicInstance();
            var     dialogId   = "InvitationAddForm";
            string  sendType   = objectData.HowToSendInvitation;
            string  dateValue  = string.Empty;
            EventName       += uniqueStamp;
            objectData.Name += uniqueStamp;
            //sorts out date format due to datetime adding 00:00:00
            DateTime findDate = objectData.MailDate;
            //fields for adding invitation and mail package
            IDictionary <string, CrmField> Supportedfields = new Dictionary <string, CrmField>
            {
                { "Name", new CrmField("_NAME_value", FieldType.TextInput) },
                { "Description", new CrmField("_DESCRIPTION_value", FieldType.TextArea) },
                { "Mail date", new CrmField("_MAILDATE_value", FieldType.TextInput) },
                { "Send through both mail and email, according to each constituent's preferences", new CrmField("__CHANNELCODE_0", FieldType.Checkbox) },
                { "Send through email only", new CrmField("_CHANNELCODE_1", FieldType.Checkbox) },
                { "Send through mail only", new CrmField("_CHANNELCODE_2", FieldType.Checkbox) },
                { "Mail package", new CrmField("_MAILPACKAGEID_value", FieldType.Searchlist, "PackageSearch", "_NAME_value") }
            };
            #endregion
            //navigation
            GetEventPanel(EventName);
            Panel.SelectTab("Invitations");
            Panel.ClickSectionAddButton("Invitations");
            //tab 1
            Dialog.SetField(dialogId, "Name", objectData.Name, Supportedfields);
            Dialog.SetField(dialogId, "Description", objectData.Description, Supportedfields);
            Dialog.SetField(dialogId, "Mail date", findDate.ToShortDateString(), Supportedfields);
            //tab 2
            Dialog.OpenTab("Processing Options");
            //wait for tab to load
            Dialog.GetEnabledElement(
                "//div[contains(@class, 'x-window bbui-dialog-tabbed bbui-dialog') and contains(@style,'visible')]//label[contains(@for,'CHANNELCODE_0')]",
                15);
            //switch case for how to send invitations
            switch (sendType)
            {
            case "Send through both mail and email, according to each constituent's preferences":
                break;

            case "Send through email only":
                Dialog.SetField(dialogId, "Send through email only", "true", Supportedfields);
                break;

            case "Send through mail only":
                Dialog.SetField(dialogId, "Send through mail only", "true", Supportedfields);
                break;

            default:
                FailTest(string.Format("Test failed checking send type {0}.", sendType));
                break;
            }
            Dialog.SetField(dialogId, "Mail package", objectData.MailPackage + uniqueStamp, Supportedfields);
            //save dialog
            Dialog.Save();
        }