Esempio n. 1
0
        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();
        }
Esempio 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();
     }
 }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        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));
                }
            }
        }
Esempio n. 5
0
 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();
 }
        public void WhenIGetTheAttachmentsOfTheIssue()
        {
            IIssue issue = GetSavedIssue();
            IEnumerable <IAttachment> attachments = StepHelper.GetAttachments(GetSavedIssue());

            ScenarioContext.Current.Set(attachments);
        }
Esempio n. 7
0
        public void ThenACommentIsAddedToTheIssue()
        {
            IEnumerable <IComment> comments = StepHelper.GetComments(GetSavedIssue());
            IComment comment = comments.Single();

            Assert.That(comment.Text, Is.EqualTo(CommentText));
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
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!");
            }
        }
Esempio n. 10
0
        public void ThenTheTypeIsChanged()
        {
            IIssue savedIssue = GetSavedIssue();

            IIssue issue = StepHelper.GetIssue(savedIssue.Id);

            Assert.That(issue.Type, Is.EqualTo(IssueType));
        }
Esempio n. 11
0
        public void ThenTheSubsystemIsChanged()
        {
            IIssue savedIssue = GetSavedIssue();

            IIssue issue = StepHelper.GetIssue(savedIssue.Id);

            Assert.That(issue.Subsystem, Is.EqualTo(Subsystem));
        }
Esempio n. 12
0
        internal static TResult StepRunner <TResult>(string stepName, Delegate del, bool throwEx,
                                                     Status stepStatusIfFailed,
                                                     params object[] stepParams)
        {
            var       stepStatus = Status.passed;
            Exception throwedEx  = null;
            var       stepHelper = new StepHelper(stepName);
            var       resultFunc = default(TResult);
            var       uuid       = $"{Guid.NewGuid():N}";
            var       stepResult = new StepResult
            {
                name  = stepName,
                start = ToUnixTimestamp(DateTimeOffset.Now)
            };

            Instance.StartStep(uuid, stepResult);
            ReportHelper.AddStepParameters(stepParams, uuid);
            try
            {
                switch (del)
                {
                case Action action when resultFunc is bool:
                    action.Invoke();
                    resultFunc = (TResult)(object)true;
                    break;

                case Func <TResult> func:
                    resultFunc = func.Invoke();
                    break;

                default:
                    resultFunc = (TResult)del.DynamicInvoke();
                    break;
                }

                stepStatus = stepHelper.GetStepStatus();
            }
            catch (Exception e)
            {
                bool needRethrow;
                (stepStatus, throwedEx, needRethrow) = stepHelper.ProceedException(e, stepStatusIfFailed);
                if (throwEx)
                {
                    throwEx = needRethrow;
                }
            }
            finally
            {
                Instance.UpdateStep(step => step.status = stepStatus);
                Instance.StopStep(uuid);
            }

            if (throwEx && throwedEx != null)
            {
                ExceptionDispatchInfo.Capture(throwedEx).Throw();
            }
            return(resultFunc);
        }
Esempio n. 13
0
 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);
     }
 }
        void ITestTracer.TraceError(Exception ex)
        {
            TraceError(ex);
            var stepText = "";

            AllureLifecycle.Instance.UpdateStep(x => { stepText = x.name; });
            var stepHelper = new StepHelper(stepText);

            stepHelper.ProceedException(ex);
            AllureLifecycle.Instance.StopStep(x => x.status = Status.failed);
            FailScenario(ex);
        }
Esempio n. 15
0
        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()));
        }
Esempio n. 16
0
        public void WhenIAuthenticateWith(string login, string password, string baseUrl)
        {
            StepHelper.InitializeYouTrackClient(baseUrl, login, password);

            try
            {
                StepHelper.GetSession().Login();
            }
            catch (RequestFailedException e)
            {
                Console.WriteLine("Exception catched: {0}", e);
            }
        }
Esempio n. 17
0
 public void GivenConstituentIsMarkedAsDeceasedWithSourceOf(string ConstituentName, string source)
 {
     //lets set the thread culture to get the correct date for the browser
     StepHelper.SetCurrentThreadCultureToConfigValue();
     SearchAndSelectConstituent(ConstituentName);
     //select personal info
     Panel.SelectTab("Personal Info");
     //select "mark deceased"
     BaseComponent.WaitClick("//table[.//div[./text()='Personal information']]/tbody/tr/td[8]//button[./text()='Mark deceased']");
     Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@id,'DECEASEDDATE_value')]", DateTime.Now.ToShortDateString());
     Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@id,'DECEASEDSOURCECODEID_value')]", source);
     StepHelper.AddEntryOnTheFly();
     Dialog.Save();
 }
Esempio n. 18
0
 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);
     }
 }
Esempio n. 19
0
        public void Teardown()
        {
            Console.WriteLine("Tearing down the Scenario...");

            if (HasSavedIssue())
            {
                string issueId = GetSavedIssue().Id;

                if (StepHelper.IssueExists(issueId))
                {
                    StepHelper.DeleteIssue(issueId);
                }
            }
        }
