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(); }
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)); }
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(); }
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)); }
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(); }
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); }