public void AgendaCopyDelete()
        {
            Event evt = new Event("AgendaCopyDelete");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("agenda1");
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("agenda2");
            evt.AgendaPage.AgendaItems.Add(agenda1);
            evt.AgendaPage.AgendaItems.Add(agenda2);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);

            Registrant reg = new Registrant(evt);
            AgendaResponse_Checkbox resp = new AgendaResponse_Checkbox();
            resp.AgendaItem = agenda1;
            resp.Checked = true;
            reg.CustomField_Responses.Add(resp);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);
            KeywordProvider.SignIn.SignIn(EventFolders.Folders.RegistrationInventory);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Id);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.EditForm_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.GotoPage(FormData.Page.Agenda);

            PageObject.Builder.RegistrationFormPages.AgendaRow row1 = new PageObject.Builder.RegistrationFormPages.AgendaRow(agenda1);
            PageObject.Builder.RegistrationFormPages.AgendaRow row2 = new PageObject.Builder.RegistrationFormPages.AgendaRow(agenda2);
            Assert.True(row1.Delete.GetAttribute("src").Contains("deletex_Off.gif"));
            row2.Copy_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CopyAgendaAmount.Type(1);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.OK_Click();
            Assert.AreEqual(agenda2.NameOnForm + " Copy1",
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnReports.Value);
            row2.Delete_Click();
            Assert.False(row2.Agenda.IsPresent);
        }
        public void TestAccessCode()
        {
            evt = new Event("AccessCodeFixture");
            paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
            regType = new RegType("RegType");
            regType.Price = 50;
            CustomFieldCode ac1 = new CustomFieldCode("ac1");
            ac1.CodeType = FormData.CustomFieldCodeType.AccessCode;
            ac1.Limit = 2;
            regType.AllCustomCodes.Add(ac1);
            CustomFieldCode ac2 = new CustomFieldCode("ac2");
            ac2.CodeType = FormData.CustomFieldCodeType.AccessCode;
            regType.AllCustomCodes.Add(ac2);
            evt.StartPage.RegTypes.Add(regType);

            agenda = new AgendaItem_CheckBox("Agenda");
            agenda.Price = 80;
            CustomFieldCode ac3 = new CustomFieldCode("ac3");
            ac3.CodeType = FormData.CustomFieldCodeType.AccessCode;
            ac3.Limit = 2;
            CustomFieldCode ac4 = new CustomFieldCode("ac4");
            ac4.CodeType = FormData.CustomFieldCodeType.AccessCode;
            agenda.DiscountCodes.Add(ac3);
            agenda.DiscountCodes.Add(ac4);
            agenda.BulkCodes = CustomFieldCode.GenerateBulkCodes(agenda.DiscountCodes);
            evt.AgendaPage = new AgendaPage();
            evt.AgendaPage.AgendaItems.Add(agenda);

            merch = new MerchandiseItem("Merch");
            merch.Type = FormData.MerchandiseType.Fixed;
            merch.Price = 110;
            CustomFieldCode ac5 = new CustomFieldCode("ac5");
            ac5.CodeType = FormData.CustomFieldCodeType.AccessCode;
            merch.DiscountCodes.Add(ac5);
            evt.MerchandisePage = new MerchandisePage();
            evt.MerchandisePage.Merchandises.Add(merch);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false, true);

            Registrant reg1 = this.GenerateReg(ac1, ac3, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
            Registrant reg2 = this.GenerateReg(ac1, ac3, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
            Registrant reg3 = this.GenerateReg(ac1, ac4, ac5);
            KeywordProvider.RegistrationCreation.Checkin(reg3);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(string.Format(Messages.RegisterError.RegTypeCodeLimitHasReached, ac1.CodeString)));
            Registrant reg4 = this.GenerateReg(ac2, ac3, ac5);
            KeywordProvider.RegistrationCreation.Checkin(reg4);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg4);
            KeywordProvider.RegistrationCreation.Agenda(reg4);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.AgendaCodeLimitReached));
            Registrant reg5 = this.GenerateReg(ac2, ac4, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg5);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
        }
        public void AgendaDetailsAndGroupName()
        {
            Event evt = new Event("AgendaDetailsAndGroupName");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agendaDetails = new AgendaItem_CheckBox("AgendaDetails");
            agendaDetails.DetailsPopup = "DetailsPopup";
            AgendaItem_CheckBox agendaDetailsURL = new AgendaItem_CheckBox("AgendaDetailsURL");
            agendaDetailsURL.DetailsURL = "www.baidu.com";
            AgendaItem_CheckBox agendaGroup1 = new AgendaItem_CheckBox("AgendaGroup1");
            agendaGroup1.GroupName = "nameOfGroup";
            AgendaItem_CheckBox agendaGroup2 = new AgendaItem_CheckBox("AgendaGroup2");
            agendaGroup2.GroupName = "nameOfGroup";
            evt.AgendaPage.AgendaItems.Add(agendaDetails);
            evt.AgendaPage.AgendaItems.Add(agendaDetailsURL);
            evt.AgendaPage.AgendaItems.Add(agendaGroup1);
            evt.AgendaPage.AgendaItems.Add(agendaGroup2);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg = new Registrant(evt);
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agendaGroup1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = agendaGroup2;
            resp2.Checked = true;
            reg.CustomField_Responses.Add(resp1);
            reg.CustomField_Responses.Add(resp2);

            KeywordProvider.RegistrationCreation.Checkin(reg);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            PageObject.Register.AgendaRow row1 = new PageObject.Register.AgendaRow(agendaDetails);
            PageObject.Register.AgendaRow row2 = new PageObject.Register.AgendaRow(agendaDetailsURL);
            row1.Details.Click();
            Assert.AreEqual(PageObject.PageObjectProvider.Register.RegistationSite.Agenda.AgendaDetailsPopup.Text,
                agendaDetails.DetailsPopup);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.CloseDetailsPopup_Click();
            row2.Details.Click();
            System.Threading.Thread.Sleep(1500);
            PageObject.PageObjectHelper.SelectTopWindow();
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Agenda.AgendaDetailsWindow.URLContains(agendaDetailsURL.DetailsURL));
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.AgendaDetailsWindow.CloseAndBackToPrevious();
            KeywordProvider.RegistrationCreation.Agenda(reg);
            KeywordProvider.RegistrationCreation.Checkout(reg);
            List<WebElements.Label> selectedAgenda = PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.GetSelectedAgendaItems();
            Assert.IsNull(selectedAgenda.Find(a => a.Text == agendaGroup1.NameOnForm));
            Assert.IsNotNull(selectedAgenda.Find(a => a.Text == agendaGroup2.NameOnForm));
        }
        public void AgendaCalendaAndEventWeb()
        {
            Event evt = new Event("AgendaCalendaAndEventWeb");
            evt.AgendaPage = new AgendaPage();
            evt.EventWebsite = new EventWebsite();
            evt.EventWebsite.UseEventWebsiteAsTheStartingPageForEvent = true;
            evt.EventWebsite.ShowNavigation = true;
            AgendaItem_CheckBox agendaAddToCalenda = new AgendaItem_CheckBox("AddToCalenda");
            agendaAddToCalenda.StartDate = DateTime.Today.AddDays(-3);
            agendaAddToCalenda.EndDate = DateTime.Today.AddDays(3);
            agendaAddToCalenda.AddToCalendar = true;
            agendaAddToCalenda.IncludeOnEventWeb = false;
            AgendaItem_CheckBox includeOnEventWeb = new AgendaItem_CheckBox("OnEventWeb");
            includeOnEventWeb.StartDate = DateTime.Today.AddDays(4);
            includeOnEventWeb.EndDate = DateTime.Today.AddDays(7);
            includeOnEventWeb.AddToCalendar = false;
            includeOnEventWeb.IncludeOnEventWeb = true;
            evt.AgendaPage.AgendaItems.Add(agendaAddToCalenda);
            evt.AgendaPage.AgendaItems.Add(includeOnEventWeb);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg = new Registrant(evt);
            reg.Register_Method = RegisterMethod.EventWebsite;
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agendaAddToCalenda;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = includeOnEventWeb;
            resp2.Checked = true;
            reg.CustomField_Responses.Add(resp1);
            reg.CustomField_Responses.Add(resp2);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.EventWebsite.Agenda_Click();
            Assert.True(PageObject.PageObjectHelper.IsTextPresent(includeOnEventWeb.NameOnForm));
            Assert.False(PageObject.PageObjectHelper.IsTextPresent(agendaAddToCalenda.NameOnForm));
            PageObject.PageObjectProvider.Register.RegistationSite.EventWebsite.RegisterNow_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            KeywordProvider.RegistrationCreation.Agenda(reg);
            KeywordProvider.RegistrationCreation.Checkout(reg);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.AddToCalendar(agendaAddToCalenda).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.AddToCalendar(includeOnEventWeb).IsPresent);
        }
        public void GoBackLink()
        {
            Event GoBackLink = new Event("RI-GoBackLink");
            AgendaItem_CheckBox agenda = new AgendaItem_CheckBox("GroupAgenda");
            AgendaPage agendaPage = new AgendaPage();
            agendaPage.AgendaItems.Add(agenda);
            GoBackLink.AgendaPage = agendaPage;

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, GoBackLink);

            Registrant reg = new Registrant(GoBackLink);

            KeywordProvider.RegistrationCreation.Checkin(reg);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.GoBack_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.Agenda, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.GoBack_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.Checkout, true);
            KeywordProvider.RegistrationCreation.Checkout(reg);
        }
        public void ButtonTest()
        {
            Event evt = new Event("AgendaButtonTest");
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("agenda1");
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("agenda2");

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.RegistrationInventory);

            if (KeywordProvider.ManagerDefault.DoesEventExist(evt.Title))
            {
                KeywordProvider.ManagerDefault.DeleteEvent(evt.Title);
            }

            KeywordProvider.EventCreator.ClickAddEventAndGetEventId(evt);
            KeywordProvider.EventCreator.StartPage(evt);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.GotoPage(FormData.Page.Agenda);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.YesOnSplashPage_Click();
            KeywordProvider.AddAgendaItem.AddAgendaItems(agenda1, evt);
            int id = Convert.ToInt32(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AgendaItemId.Value);
            PageObject.Builder.RegistrationFormPages.AgendaRow row1 = new PageObject.Builder.RegistrationFormPages.AgendaRow(agenda1);
            Assert.True(row1.Agenda.IsPresent);
            Assert.AreEqual(row1.Agenda.GetAttribute("class"), "hs colwidth1");
            KeywordProvider.AddAgendaItem.AddAgendaItems(agenda2, evt);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.SaveAndNew_Click();
            Assert.AreNotEqual(id, Convert.ToInt32(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AgendaItemId.Value));
            Assert.AreEqual(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnForm.Text, "");
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.Cancel_Click();
            Assert.AreEqual(id, Convert.ToInt32(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AgendaItemId.Value));
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnForm.Type("NameChanged");
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.Cancel_Click();
            Assert.AreEqual(id, Convert.ToInt32(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AgendaItemId.Value));
            Assert.AreEqual(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnForm.Text, agenda1.NameOnForm);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnForm.Type("NameChanged");
            PageObject.PageObjectProvider.Builder.EventDetails.SaveAndStay_Click();
            Assert.AreEqual(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.NameOnForm.Text, "NameChanged");
        }
        public void AgendaStatus()
        {
            Event evt = new Event("AgendaStatus");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox ag1 = new AgendaItem_CheckBox("ag1");
            AgendaItem_CheckBox ag2 = new AgendaItem_CheckBox("ag2");
            ag2.InitialStatus = FormData.AgendaInitialStatus.Pending;
            AgendaItem_CheckBox ag3 = new AgendaItem_CheckBox("ag3");
            ag3.InitialStatus = FormData.AgendaInitialStatus.Confirmed;
            AgendaItem_CheckBox ag4 = new AgendaItem_CheckBox("ag4");
            ag4.InitialStatus = FormData.AgendaInitialStatus.Approved;
            AgendaItem_CheckBox ag5 = new AgendaItem_CheckBox("ag5");
            ag5.InitialStatus = FormData.AgendaInitialStatus.Declined;
            AgendaItem_CheckBox ag6 = new AgendaItem_CheckBox("ag6");
            ag6.InitialStatus = FormData.AgendaInitialStatus.NoShow;
            AgendaItem_CheckBox ag7 = new AgendaItem_CheckBox("ag7");
            ag7.InitialStatus = FormData.AgendaInitialStatus.FollowUp;
            evt.AgendaPage.AgendaItems.Add(ag1);
            evt.AgendaPage.AgendaItems.Add(ag2);
            evt.AgendaPage.AgendaItems.Add(ag3);
            evt.AgendaPage.AgendaItems.Add(ag4);
            evt.AgendaPage.AgendaItems.Add(ag5);
            evt.AgendaPage.AgendaItems.Add(ag6);
            evt.AgendaPage.AgendaItems.Add(ag7);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = ag1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = ag2;
            resp2.Checked = true;
            AgendaResponse_Checkbox resp3 = new AgendaResponse_Checkbox();
            resp3.AgendaItem = ag3;
            resp3.Checked = true;
            AgendaResponse_Checkbox resp4 = new AgendaResponse_Checkbox();
            resp4.AgendaItem = ag4;
            resp4.Checked = true;
            AgendaResponse_Checkbox resp5 = new AgendaResponse_Checkbox();
            resp5.AgendaItem = ag5;
            resp5.Checked = true;
            AgendaResponse_Checkbox resp6 = new AgendaResponse_Checkbox();
            resp6.AgendaItem = ag6;
            resp6.Checked = true;
            AgendaResponse_Checkbox resp7 = new AgendaResponse_Checkbox();
            resp7.AgendaItem = ag7;
            resp7.Checked = true;

            Registrant reg = new Registrant(evt);
            reg.CustomField_Responses.Add(resp1);
            reg.CustomField_Responses.Add(resp2);
            reg.CustomField_Responses.Add(resp3);
            reg.CustomField_Responses.Add(resp4);
            reg.CustomField_Responses.Add(resp5);
            reg.CustomField_Responses.Add(resp6);
            reg.CustomField_Responses.Add(resp7);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.RegistrationInventory);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Id);
            PageObject.PageObjectProvider.Manager.Dashboard.DashboardTab_Click(FormData.DashboardTab.Reports);
            PageObject.PageObjectProvider.Manager.Dashboard.Reports.AgendaReportLink_Click();

            PageObject.Reports.StandardReports agendaReport = new PageObject.Reports.StandardReports(FormData.StandardReports.AgendaReport);

            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag1.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag2.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "Pending");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag3.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "Confirmed");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag4.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "Approved");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag5.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "Declined");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag6.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "No-show");
            Assert.AreEqual(agendaReport.AgendaReportRows.Find(r => r.AgendaName.Text.Contains(ag7.NameOnForm)).Attendees[0].AgendaStatus.Text.Trim(), "Follow-up");

            agendaReport.CloseAndBackToPrevious();
        }
        public void AgendaForceGroup()
        {
            Event evt = new Event("AgendaForceGroup");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox ag1 = new AgendaItem_CheckBox("ag1");
            ag1.ForceGroupToMatch = true;
            AgendaItem_CheckBox ag2 = new AgendaItem_CheckBox("ag2");
            ag2.ForceGroupToMatch = true;
            ag2.Gender = FormData.Gender.Male;
            AgendaItem_CheckBox ag3 = new AgendaItem_CheckBox("ag3");
            ag3.ForceGroupToMatch = true;
            ag3.AgeGreaterThan = 20;
            ag3.AgeGreaterThanDate = DateTime.Today;
            AgendaItem_CheckBox ag4 = new AgendaItem_CheckBox("ag4");
            ag4.ForceGroupToMatch = true;
            AgendaItem_CheckBox ag5 = new AgendaItem_CheckBox("ag5");
            ag5.ForceGroupToMatch = true;
            ag5.ConditionalLogic.Add(ag4.NameOnForm);
            AgendaItem_CheckBox ag6 = new AgendaItem_CheckBox("ag6");
            ag6.ForceGroupToMatch = true;
            AgendaItem_CheckBox ag7 = new AgendaItem_CheckBox("ag7");
            ag7.ConditionalLogic.Add(ag6.NameOnForm);
            evt.AgendaPage.AgendaItems.Add(ag1);
            evt.AgendaPage.AgendaItems.Add(ag2);
            evt.AgendaPage.AgendaItems.Add(ag3);
            evt.AgendaPage.AgendaItems.Add(ag4);
            evt.AgendaPage.AgendaItems.Add(ag5);
            evt.AgendaPage.AgendaItems.Add(ag6);
            evt.AgendaPage.AgendaItems.Add(ag7);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = ag1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = ag2;
            resp2.Checked = true;
            AgendaResponse_Checkbox resp3 = new AgendaResponse_Checkbox();
            resp3.AgendaItem = ag3;
            resp3.Checked = true;
            AgendaResponse_Checkbox resp4 = new AgendaResponse_Checkbox();
            resp4.AgendaItem = ag4;
            resp4.Checked = true;
            AgendaResponse_Checkbox resp5 = new AgendaResponse_Checkbox();
            resp5.AgendaItem = ag5;
            resp5.Checked = true;
            AgendaResponse_Checkbox resp6 = new AgendaResponse_Checkbox();
            resp6.AgendaItem = ag6;
            resp6.Checked = true;
            AgendaResponse_Checkbox resp7 = new AgendaResponse_Checkbox();
            resp7.AgendaItem = ag7;
            resp7.Checked = true;

            Registrant reg1 = new Registrant(evt);
            reg1.Gender = FormData.Gender.Male;
            reg1.BirthDate = DateTime.Today.AddYears(-22);
            reg1.CustomField_Responses.Add(resp1);
            reg1.CustomField_Responses.Add(resp2);
            reg1.CustomField_Responses.Add(resp3);
            reg1.CustomField_Responses.Add(resp4);
            reg1.CustomField_Responses.Add(resp5);
            reg1.CustomField_Responses.Add(resp6);
            reg1.CustomField_Responses.Add(resp7);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            KeywordProvider.RegistrationCreation.PerformDefaultActions_Agenda(reg1);

            PageObject.Register.AgendaRow row1 = new PageObject.Register.AgendaRow(ag1);
            PageObject.Register.AgendaRow row2 = new PageObject.Register.AgendaRow(ag2);
            PageObject.Register.AgendaRow row3 = new PageObject.Register.AgendaRow(ag3);
            PageObject.Register.AgendaRow row4 = new PageObject.Register.AgendaRow(ag4);
            PageObject.Register.AgendaRow row5 = new PageObject.Register.AgendaRow(ag5);
            PageObject.Register.AgendaRow row6 = new PageObject.Register.AgendaRow(ag6);
            PageObject.Register.AgendaRow row7 = new PageObject.Register.AgendaRow(ag7);

            Registrant reg2 = new Registrant(evt);
            reg2.Gender = FormData.Gender.Male;
            reg2.BirthDate = DateTime.Today.AddYears(-18);

            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg2.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg2);
            Assert.True(((WebElements.CheckBox)(row1.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row1.AgendaType)).HasAttribute("disabled"));
            Assert.True(((WebElements.CheckBox)(row2.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row2.AgendaType)).HasAttribute("disabled"));
            Assert.False(((WebElements.CheckBox)(row3.AgendaType)).IsPresent);
            Assert.True(((WebElements.CheckBox)(row4.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row4.AgendaType)).HasAttribute("disabled"));
            Assert.True(((WebElements.CheckBox)(row5.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row5.AgendaType)).HasAttribute("disabled"));
            Assert.True(((WebElements.CheckBox)(row6.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row6.AgendaType)).HasAttribute("disabled"));
            Assert.False(((WebElements.CheckBox)(row7.AgendaType)).IsChecked);
            Assert.False(((WebElements.CheckBox)(row7.AgendaType)).HasAttribute("disabled"));
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();

            Registrant reg3 = new Registrant(evt);
            reg3.Gender = FormData.Gender.Female;
            reg3.BirthDate = DateTime.Today.AddYears(-22);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg3.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg3);
            Assert.False(((WebElements.CheckBox)(row2.AgendaType)).IsPresent);
            Assert.True(((WebElements.CheckBox)(row3.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row3.AgendaType)).HasAttribute("disabled"));

            Registrant reg4 = new Registrant(evt);
            reg4.Gender = FormData.Gender.Male;
            reg4.BirthDate = DateTime.Today.AddYears(-22);
            reg4.CustomField_Responses.Add(resp4);

            KeywordProvider.RegistrationCreation.Checkin(reg4);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg4);
            KeywordProvider.RegistrationCreation.Agenda(reg4);
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();

            Registrant reg5 = new Registrant(evt);
            reg5.Gender = FormData.Gender.Male;
            reg5.BirthDate = DateTime.Today.AddYears(-22);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg5.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg5);
            Assert.True(((WebElements.CheckBox)(row4.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row4.AgendaType)).HasAttribute("disabled"));
            Assert.False(((WebElements.CheckBox)(row5.AgendaType)).IsChecked);
            Assert.True(((WebElements.CheckBox)(row5.AgendaType)).HasAttribute("disabled"));
        }
        public void AgendaEmailAddendum()
        {
            Event evt = new Event("AgendaEmailAddendum");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agendaWithEmailAddendum = new AgendaItem_CheckBox("EmailAddendumAG");
            agendaWithEmailAddendum.ConfirmationAddendum = "ConfirmationAddendum";
            evt.AgendaPage.AgendaItems.Add(agendaWithEmailAddendum);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg = new Registrant(evt);
            AgendaResponse_Checkbox resp = new AgendaResponse_Checkbox();
            resp.AgendaItem = agendaWithEmailAddendum;
            resp.Checked = true;
            reg.CustomField_Responses.Add(resp);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            PageObject.PageObjectProvider.Builder.EmailViewer.OpenURL(evt.Id, reg.Id);
            Assert.True(PageObject.PageObjectHelper.IsTextPresent(agendaWithEmailAddendum.ConfirmationAddendum));
        }
        public void AgendaShowIf()
        {
            Event evt = new Event("AgendaShowIf");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox showToMale = new AgendaItem_CheckBox("ShowToMale");
            showToMale.Gender = FormData.Gender.Male;
            AgendaItem_CheckBox showToFemale = new AgendaItem_CheckBox("ShowToFemale");
            showToFemale.Gender = FormData.Gender.Female;
            AgendaItem_CheckBox showOver20 = new AgendaItem_CheckBox("ShowOver20");
            showOver20.AgeGreaterThan = 20;
            showOver20.AgeGreaterThanDate = DateTime.Today;
            AgendaItem_CheckBox showLT20 = new AgendaItem_CheckBox("ShowLT20");
            showLT20.AgeLessThan = 20;
            showLT20.AgeLessThanDate = DateTime.Today;
            evt.AgendaPage.AgendaItems.Add(showToMale);
            evt.AgendaPage.AgendaItems.Add(showToFemale);
            evt.AgendaPage.AgendaItems.Add(showOver20);
            evt.AgendaPage.AgendaItems.Add(showLT20);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg1 = new Registrant(evt);
            reg1.Gender = FormData.Gender.Male;
            reg1.BirthDate = DateTime.Today.AddYears(-22);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showToMale, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showToFemale, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showOver20, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showLT20, false);

            Registrant reg2 = new Registrant(evt);
            reg2.Gender = FormData.Gender.Female;
            reg2.BirthDate = DateTime.Today.AddYears(-18);

            KeywordProvider.RegistrationCreation.Checkin(reg2);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg2);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showToMale, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showToFemale, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showOver20, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showLT20, true);
        }
        public void AgendaShowHideDate()
        {
            Event evt = new Event("AgendaShowHideDate");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox showInPast = new AgendaItem_CheckBox("ShowInPast");
            showInPast.ShowStarting = DateTime.Today.AddDays(-3);
            AgendaItem_CheckBox showInFuture = new AgendaItem_CheckBox("ShowInFuture");
            showInFuture.ShowStarting = DateTime.Today.AddDays(3);
            AgendaItem_CheckBox hideInPast = new AgendaItem_CheckBox("HideInPast");
            hideInPast.HideStarting = DateTime.Today.AddDays(-3);
            AgendaItem_CheckBox hideInFuture = new AgendaItem_CheckBox("HideInFuture");
            hideInFuture.HideStarting = DateTime.Today.AddDays(3);
            AgendaItem_CheckBox sIPHIF = new AgendaItem_CheckBox("SIPHIF");
            sIPHIF.ShowStarting = DateTime.Today.AddDays(-3);
            sIPHIF.HideStarting = DateTime.Today.AddDays(3);
            evt.AgendaPage.AgendaItems.Add(showInPast);
            evt.AgendaPage.AgendaItems.Add(showInFuture);
            evt.AgendaPage.AgendaItems.Add(hideInPast);
            evt.AgendaPage.AgendaItems.Add(hideInFuture);
            evt.AgendaPage.AgendaItems.Add(sIPHIF);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);

            Registrant reg = new Registrant(evt);

            KeywordProvider.RegistrationCreation.Checkin(reg);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showInPast, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(showInFuture, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(hideInPast, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(hideInFuture, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(sIPHIF, true);
        }
        public void UpdateReg()
        {
            Event evt = new Event("AgendaUpdateReg");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("Agenda1");
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("Agenda2");
            AgendaItem_CheckBox agenda3 = new AgendaItem_CheckBox("Agenda3");
            evt.AgendaPage.AgendaItems.Add(agenda1);
            evt.AgendaPage.AgendaItems.Add(agenda2);
            evt.AgendaPage.AgendaItems.Add(agenda3);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg = new Registrant(evt);
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agenda1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = agenda2;
            resp2.Checked = true;
            AgendaResponse_Checkbox resp3 = new AgendaResponse_Checkbox();
            resp3.AgendaItem = agenda3;
            resp3.Checked = true;
            reg.CustomField_Responses.Add(resp1);
            reg.CustomField_Responses.Add(resp2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.ChangeMyRegistration_Click();
            KeywordProvider.RegistrationCreation.Login(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.AttendeeCheck.Agenda_Click(0);
            resp2.Checked = false;
            reg.CustomField_Responses.Add(resp2);
            reg.CustomField_Responses.Add(resp3);
            KeywordProvider.RegistrationCreation.Agenda(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.Checkout(reg);

            List<WebElements.Label> selectedAgendas = PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.GetSelectedAgendaItems();
            Assert.IsNotNull(selectedAgendas.Find(s => s.Text == agenda1.NameOnForm));
            Assert.IsNull(selectedAgendas.Find(s => s.Text == agenda2.NameOnForm));
            Assert.IsNotNull(selectedAgendas.Find(s => s.Text == agenda3.NameOnForm));
        }
        public void BackendUpdate()
        {
            Event evt = new Event("AgendaBackendUpdate");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("Agenda1");
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("Agenda2");
            AgendaItem_CheckBox agenda3 = new AgendaItem_CheckBox("Agenda3");
            AgendaItem_CheckBox agenda4 = new AgendaItem_CheckBox("Agenda4");
            agenda4.SpacesAvailable = 1;
            AgendaItem_CheckBox agenda5 = new AgendaItem_CheckBox("Agenda5");
            agenda5.Gender = FormData.Gender.Male;
            evt.AgendaPage.AgendaItems.Add(agenda1);
            evt.AgendaPage.AgendaItems.Add(agenda2);
            evt.AgendaPage.AgendaItems.Add(agenda3);
            evt.AgendaPage.AgendaItems.Add(agenda4);
            evt.AgendaPage.AgendaItems.Add(agenda5);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false, true);

            Registrant reg1 = new Registrant(evt);
            reg1.Gender = FormData.Gender.Male;
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agenda1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = agenda2;
            resp2.Checked = true;
            AgendaResponse_Checkbox resp3 = new AgendaResponse_Checkbox();
            resp3.AgendaItem = agenda3;
            resp3.Checked = true;
            AgendaResponse_Checkbox resp4 = new AgendaResponse_Checkbox();
            resp4.AgendaItem = agenda4;
            resp4.Checked = true;
            AgendaResponse_Checkbox resp5 = new AgendaResponse_Checkbox();
            resp5.AgendaItem = agenda5;
            resp5.Checked = false;
            reg1.CustomField_Responses.Add(resp1);
            reg1.CustomField_Responses.Add(resp2);
            reg1.CustomField_Responses.Add(resp3);
            reg1.CustomField_Responses.Add(resp4);
            reg1.CustomField_Responses.Add(resp5);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);

            Registrant reg2 = new Registrant(evt);
            reg2.Gender = FormData.Gender.Female;
            reg2.CustomField_Responses.Add(resp1);
            reg2.CustomField_Responses.Add(resp2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);

            PageObject.Backend.AttendeeInfo attendeeInfo = new PageObject.Backend.AttendeeInfo();
            attendeeInfo.OpenUrl(reg2.Id);
            resp2.Checked = false;
            reg2.CustomField_Responses.Add(resp2);
            reg2.CustomField_Responses.Add(resp3);
            reg2.CustomField_Responses.Add(resp4);
            resp5.Checked = true;
            reg2.CustomField_Responses.Add(resp5);
            KeywordProvider.BackendUpdate.UpdateCustomField(reg2);
            Assert.True(attendeeInfo.AgendaLable(agenda1).IsPresent);
            Assert.False(attendeeInfo.AgendaLable(agenda2).IsPresent);
            Assert.True(attendeeInfo.AgendaLable(agenda3).IsPresent);
            Assert.True(attendeeInfo.AgendaLable(agenda4).IsPresent);
            Assert.True(attendeeInfo.AgendaLable(agenda5).IsPresent);
        }
        public void OverlappingAgenda()
        {
            Event evt = new Event("AgendaOverlapping");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("agenda1");
            agenda1.StartDate = DateTime.Today.AddDays(3);
            agenda1.EndDate = DateTime.Today.AddDays(9);
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("agenda2");
            agenda2.StartDate = DateTime.Today.AddDays(6);
            agenda2.EndDate = DateTime.Today.AddDays(12);
            evt.AgendaPage.AgendaItems.Add(agenda1);
            evt.AgendaPage.AgendaItems.Add(agenda2);
            evt.AgendaPage.DoNotAllowOverlapping = true;

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);

            Registrant reg1 = new Registrant(evt);
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agenda1;
            resp1.Checked = true;
            AgendaResponse_Checkbox resp2 = new AgendaResponse_Checkbox();
            resp2.AgendaItem = agenda2;
            resp2.Checked = true;
            reg1.CustomField_Responses.Add(resp1);
            reg1.CustomField_Responses.Add(resp2);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            KeywordProvider.RegistrationCreation.Agenda(reg1);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.AgendaOverlapped));

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.RegistrationInventory);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Id);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.EditForm_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.GotoPage(FormData.Page.Agenda);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.DoNotAllowOverlapping.Set(false);
            PageObject.PageObjectProvider.Builder.EventDetails.SaveAndClose_Click();

            Registrant reg2 = new Registrant(evt);
            reg2.CustomField_Responses.Add(resp1);
            reg2.CustomField_Responses.Add(resp2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
        }
        public void AgendaConditionalLogic()
        {
            Event evt = new Event("AgendaConditionalLogic");
            CFCheckBox PICustomField = new CFCheckBox("PICustomField");
            evt.PersonalInfoPage.CustomFields.Add(PICustomField);
            evt.AgendaPage = new DataCollection.AgendaPage();
            AgendaItem_Number AGNumber = new AgendaItem_Number("AGNumber");
            AGNumber.CharLimit = 10;
            AgendaItem_OneLineText AGText = new AgendaItem_OneLineText("AGText");
            AGText.CharLimit = 10;
            AgendaItem_Paragraph AGPara = new AgendaItem_Paragraph("AGPara");
            AGPara.CharLimit = 1000;
            AgendaItem_Date AGDate = new AgendaItem_Date("AGDate");
            AgendaItem_Time AGTime = new AgendaItem_Time("AGTime");
            AgendaItem_Header AGHeader = new AgendaItem_Header("AGHeader");
            AgendaItem_ContinueButton AGContinue = new AgendaItem_ContinueButton("AGContinue");
            AgendaItem_Contribution AGConribution = new AgendaItem_Contribution("AGConribution");
            AGConribution.MinAmount = 10;
            AGConribution.MaxAmount = 100;
            AgendaItem_FileUpload AGUpload = new AgendaItem_FileUpload("AGUpload");
            AgendaItem_CheckBox AGCheckBox = new AgendaItem_CheckBox("AGCheckBox");
            AgendaItem_MultipleChoice_RadioButton AGRadio = new AgendaItem_MultipleChoice_RadioButton("AGRadio");
            AGRadio.CommonlyUsedItems.Add(FormData.CommonlyUsedMultipleChoice.YesOrNo);
            AgendaItem_MultipleChoice_DropDown AGDropDown = new AgendaItem_MultipleChoice_DropDown("AGDropDown");
            AGDropDown.CommonlyUsedItems.Add(FormData.CommonlyUsedMultipleChoice.Agreement);
            AgendaItem_AlwaysSelected AGAlways = new AgendaItem_AlwaysSelected("AGAlways");
            AgendaItem_CheckBox AG1 = new AgendaItem_CheckBox("AG1");
            AG1.ConditionalLogic.Add(PICustomField.NameOnForm);
            evt.AgendaPage.AgendaItems.Add(AGNumber);
            evt.AgendaPage.AgendaItems.Add(AGText);
            evt.AgendaPage.AgendaItems.Add(AGPara);
            evt.AgendaPage.AgendaItems.Add(AGDate);
            evt.AgendaPage.AgendaItems.Add(AGTime);
            evt.AgendaPage.AgendaItems.Add(AGHeader);
            evt.AgendaPage.AgendaItems.Add(AGContinue);
            evt.AgendaPage.AgendaItems.Add(AGConribution);
            evt.AgendaPage.AgendaItems.Add(AGUpload);
            evt.AgendaPage.AgendaItems.Add(AGCheckBox);
            evt.AgendaPage.AgendaItems.Add(AGRadio);
            evt.AgendaPage.AgendaItems.Add(AGDropDown);
            evt.AgendaPage.AgendaItems.Add(AGAlways);
            evt.AgendaPage.AgendaItems.Add(AG1);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);

            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Id);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.EditForm_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.GotoPage(FormData.Page.Agenda);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddAgendaItem_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ExpandConditionalLogic_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ExpandConditionalLogic_Click();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGCheckBox.NameOnForm).IsPresent);
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGRadio.NameOnForm).IsPresent);
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGDropDown.NameOnForm).IsPresent);
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AG1.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGNumber.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGText.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGPara.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGDate.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGTime.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGHeader.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGContinue.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGConribution.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGUpload.NameOnForm).IsPresent);
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AGAlways.NameOnForm).IsPresent);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.Cancel_Click();

            AgendaItem_CheckBox AG2 = new AgendaItem_CheckBox("AG2");
            AgendaItem_CheckBox AG3 = new AgendaItem_CheckBox("AG3");
            AG3.ConditionalLogic.Add(AG2.NameOnForm);

            KeywordProvider.AddAgendaItem.AddAgendaItems(AG2, evt);
            KeywordProvider.AddAgendaItem.AddAgendaItems(AG3, evt);
            PageObject.Builder.RegistrationFormPages.AgendaRow row1 = new PageObject.Builder.RegistrationFormPages.AgendaRow(AG2);
            row1.Delete_Click();
            PageObject.Builder.RegistrationFormPages.AgendaRow row2 = new PageObject.Builder.RegistrationFormPages.AgendaRow(AG1);
            row2.Agenda_Click();
            PageObject.Builder.RegistrationFormPages.AgendaRow row3 = new PageObject.Builder.RegistrationFormPages.AgendaRow(AG3);
            row3.Agenda_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ExpandConditionalLogic_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ExpandConditionalLogic_Click();
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.ConditionalLogicParent(AG2.NameOnForm).IsPresent);

            AgendaItem_CheckBox AG4 = new AgendaItem_CheckBox("AG4");
            AG4.ConditionalLogic.Add(AG3.NameOnForm);
            KeywordProvider.AddAgendaItem.AddAgendaItems(AG4, evt);

            Registrant reg1 = new Registrant(evt);
            CFResponse_Checkbox resp = new CFResponse_Checkbox();
            resp.CustomField = PICustomField;
            resp.Checked = true;
            reg1.CustomField_Responses.Add(resp);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            PageObject.Register.AgendaRow row4 = PageObject.PageObjectProvider.Register.RegistationSite.Agenda.GetAgendaItem(AG1);
            Assert.True(row4.AgendaType.IsPresent);
            ((CheckBox)(PageObject.PageObjectProvider.Register.RegistationSite.Agenda.GetAgendaItem(AG3).AgendaType)).Set(true);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Agenda.GetAgendaItem(AG4).AgendaType.IsPresent);

            Registrant reg2 = new Registrant(evt);

            KeywordProvider.RegistrationCreation.Checkin(reg2);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg2);
            Assert.False(row4.AgendaType.IsPresent);
        }
        private void GenerateEventForTaxRate(bool applyTaxOne, bool applyTaxTwo, FormData.Countries? country)
        {
            this.evt = new Event("TaxFixture");
            this.regType = new RegType("regType");
            this.paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            TaxRate tax1 = new TaxRate("tax1");
            if (country.HasValue)
            {
                tax1.Country = country.Value;
            }
            tax1.Rate = 50;
            TaxRate tax2 = new TaxRate("tax2");
            tax2.Rate = 10;
            regType.Price = 50;
            regType.ApplyTaxOne = applyTaxOne;
            regType.ApplyTaxTwo = applyTaxTwo;
            evt.TaxRateOne = tax1;
            evt.TaxRateTwo = tax2;
            evt.StartPage.RegTypes.Add(regType);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
            this.agenda = new AgendaItem_CheckBox("agenda");
            agenda.Price = 60;
            agenda.ApplyTaxOne = applyTaxOne;
            agenda.ApplyTaxTwo = applyTaxTwo;
            evt.AgendaPage = new AgendaPage();
            evt.AgendaPage.AgendaItems.Add(agenda);
            this.merch = new MerchandiseItem("merch");
            merch.Type = FormData.MerchandiseType.Fixed;
            merch.Price = 70;
            merch.ApplyTaxOne = applyTaxOne;
            merch.ApplyTaxTwo = applyTaxTwo;
            evt.MerchandisePage = new MerchandisePage();
            evt.MerchandisePage.Merchandises.Add(merch);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);
        }
        public void AgendaVisibility()
        {
            Event evt = new Event("AgendaVisibility");
            evt.AgendaPage = new AgendaPage();
            RegType regType1 = new RegType("RegType1");
            RegType regType2 = new RegType("RegType2");
            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);
            AgendaItem_CheckBox visToAll = new AgendaItem_CheckBox("VisToAll");
            AgendaItem_CheckBox visToType1 = new AgendaItem_CheckBox("VisToType1");
            CustomFieldVisibleOption visibleOption1 = new CustomFieldVisibleOption(regType1);
            visibleOption1.Visible = true;
            visToType1.CustomFieldVisibleOption.Add(visibleOption1);
            AgendaItem_CheckBox reqByType2 = new AgendaItem_CheckBox("ReqByType2");
            CustomFieldVisibleOption visibleOption2 = new CustomFieldVisibleOption(regType2);
            visibleOption2.Required = true;
            reqByType2.CustomFieldVisibleOption.Add(visibleOption2);
            AgendaItem_CheckBox adminOnly = new AgendaItem_CheckBox("AdminOnly");
            CustomFieldVisibleOption visibleOption3 = new CustomFieldVisibleOption();
            visibleOption3.AdminOnly = true;
            adminOnly.CustomFieldVisibleOption.Add(visibleOption3);
            AgendaItem_CheckBox adminAndReq = new AgendaItem_CheckBox("AdminAndReq");
            CustomFieldVisibleOption visibleOption4 = new CustomFieldVisibleOption();
            visibleOption4.AdminOnly = true;
            visibleOption4.Required = true;
            adminAndReq.CustomFieldVisibleOption.Add(visibleOption4);
            evt.AgendaPage.AgendaItems.Add(visToAll);
            evt.AgendaPage.AgendaItems.Add(visToType1);
            evt.AgendaPage.AgendaItems.Add(reqByType2);
            evt.AgendaPage.AgendaItems.Add(adminOnly);
            evt.AgendaPage.AgendaItems.Add(adminAndReq);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg3 = new Registrant(evt);
            reg3.EventFee_Response = new EventFeeResponse(regType1);
            reg3.Register_Method = RegisterMethod.Admin;

            KeywordProvider.RegistrationCreation.Checkin(reg3);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg3);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToAll, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToType1, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(reqByType2, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminOnly, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminAndReq, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.RequiredCheckBoxNotChecked));

            Registrant reg2 = new Registrant(evt);
            reg2.EventFee_Response = new EventFeeResponse(regType2);

            KeywordProvider.RegistrationCreation.Checkin(reg2);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg2);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToAll, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToType1, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(reqByType2, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminOnly, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminAndReq, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.RequiredCheckBoxNotChecked));

            Registrant reg1 = new Registrant(evt);
            reg1.EventFee_Response = new EventFeeResponse(regType1);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToAll, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(visToType1, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(reqByType2, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminOnly, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.VerifyAgendaItemDisplay(adminAndReq, false);
        }
        public void VerifyGloableEventDisplay()
        {
            Event Event = new Event("RI-VerifyDisplay");
            Event.StartPage.Location = "Sichuan";
            Event.StartPage.Phone = "8888888888";
            Event.StartPage.Country = "United States";
            Event.StartPage.Address1 = "Fuxing Road No.1";
            Event.StartPage.Address2 = "Huamin Empire Plaza";
            Event.StartPage.City = "Chengdu";
            Event.StartPage.State = "Alaska";
            Event.StartPage.Zip = "12345";
            Event.StartPage.ContactInfo = "Contact us!";
            Event.StartPage.EventHome = "www.google.com";
            Event.StartPage.PageHeader = "This is checkin Page Header.";
            Event.StartPage.PageFooter = "This is checkin Page Footer.";
            Event.PersonalInfoPage.PageHeader = "This is personal info Page Header.";
            Event.PersonalInfoPage.PageFooter = "This is personal info Page Footer.";

            AgendaItem_CheckBox agendaItem = new AgendaItem_CheckBox(DateTime.Now.Ticks.ToString());
            DataCollection.AgendaPage agendaPage = new DataCollection.AgendaPage();
            agendaPage.AgendaItems.Add(agendaItem);
            agendaPage.PageHeader = "This is agenda Page Header.";
            agendaPage.PageFooter = "This is agenda Page Footer.";
            Event.AgendaPage = agendaPage;

            LodgingStandardFields field = new LodgingStandardFields();
            field.Field = FormData.LodgingStandardFields.RoomType;
            field.Visible = true;
            Lodging lodging = new Lodging();
            lodging.StandardFields.Add(field);
            LodgingTravelPage lodgingTravelPage = new LodgingTravelPage();
            lodgingTravelPage.Lodging = lodging;
            lodgingTravelPage.PageHeader = "This is lodging travel Page Header.";
            lodgingTravelPage.PageFooter = "This is lodging travel Page Footer.";
            Event.LodgingTravelPage = lodgingTravelPage;

            MerchandiseItem merchandise = new MerchandiseItem(DateTime.Now.AddSeconds(1).Ticks.ToString());
            merchandise.Type = FormData.MerchandiseType.Header;
            MerchandisePage merchandisePage = new MerchandisePage();
            merchandisePage.Merchandises.Add(merchandise);
            merchandisePage.PageHeader = "This is merchandise Page Header.";
            merchandisePage.PageFooter = "This is merchandise Page Footer.";
            Event.MerchandisePage = merchandisePage;

            Event.CheckoutPage.PageHeader = "This is checkout Page Header.";
            Event.CheckoutPage.PageFooter = "This is checkout Page Footer.";

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, Event, false, false);
            Registrant reg = new Registrant(Event);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            VerifyFooterResults footerResults = KeywordProvider.Display.VerifyCompanyFooter();
            VerifyEventDetailsResult eventDetailsResults = KeywordProvider.Display.VerifyEventDetails();
            VerifyPageResults pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(footerResults.Trustwave);
            Assert.True(footerResults.Facebook);
            Assert.True(footerResults.Twitter);
            Assert.True(footerResults.Linkedin);
            Assert.True(footerResults.Copyright == "Copyright © 2012 The Active Network, Inc.");
            Assert.True(footerResults.TermsOfUse);
            Assert.True(footerResults.PrivacyPolicy);
            Assert.True(footerResults.CookiePolicy);
            Assert.True(footerResults.About);
            Assert.True(footerResults.ActiveCom);

            Assert.True(eventDetailsResults.EventTitle == Event.Title);
            Assert.True((eventDetailsResults.Location == Event.StartPage.Location) || (eventDetailsResults.Location == null));
            Assert.True((eventDetailsResults.Phone == Event.StartPage.Phone) || (eventDetailsResults.Phone == null));
            Assert.True((eventDetailsResults.Address1 == Event.StartPage.Address1) || (eventDetailsResults.Address1 == null));
            Assert.True((eventDetailsResults.Address2 == Event.StartPage.Address2) || (eventDetailsResults.Address2 == null));
            Assert.True((eventDetailsResults.City == Event.StartPage.City) || (eventDetailsResults.City == null));
            Assert.True((eventDetailsResults.State == Event.StartPage.State) || (eventDetailsResults.State == null));
            Assert.True((eventDetailsResults.Zip == Event.StartPage.Zip) || (eventDetailsResults.Zip == null));
            Assert.True((eventDetailsResults.Country == Event.StartPage.Country) || (eventDetailsResults.Country == null));
            Assert.True(eventDetailsResults.EventContactInfo.Contains(Event.StartPage.ContactInfo) && eventDetailsResults.Contact.Contains(Event.StartPage.ContactInfo));

            Assert.True(pageResults.PageHeader.Contains(Event.StartPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.StartPage.PageFooter));

            KeywordProvider.RegistrationCreation.Checkin(reg);
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.PersonalInfoPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.PersonalInfoPage.PageFooter));

            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.AgendaPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.AgendaPage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.LodgingTravelPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.LodgingTravelPage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.MerchandisePage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.MerchandisePage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.CheckoutPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.CheckoutPage.PageFooter));
        }
        public void RecalculateTotal()
        {
            Event evt = new Event("AgendaRecalculate");
            evt.AgendaPage = new AgendaPage();
            AgendaItem_CheckBox agenda1 = new AgendaItem_CheckBox("agenda1");
            agenda1.Price = 50;
            AgendaItem_CheckBox agenda2 = new AgendaItem_CheckBox("agenda2");
            agenda2.Price = 60;
            CustomFieldCode discount = new CustomFieldCode("discount");
            discount.Amount = 10;
            discount.CodeDirection = FormData.ChangePriceDirection.Decrease;
            discount.CodeKind = FormData.ChangeType.Percent;
            discount.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            agenda2.DiscountCodes.Add(discount);
            evt.AgendaPage.AgendaItems.Add(agenda1);
            evt.AgendaPage.AgendaItems.Add(agenda2);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false);

            Registrant reg = new Registrant(evt);

            KeywordProvider.RegistrationCreation.Checkin(reg);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            PageObject.Register.AgendaRow row1 = new PageObject.Register.AgendaRow(agenda1);
            PageObject.Register.AgendaRow row2 = new PageObject.Register.AgendaRow(agenda2);
            ((WebElements.CheckBox)(row1.AgendaType)).Set(true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.RecalculateTotal_Click();
            Assert.AreEqual(agenda1.Price, KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Agenda));
            ((WebElements.CheckBox)(row2.AgendaType)).Set(true);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.RecalculateTotal_Click();
            Assert.AreEqual(agenda1.Price + agenda2.Price, KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Agenda));
            ((WebElements.CheckBox)(row1.AgendaType)).Set(false);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.RecalculateTotal_Click();
            Assert.AreEqual(agenda2.Price, KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Agenda));
            row2.DiscountCodeInput.Type(discount.CodeString);
            PageObject.PageObjectProvider.Register.RegistationSite.Agenda.RecalculateTotal_Click();
            Assert.AreEqual(54, KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Agenda));
        }