Esempio n. 20
0
        public void ThenAnOpportunityIsAssociatedWithTheMajorGivingPlanCalled(string majorGivingPlan, Table table)
        {
            //lets set the thread culture to get the correct date for the browser
            StepHelper.SetCurrentThreadCultureToConfigValue();
            dynamic objectData = table.CreateDynamicInstance();
            var     date90Days = DateTime.Now.AddDays(Convert.ToInt32(objectData.ExpectedAskDateFromNow)).ToShortDateString();

            //check the plan matches
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//h2[contains(@class, 'bbui-pages-header')]//span[./text()='Major giving - {0}']", majorGivingPlan + uniqueStamp));
            //check there is an opportunity
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + "//button[contains(@class, 'x-btn-text') and ./text()='Go to opportunity']");
            //check values that were entered in the previous step are actually displayed
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[contains(@id, '_STATUS_value') and ./text()='{0}']", objectData.Status));
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[contains(@id, '_EXPECTEDASKAMOUNT_value') and ./text()='{0}']", objectData.ExpectedAskAmount));
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisiblePanel + string.Format("//span[contains(@id, '_EXPECTEDASKDATE_value') and ./text()='{0}']", date90Days));
        }
Esempio n. 21
0
 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);
     }
 }
Esempio n. 22
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();
 }
Esempio n. 23
0
        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();
            }
        }
Esempio n. 24
0
        public void WhenISendTheInvitation()
        {
            string inviteeList = "Invitee List";

            //lets set the thread culture to get the correct date for the browser
            StepHelper.SetCurrentThreadCultureToConfigValue();
            //use Business process method from Batch steps class
            BatchSteps BatchSteps = new BatchSteps();

            //click send
            BaseComponent.WaitClick("//button[contains(@class,'bbui-linkbutton')]//div[contains(text(), 'Send')]");
            //check is visible
            BaseComponent.GetEnabledElement("//label[contains(@id, '_MAILDATE_caption')]");
            //click start
            Panel.ClickButton("Start");
            BatchSteps.ThenTheBatchCommitsWithoutErrorsOrExceptionsAndRecordProcessed(1);
            //Click Invitee list
            BaseComponent.WaitClick(XpathHelper.xPath.VisiblePanel + string.Format("//button[contains(@class,'bbui-linkbutton') and ./text()='{0}']", inviteeList));
        }
Esempio n. 25
0
        public void WhenIAddToAssestsTab(Table table)
        {
            dynamic objectData = table.CreateDynamicInstance();

            //edit planned gift
            BaseComponent.WaitClick("//div[./text()='Edit planned gift']");
            BaseComponent.WaitClick(XpathHelper.xPath.VisibleDialog + "//span[./text()='Assets']");
            Dialog.WaitClick(XpathHelper.xPath.VisibleDialog + "//div[contains(@class,'x-grid3-cell-inner x-grid3-col-ASSETTYPECODEID')]");
            Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@class,'x-form-text x-form-field x-form-focus')]", objectData.Type);
            StepHelper.AddEntryOnTheFly();
            Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@class,'x-form-text x-form-field x-form-text-required')]", objectData.Description);
            Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@class,'x-form-text x-form-field bbui-forms-collectiongrid-right')]", Convert.ToString(objectData.Value));
            Dialog.GetEnabledElement(XpathHelper.xPath.VisibleDialog + "//td[contains(@class,'x-grid3-col x-grid3-cell x-grid3-td-VALUE')]/div[./text()='$100.00']");
            Dialog.GetEnabledElement(XpathHelper.xPath.VisibleDialog + "//div[contains(@class,'x-grid3-cell-inner x-grid3-col-ASSETVALUATIONMETHODCODEID')]");
            Dialog.WaitClick(XpathHelper.xPath.VisibleDialog + "//div[contains(@class,'x-grid3-cell-inner x-grid3-col-ASSETVALUATIONMETHODCODEID')]");
            Dialog.SetTextField(XpathHelper.xPath.VisibleDialog + "//input[contains(@class,'x-form-text x-form-field x-form-focus')]", objectData.ValuationMethod);
            StepHelper.AddEntryOnTheFly();
            Dialog.Save();
        }
Esempio n. 26
0
 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));
         }
     }
 }
Esempio n. 27
0
 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);
 }
Esempio n. 28
0
        public void WhenIHaveSelectedAddFromTheOpportunitiesTab(Table table)
        {
            var sectionCaption = "Opportunities";

            //lets set the thread culture to get the correct date for the browser
            StepHelper.SetCurrentThreadCultureToConfigValue();
            dynamic objectData = table.CreateDynamicInstance();

            //select tab
            Panel.SelectTab(sectionCaption);
            BaseComponent.GetEnabledElement(Panel.getXSectionAddButton(sectionCaption));
            //select add dialog
            BaseComponent.WaitClick(Panel.getXSectionAddButton(sectionCaption));
            //adding check is visible for page load.
            BaseComponent.GetEnabledElement(XpathHelper.xPath.VisibleBlock + "//label[text()='Plan name:']");
            //set fields
            Dialog.SetDropDown(XpathHelper.xPath.VisibleBlock + "//input[contains(@id,'_STATUSCODE_value')]", objectData.Status);
            Dialog.SetTextField(XpathHelper.xPath.VisibleBlock + "//input[contains(@id,'_EXPECTEDASKAMOUNT_value')]", objectData.ExpectedAskAmount);
            Dialog.SetTextField(XpathHelper.xPath.VisibleBlock + "//input[contains(@id,'_EXPECTEDASKDATE_value')]", DateTime.Now.AddDays(Convert.ToInt32(objectData.ExpectedAskDateFromNow)).ToShortDateString());
            Dialog.Save();
        }
Esempio n. 29
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);
            }
        }
Esempio n. 30
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();
        }