public void GroupEventFeeGroupDiscount()
        {
            Event groupEventFeeGroupDiscount = new Event("RI-GroupEventFeeGroupDiscount");
            GroupDiscount groupDiscount = new GroupDiscount();
            groupDiscount.GroupSize = 2;
            groupDiscount.GroupSizeOption = GroupDiscount_GroupSizeOption.SizeOrMore;
            groupDiscount.DiscountAmount = 1;
            groupDiscount.GroupDiscountType = GroupDiscount_DiscountType.USDollar;
            groupDiscount.AddtionalRegOption = GroupDiscount_AdditionalRegOption.AnyAdditional;
            groupEventFeeGroupDiscount.StartPage.GroupDiscount = groupDiscount;
            RegType regType = new RegType("First");
            regType.Price = 50;
            groupEventFeeGroupDiscount.StartPage.RegTypes.Add(regType);
            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            groupEventFeeGroupDiscount.CheckoutPage.PaymentMethods.Add(paymentMethod);

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

            Registrant reg1 = new Registrant(groupEventFeeGroupDiscount);
            reg1.EventFee_Response = new EventFeeResponse(groupEventFeeGroupDiscount.StartPage.RegTypes[0]);
            reg1.Payment_Method = paymentMethod;
            Registrant reg2 = new Registrant(groupEventFeeGroupDiscount);
            reg1.EventFee_Response = new EventFeeResponse(groupEventFeeGroupDiscount.StartPage.RegTypes[0]);
            Group group = new Group();
            group.Primary = reg1;
            group.Secondaries.Add(reg2);

            KeywordProvider.RegistrationCreation.GroupRegistration(group);
        }
        public void SingleRegisterNoneSSO()
        {
            Event evt = new Event("SingleRegisterNoneSSO");
            RegType regType1 = new RegType("SSORegType");
            regType1.IsSSO = true;
            evt.StartPage.RegTypes.Add(regType1);
            RegType regType2 = new RegType("NoneSSORegType");
            evt.StartPage.RegTypes.Add(regType2);

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

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

            Registrant reg2 = new Registrant(evt, SSOData.SSOTestEmail);
            reg2.Password = SSOData.SSOPassword;
            reg2.EventFee_Response = new EventFeeResponse(regType2);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);
            KeywordProvider.RegistrationCreation.Checkout(reg1);

            KeywordProvider.RegistrationCreation.Checkin(reg2);
            if (PageObject.PageObjectProvider.Register.RegistationSite.IsOnPage(FormData.RegisterPage.Login))
            {
                PageObject.PageObjectProvider.Register.RegistationSite.Login.StartNewRegistration_Click();
            }
            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.EmailAlreadyUsed));
        }
        public void SSOOnsiteKiosk()
        {
            Event evt = new Event("SSOOnsiteKiosk");
            evt.IsActive = true;
            RegType regType1 = new RegType("SSORegType");
            regType1.IsSSO = true;
            RegType regType2 = new RegType("NoneSSORegType");
            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);

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

            Registrant reg1 = new Registrant(evt, SSOData.SSOTestEmail);
            reg1.Password = SSOData.SSOPassword;
            reg1.EventFee_Response = new EventFeeResponse(regType1);
            Registrant reg2 = new Registrant(evt);
            reg2.EventFee_Response = new EventFeeResponse(regType2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.SSO);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Id);
            KeywordProvider.ChangeEventStatus.EventStatusChange(evt, FormData.EventStatus.OnSite);

            DataCollection.OnsiteKiosk kiosk = new DataCollection.OnsiteKiosk();
            kiosk.RequireAuthentication = true;
            kiosk.AllowOnsiteReg = true;

            KeywordProvider.LaunchKiosk.LaunchOnsiteKiosk(kiosk);

            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.SearchCondition.Type(reg1.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.Enter_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.SSOLogin, true);
            KeywordProvider.RegistrationCreation.SSOLogin(reg1);
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.NewSearch_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.SearchCondition.Type(reg2.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.Enter_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.Password.Type(DataCollection.DefaultPersonalInfo.Password);
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.SubmitPassword_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.NewSearch_Click();

            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.OnsiteRegister_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(SSOData.SSOJustNameEmail);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType1);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.SSOLogin, true);
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.GoBackToPreviousPage();
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.GoBackToPreviousPage();
            PageObject.PageObjectProvider.Register.RegistationSite.OnsiteKiosk.OnsiteRegister_Click();
            Registrant reg3 = new Registrant(evt);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg3.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(regType2);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);

            DataAccess.AccessData.SetLiveRegToTest(evt.Id);
        }
        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 ActivateSSOEvent()
        {
            RegOnline.RegressionTest.DataAccess.AccessData.ApprovedXAuthRoleForCurrentCustomer(true);

            Event evt = new Event("ActivateSSOEvent");
            RegType ssoRegType = new RegType("SSORegType");
            ssoRegType.IsSSO = true;
            RegType nonSSORegType = new RegType("NonSSORegType");
            evt.StartPage.RegTypes.Add(ssoRegType);
            evt.StartPage.RegTypes.Add(nonSSORegType);

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

            Registrant reg = new Registrant(evt, SSOData.SSOTestEmail);
            reg.Password = SSOData.SSOPassword;
            reg.EventFee_Response = new EventFeeResponse(ssoRegType);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.SSO);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Title);
            PageObject.PageObjectProvider.Manager.Dashboard.Activate_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.RemoveTestReg.IsChecked);
            Assert.True(PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.RemoveTestReg.HasAttribute("disabled"));
            PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.Cancel_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdParty_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.SelectByName();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.ExternalAuthentication_Click();
            PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Type(SSOData.SSOEndpointURL + "add");
            PageObject.PageObjectProvider.Manager.SSOBase.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.Refresh();
            Assert.AreEqual(0, Convert.ToInt32(PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.TotalRegs.Text));
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdParty_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.SelectByName();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.ExternalAuthentication_Click();
            PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Type(SSOData.SSOEndpointURL);
            PageObject.PageObjectProvider.Manager.SSOBase.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.Activate_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.SelectByName();
            PageObject.PageObjectProvider.Manager.Dashboard.ActivateEvent.Activate_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.DashboardTab_Click(FormData.DashboardTab.EventDetails);
            PageObject.PageObjectProvider.Manager.Dashboard.ReturnToList_Click();

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.SSO);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Title);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdParty_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.SelectByName();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.ExternalAuthentication_Click();
            Assert.True(PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.HasAttribute("disabled"));
        }
 public void TestRegTypeWithDiscountCodeAccessCode()
 {
     evt = new Event("TestRegTypeWithDiscountCodeAccessCode");
     paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
     evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
     //regtype1 no price
     RegType regType1 = new RegType("RegType1");
     //regtype2 has price, no code
     RegType regType2 = new RegType("RegType2");
     regType2.Price = 10;
     //regtype2 has price, has code
     RegType regType3 = new RegType("RegType3");
     regType3.Price = 100;
     CustomFieldCode dc1 = new CustomFieldCode("dc1");
     dc1.Amount = 10;
     dc1.CodeDirection = FormData.ChangePriceDirection.Decrease;
     dc1.CodeKind = FormData.ChangeType.FixedAmount;
     dc1.CodeType = FormData.CustomFieldCodeType.DiscountCode;
     CustomFieldCode ac1 = new CustomFieldCode("ac1");
     ac1.CodeType = FormData.CustomFieldCodeType.AccessCode;
     regType3.AllCustomCodes.Add(dc1);
     regType3.AllCustomCodes.Add(ac1);
     evt.StartPage.RegTypes.Add(regType1);
     evt.StartPage.RegTypes.Add(regType2);
     evt.StartPage.RegTypes.Add(regType3);
     KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);
     Registrant reg1 = new Registrant(evt);
     reg1.Payment_Method = paymentMethod;
     reg1.EventFee_Response = new EventFeeResponse(regType1);
     KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
     Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.Total.IsPresent);
     Registrant reg2 = new Registrant(evt);
     reg2.Payment_Method = paymentMethod;
     reg2.EventFee_Response = new EventFeeResponse(regType2);
     KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
     Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 10);
     Registrant reg3 = new Registrant(evt);
     reg3.Payment_Method = paymentMethod;
     reg3.EventFee_Response = new EventFeeResponse(regType3);
     reg3.EventFee_Response.Code = dc1;
     KeywordProvider.RegistrationCreation.CreateRegistration(reg3);
     Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 90);
     Registrant reg4 = new Registrant(evt);
     reg4.Payment_Method = paymentMethod;
     reg4.EventFee_Response = new EventFeeResponse(regType3);
     reg4.EventFee_Response.Code = ac1;
     KeywordProvider.RegistrationCreation.CreateRegistration(reg4);
     Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 100);
 }
        public void GroupRegisterNoneSSO()
        {
            Event evt = new Event("GroupRegisterNoneSSO");
            RegType regType1 = new RegType("SSORegType1");
            regType1.IsSSO = true;
            RegType regType2 = new RegType("SSORegType2");
            regType2.IsSSO = true;
            RegType regType3 = new RegType("NoneSSORegType1");
            RegType regType4 = new RegType("NoneSSORegType2");
            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);
            evt.StartPage.RegTypes.Add(regType3);
            evt.StartPage.RegTypes.Add(regType4);

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

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

            KeywordProvider.RegistrationCreation.Checkin(reg1);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg1);

            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyRegTypeDisplay(regType1, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyRegTypeDisplay(regType2, false);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyRegTypeDisplay(regType3, true);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyRegTypeDisplay(regType4, true);

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

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg2.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(reg2.EventFee_Response.RegType);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg2);
            KeywordProvider.RegistrationCreation.Checkout(reg2);
            PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.ChangeMyRegistration_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.Login, true);
            KeywordProvider.RegistrationCreation.Login(reg1);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.AttendeeCheck, true);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.AttendeeCheck.Substitute(0).IsPresent);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.AttendeeCheck.Substitute(1).IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.Checkout(reg2);
        }
        public void SSODirectory()
        {
            Event evt = new Event("AttendeeDirectory");
            RegType regType1 = new RegType("SSORegType");
            regType1.IsSSO = true;
            RegType regType2 = new RegType("NoneSSORegType");
            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);

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

            Registrant reg1 = new Registrant(evt, SSOData.SSOTestEmail);
            reg1.Password = SSOData.SSOPassword;
            reg1.EventFee_Response = new EventFeeResponse(regType1);
            Registrant reg2 = new Registrant(evt);
            reg2.EventFee_Response = new EventFeeResponse(regType2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.SSO);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Title);
            PageObject.PageObjectProvider.Manager.Dashboard.DashboardTab_Click(FormData.DashboardTab.Directories);

            AttendeeDirectory attendeeDirectory = new AttendeeDirectory("SSODirectory");
            attendeeDirectory.ShareDirectory = true;
            attendeeDirectory.RequireLogin = true;

            string directoryURL = KeywordProvider.AddAttendeeDirectory.CreateAttendeeDirectory(attendeeDirectory);
            PageObject.PageObjectProvider.Manager.Dashboard.DashboardTab_Click(FormData.DashboardTab.EventDetails);
            PageObject.PageObjectProvider.Manager.Dashboard.ReturnToList_Click();

            PageObject.PageObjectHelper.NavigateTo(directoryURL);
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.EmailAddress.Type(reg1.Email);
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.Continue_Click();
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.IsOnPage(FormData.RegisterPage.SSOLogin));
            KeywordProvider.RegistrationCreation.SSOLogin(reg1);
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.SignOut_Click();

            PageObject.PageObjectProvider.Reports.AttendeeDirectory.EmailAddress.Type(reg2.Email);
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.Continue_Click();
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.Password.Type(DataCollection.DefaultPersonalInfo.Password);
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.Continue_Click();
            PageObject.PageObjectProvider.Reports.AttendeeDirectory.SignOut_Click();
        }
        public void SingleRegisterSSO()
        {
            Event evt = new Event("SingleRegisterSSO");
            RegType regType = new RegType("SSORegType");
            regType.IsSSO = true;
            evt.StartPage.RegTypes.Add(regType);

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

            Registrant reg = new Registrant(evt, SSOData.SSOTestEmail);
            reg.Password = SSOData.SSOPassword;
            reg.EventFee_Response = new EventFeeResponse(regType);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.SSOLogin, true);
            KeywordProvider.RegistrationCreation.SSOLogin(SSOData.SSOJustNameEmail, SSOData.SSOPassword);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.SSOLogin, true);
            KeywordProvider.RegistrationCreation.SSOLogin(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.Password.IsPresent);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(FormData.PersonalInfoField.Email).HasAttribute("value"));
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(FormData.PersonalInfoField.FirstName).HasAttribute("value"));
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(FormData.PersonalInfoField.MiddleName).HasAttribute("value"));
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(FormData.PersonalInfoField.LastName).HasAttribute("value"));
            PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.JobTitle.Type("Automation");
            reg.JobTitle = "Automation";
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.Checkout(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.ChangeMyRegistration_Click();
            AssertHelper.VerifyOnPage(FormData.RegisterPage.SSOLogin, true);
            KeywordProvider.RegistrationCreation.SSOLogin(reg);
            AssertHelper.VerifyOnPage(FormData.RegisterPage.AttendeeCheck, true);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.AttendeeCheck.Substitute(0).IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.AttendeeCheck.PersonalInfoLink_Click(0);
            Assert.True(reg.JobTitle == PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.JobTitle.Value);
        }
        public Registrant CreateEventAndRegisterWithRegType()
        {
            Event eventWithRegType = new Event("RI-SingleRegistrationWithRegType");
            RegType regType1 = new RegType("First");
            RegType regType2 = new RegType("Second");
            eventWithRegType.StartPage.RegTypes.Add(regType1);
            eventWithRegType.StartPage.RegTypes.Add(regType2);

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

            Registrant registrant = new Registrant(eventWithRegType, string.Format("selenium{0}@regonline.com", System.DateTime.Now.Ticks.ToString()));
            registrant.EventFee_Response = new EventFeeResponse(eventWithRegType.StartPage.RegTypes[1]);

            KeywordProvider.RegistrationCreation.Checkin(registrant);

            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);

            KeywordProvider.RegistrationCreation.PersonalInfo(registrant);
            KeywordProvider.RegistrationCreation.Checkout(registrant);

            return registrant;
        }
        public void EventFeeEaylyPrice_Registrants()
        {
            Event eventFeeEaylyPrice_Registrants = new Event("RI-EventFeeEaylyPrice-Registrants");
            RegType regType = new RegType("First");
            EarlyPrice earlyPrice = new EarlyPrice();
            earlyPrice.earlyPrice = 40;
            earlyPrice.EarlyPriceType = FormData.EarlyPriceType.Registrants;
            earlyPrice.FirstNRegistrants = 1;
            regType.EarlyPrice = earlyPrice;
            regType.Price = 50;
            eventFeeEaylyPrice_Registrants.StartPage.RegTypes.Add(regType);
            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            eventFeeEaylyPrice_Registrants.CheckoutPage.PaymentMethods.Add(paymentMethod);

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

            Registrant registrant = new Registrant(eventFeeEaylyPrice_Registrants);
            registrant.EventFee_Response = new EventFeeResponse(eventFeeEaylyPrice_Registrants.StartPage.RegTypes[0]);
            registrant.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.Checkin(registrant);
            KeywordProvider.RegistrationCreation.PersonalInfo(registrant);

            Assert.True(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation) == earlyPrice.earlyPrice);

            KeywordProvider.RegistrationCreation.Checkout(registrant);

            Registrant registrant1 = new Registrant(eventFeeEaylyPrice_Registrants);
            registrant1.EventFee_Response = new EventFeeResponse(eventFeeEaylyPrice_Registrants.StartPage.RegTypes[0]);
            registrant1.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.Checkin(registrant1);
            KeywordProvider.RegistrationCreation.PersonalInfo(registrant1);

            Assert.True(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation) == regType.Price.Value);

            KeywordProvider.RegistrationCreation.Checkout(registrant1);
        }
        public void DisableGroupReg()
        {
            Event evt = new Event("RI-DisableGroupReg");
            evt.StartPage.AllowGroupReg = false;
            RegType regType = new RegType("AdditionalDetails");
            regType.AdditionalDetails = "This is additional details.";
            evt.StartPage.RegTypes.Add(regType);

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

            Registrant reg = new Registrant(evt);
            reg.EventFee_Response = new EventFeeResponse(regType);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeDetails_Click(reg.EventFee_Response.RegType);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.AdditionalDetails.Text.Trim().Equals(regType.AdditionalDetails));
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeDetails_Close_Click();
            KeywordProvider.RegistrationCreation.Checkin(reg);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson.IsPresent);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson.IsPresent);
            KeywordProvider.RegistrationCreation.Checkout(reg);
        }
        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 CustomFieldVisibleOption(RegType regType)
 {
     this.RegType = regType;
 }
 public CustomFieldVisibleOption()
 {
     this.RegType = null;
 }
        public void Add_RegType(RegType regType, Event evt)
        {
            if (regType.AdditionalDetails != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.Title.Type(DateTime.Now.Ticks.ToString());
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.Shortcut.Type("char" + DateTime.Now.Ticks.ToString());
                PageObject.PageObjectProvider.Builder.EventDetails.SaveAndStay_Click();
            }

            if (PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EmptyAddRegType.IsPresent)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EmptyAddRegType_Click();
            }
            else
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.AddRegType_Click();
            }

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdjustRADWindowPositionAndResize();

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();

            #region RegTypeBasics
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.NameOnForm.Type(regType.Name);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.NameOnReports.Type(regType.Name);

            if (regType.RegTypeLimit != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeLimit.Set(true);

                switch (regType.RegTypeLimit.LimitType)
                {
                    case FormData.RegLimitType.Individual:
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.LimitToIndividual_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.IndividualLimit.Type(regType.RegTypeLimit.LimitTo);
                        break;
                    case FormData.RegLimitType.Group:
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.LimitToGroup_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.GroupLimit.Type(regType.RegTypeLimit.LimitTo);
                        break;
                    default:
                        break;
                }

                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SoldOutMessage.Type(regType.RegTypeLimit.SoldOutMessage);
            }
            if (regType.AdditionalDetails != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdditionalDetails_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdditionalDetailsEditor.SelectByName();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdditionalDetailsEditor.HtmlMode_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdditionalDetailsEditor.Content_Type(regType.AdditionalDetails);
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AdditionalDetailsEditor.SaveAndClose_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            }
            if (regType.IsPublic.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.Public.Set(regType.IsPublic.Value);
            }
            if (regType.IsAdmin.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.Admin.Set(regType.IsAdmin.Value);
            }
            if (regType.IsOnSite.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.OnSite.Set(regType.IsOnSite.Value);
            }
            if (regType.Price.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EventFee.Type(regType.Price.Value);
            }
            #endregion

            if ((regType.AllCustomCodes.Count != 0) || (regType.EarlyPrice != null) ||
                (regType.LatePrice != null) || (evt.TaxRateOne != null) ||
                (evt.TaxRateTwo != null))
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EventFeeAdvanced_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AdjustRADWindowPositionAndResize();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.SelectByName();

                if (regType.FeeName != null)
                {
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.NameOnReceipt.Type(regType.FeeName);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.NameOnReports.Type(regType.FeeName);
                }
                else
                {
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.NameOnReceipt.Type(regType.Name + "_" + RegType.Default.FeeName);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.NameOnReports.Type(regType.Name + "_" + RegType.Default.FeeName);
                }

                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.StandardPrice.Type(regType.Price);
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Options_Click();

                #region AddEarlyLatePrice
                if (regType.EarlyPrice != null)
                {
                    KeywordProvider.AddEarlyLatePrice.AddEarlyPrice(regType.EarlyPrice, FormData.Location.RegType);
                }

                if (regType.LatePrice != null)
                {
                    KeywordProvider.AddEarlyLatePrice.AddLatePrice(regType.LatePrice, FormData.Location.RegType);
                }
                #endregion

                #region AddDiscountCode
                if (regType.AllCustomCodes.Count != 0)
                {
                    if (!PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddDiscountCode.IsPresent)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Options_Click();
                    }

                    foreach (CustomFieldCode dc in regType.AllCustomCodes)
                    {
                        KeywordProvider.AddDiscountCode.AddDiscountCodes(dc, FormData.Location.RegType);
                    }

                    if (regType.RequireDC.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.RequireCode.Set(regType.RequireDC.Value);
                    }
                }
                #endregion

                #region AddTaxRate
                if ((evt.TaxRateOne != null) || (evt.TaxRateTwo != null))
                {
                    if (!PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddTaxRate.IsPresent)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Options_Click();
                    }

                    KeywordProvider.AddTaxRate.AddTaxRates(evt.TaxRateOne, evt.TaxRateTwo, FormData.Location.RegType);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.SaveAndStay_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Options_Click();

                    if (evt.TaxRateOne != null && regType.ApplyTaxOne.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.ApplyTaxOne.Set(regType.ApplyTaxOne.Value);
                    }

                    if (evt.TaxRateTwo != null && regType.ApplyTaxTwo.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.ApplyTaxTwo.Set(regType.ApplyTaxTwo.Value);
                    }
                }
                #endregion

                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.SaveAndClose_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            }

            #region RegTypeAdvanced
            if (regType.ShowStarting != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ShowDate.Type(regType.ShowStarting.Value);
            }
            if (regType.HideStarting != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.HideDate_Type(regType.HideStarting.Value);
            }
            if (regType.MinGroupSize.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MinGroupSize.Type(regType.MinGroupSize.Value);
            }
            if (regType.MaxGroupSize.HasValue)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MaxGroupSize.Type(regType.MaxGroupSize.Value);
            }
            if (regType.MinRegistrantMessage != null)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.AddMinRegMessage_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MinRegMessageEditor.SelectByName();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MinRegMessageEditor.HtmlMode_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MinRegMessageEditor.Content_Type(regType.MinRegistrantMessage);
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.MinRegMessageEditor.SaveAndClose_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            }
            if (regType.IsSSO)
            {
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthentication_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SelectByName();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SSORadio.Click();

                if (!PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.EndpointURL.HasAttribute("value"))
                {
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.EndpointURL.Type(SSOData.SSOEndpointURL);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.LoginURL.Type(SSOData.SSOLoginURL);
                }

                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SaveAndClose_Click();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EnableExternalAuthentication.Set(true);
            }
            #endregion

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SaveAndClose_Click();
        }
        public void SetupSSO()
        {
            string attri2 = "disabled";
            string wrongFormatURL1 = "http://www.xx.com";
            string wrongFormatURL2 = "www.xx.com";

            RegType regType1 = new RegType("SSORegType");
            regType1.IsSSO = true;
            RegType regType2 = new RegType("NoneSSORegType");
            regType2.IsSSO = true;
            Event evt = new Event("SetupSSO");

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

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

            KeywordProvider.EventCreator.ClickAddEventAndGetEventId(evt);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EmptyAddRegType_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.NameOnForm.Type(regType1.Name);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.NameOnReports.Type(regType1.Name);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthentication_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SelectByName();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SSORadio.Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.EndpointURL.Type(wrongFormatURL1);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.LoginURL.Type(SSOData.SSOLoginURL);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SaveAndClose_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.ErrorMessage(Messages.BuilderError.ServiceEndPointFormatError).IsPresent);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.EndpointURL.Type(wrongFormatURL2);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SaveAndClose_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.ErrorMessage(Messages.BuilderError.ServiceEndPointFormatError).IsPresent);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.EndpointURL.Type(SSOData.SSOEndpointURL);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.SaveAndClose_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EnableExternalAuthentication.Set(true);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SaveAndClose_Click();
            PageObject.Builder.RegistrationFormPages.RegTypeRow row1 = new PageObject.Builder.RegistrationFormPages.RegTypeRow(regType1.Name);
            KeywordProvider.AddRegType.Add_RegType(regType2, evt);
            PageObject.Builder.RegistrationFormPages.RegTypeRow row2 = new PageObject.Builder.RegistrationFormPages.RegTypeRow(regType2.Name);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.Title.Type(evt.Title);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.Shortcut.Type(evt.Shortcut);
            PageObject.PageObjectProvider.Builder.EventDetails.SaveAndClose_Click();
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Title);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdParty_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.SelectByName();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.ThirdPartyIntegrations.ExternalAuthentication_Click();
            Assert.True(PageObject.PageObjectProvider.Manager.SSOBase.SSORadio.IsChecked);
            Assert.AreEqual(PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Value, SSOData.SSOEndpointURL);
            Assert.AreEqual(PageObject.PageObjectProvider.Manager.SSOBase.LoginURL.Value, SSOData.SSOLoginURL);
            Assert.True(PageObject.PageObjectProvider.Manager.SSOBase.RegTypeEnabled(regType1).IsChecked);
            Assert.True(PageObject.PageObjectProvider.Manager.SSOBase.RegTypeEnabled(regType2).IsChecked);
            PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Type(wrongFormatURL1);
            PageObject.PageObjectProvider.Manager.SSOBase.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.SSOBase.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.ErrorMessage(Messages.BuilderError.ServiceEndPointFormatError).IsPresent);
            PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Type(wrongFormatURL2);
            PageObject.PageObjectProvider.Manager.SSOBase.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.SSOBase.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.ExternalAuthenticationSetup.ErrorMessage(Messages.BuilderError.ServiceEndPointFormatError).IsPresent);
            PageObject.PageObjectProvider.Manager.SSOBase.EndpointURL.Type(SSOData.SSOEndpointURL);
            PageObject.PageObjectProvider.Manager.SSOBase.RegTypeEnabled(regType2).Set(false);
            regType2.IsSSO = false;
            PageObject.PageObjectProvider.Manager.SSOBase.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.EditForm_Click();
            row2.Title_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            Assert.False(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EnableExternalAuthentication.IsChecked);
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.Cancel_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.SaveAndClose_Click();
            PageObject.PageObjectProvider.Manager.Dashboard.ReturnToList_Click();

            Registrant reg1 = new Registrant(evt, SSOData.SSOTestEmail);
            reg1.Password = SSOData.SSOPassword;
            reg1.EventFee_Response = new EventFeeResponse(regType1);
            Registrant reg2 = new Registrant(evt);
            reg2.EventFee_Response = new EventFeeResponse(regType2);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);

            KeywordProvider.SignIn.SignIn(EventFolders.Folders.SSO);
            KeywordProvider.ManagerDefault.OpenFormDashboard(evt.Title);
            PageObject.PageObjectProvider.Manager.Dashboard.EventDetails.EditForm_Click();
            row1.Title_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EnableExternalAuthentication.HasAttribute(attri2));
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.Cancel_Click();
            row2.Title_Click();
            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.SelectByName();
            Assert.True(PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.EnableExternalAuthentication.HasAttribute(attri2));
        }
        public void UpdateGroup_AddAPerson_RegType()
        {
            Event evt = new Event("RI-GroupRegistrationRegType");
            RegType regType = new RegType("First");
            evt.StartPage.RegTypes.Add(regType);

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

            Registrant reg1 = new Registrant(evt);
            Registrant reg2 = new Registrant(evt);
            reg1.EventFee_Response = new EventFeeResponse(regType);
            reg2.EventFee_Response = new EventFeeResponse(regType);
            Group group = new Group();
            group.Primary = reg1;
            group.Secondaries.Add(reg2);

            KeywordProvider.RegistrationCreation.GroupRegistration(group);

            PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.ChangeMyRegistration_Click();
            KeywordProvider.RegistrationCreation.Login(reg1);
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();

            Registrant reg3 = new Registrant(evt);
            reg3.EventFee_Response = new EventFeeResponse(regType);

            KeywordProvider.RegistrationCreation.Checkin(reg3);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg3);
            KeywordProvider.RegistrationCreation.Checkout(reg3);
        }
Esempio n. 19
0
 public CheckBox VisibleToRegType(RegType regType)
 {
     return new CheckBox(string.Format("//td[text()='{0}']/following-sibling::td/input[contains(@id,'Active')]", regType.Name), LocateBy.XPath);
 }
        public void RegistrationMiddlePriceDate()
        {
            Event eventMiddlePrice = new Event("RI-EventMiddlePrice");
            RegType regType = new RegType("First");
            EarlyPrice earlyPrice = new EarlyPrice();
            earlyPrice.earlyPrice = 40;
            earlyPrice.EarlyPriceType = FormData.EarlyPriceType.DateAndTime;
            earlyPrice.EarlyPriceDate = System.DateTime.Today.AddDays(-2);
            earlyPrice.EarlyPriceTime = System.DateTime.Now;
            LatePrice latePrice = new LatePrice();
            latePrice.latePrice = 60;
            latePrice.LatePriceDate = System.DateTime.Today.AddDays(2);
            latePrice.LatePriceTime = System.DateTime.Now;
            regType.EarlyPrice = earlyPrice;
            regType.LatePrice = latePrice;
            regType.Price = 50;
            eventMiddlePrice.StartPage.RegTypes.Add(regType);
            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            eventMiddlePrice.CheckoutPage.PaymentMethods.Add(paymentMethod);

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

            Registrant registrant = new Registrant(eventMiddlePrice);
            registrant.EventFee_Response = new EventFeeResponse(eventMiddlePrice.StartPage.RegTypes[0]);
            registrant.Payment_Method = paymentMethod;

            KeywordProvider.RegistrationCreation.Checkin(registrant);
            KeywordProvider.RegistrationCreation.PersonalInfo(registrant);

            Assert.True(KeywordProvider.RegisterDefault.GetTotal(DataCollection.FormData.RegisterPage.Confirmation) == regType.Price.Value);

            KeywordProvider.RegistrationCreation.Checkout(registrant);
        }
        public void RegistrationEventFeeDCPercent()
        {
            Event eventWithFeeDCDollar = new Event("RI-SingleRegistrationEventFeeDCPercent");
            RegType regType1 = new RegType("First");
            RegType regType2 = new RegType("Second");
            regType2.Price = 50;
            CustomFieldCode dc = new CustomFieldCode("CodeName");
            dc.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            dc.CodeDirection = FormData.ChangePriceDirection.Decrease;
            dc.Amount = 10;
            dc.CodeKind = FormData.ChangeType.FixedAmount;
            regType2.AllCustomCodes.Add(dc);
            eventWithFeeDCDollar.StartPage.RegTypes.Add(regType1);
            eventWithFeeDCDollar.StartPage.RegTypes.Add(regType2);

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

            Registrant registrant = new Registrant(eventWithFeeDCDollar);
            registrant.EventFee_Response = new EventFeeResponse(eventWithFeeDCDollar.StartPage.RegTypes[1]);

            KeywordProvider.RegistrationCreation.Checkin(registrant);

            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
        }
        public void RegistrationEventFeeDCDollar()
        {
            Event eventWithFeeDCDollar = new Event("RI-SingleRegistrationEventFeeDCDollar");
            RegType regType1 = new RegType("First");
            RegType regType2 = new RegType("Second");
            regType2.Price = 50;
            CustomFieldCode dc = new CustomFieldCode("CodeName");
            dc.CodeType = FormData.CustomFieldCodeType.DiscountCode;
            dc.CodeDirection = FormData.ChangePriceDirection.Decrease;
            dc.Amount = 10;
            dc.CodeKind = FormData.ChangeType.Percent;
            regType2.AllCustomCodes.Add(dc);
            eventWithFeeDCDollar.StartPage.RegTypes.Add(regType1);
            eventWithFeeDCDollar.StartPage.RegTypes.Add(regType2);

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

            Registrant registrant = new Registrant(eventWithFeeDCDollar);
            registrant.EventFee_Response = new EventFeeResponse(eventWithFeeDCDollar.StartPage.RegTypes[1]);

            Registrant reg = new Registrant(eventWithFeeDCDollar, string.Format("test{0}@test.com", System.DateTime.Now.Ticks.ToString()));

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(eventWithFeeDCDollar.StartPage.RegTypes[1]);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.Type("abc");
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();

            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.InvalidCode));

            KeywordProvider.RegistrationCreation.Checkin(registrant);

            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
        }
        public Registrant RegistrationEventFeeCodeRequired(FormData.CustomFieldCodeType type)
        {
            Event eventFeeDCRequired = new Event(string.Format("RI-SingleRegistrationEventFee{0}Required", type.ToString()));
            RegType regType1 = new RegType("First");
            RegType regType2 = new RegType("Second");
            regType2.Price = 50;
            CustomFieldCode dc = new CustomFieldCode("CodeName");
            dc.CodeType = type;
            dc.CodeDirection = FormData.ChangePriceDirection.Decrease;
            dc.Amount = 10;
            dc.Limit = 1;
            dc.CodeKind = FormData.ChangeType.FixedAmount;
            regType2.AllCustomCodes.Add(dc);
            regType2.RequireDC = true;
            PaymentMethod paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            eventFeeDCRequired.StartPage.RegTypes.Add(regType1);
            eventFeeDCRequired.StartPage.RegTypes.Add(regType2);
            eventFeeDCRequired.CheckoutPage.PaymentMethods.Add(paymentMethod);

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

            Registrant registrant = new Registrant(eventFeeDCRequired);
            registrant.EventFee_Response = new EventFeeResponse(eventFeeDCRequired.StartPage.RegTypes[1]);
            registrant.EventFee_Response.Code = dc;
            registrant.Payment_Method = paymentMethod;

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(registrant);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(registrant.EventFee_Response.RegType);

            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.DiscountCodeRequired.IsPresent);

            KeywordProvider.RegistrationCreation.CreateRegistration(registrant);

            return registrant;
        }
 public RadioButton RegTypeRadio(RegType regType)
 {
     return new RadioButton(
         string.Format("//input[@value='{0}']", regType.Id), LocateBy.XPath);
 }
 public void FeeOptionsCombinationFixture()
 {
     Event evt = new Event("FeeOptionsCombinationFixture");
     RegType regType1 = new RegType("regType1");
 }
        public void RegTypeDirectUrl()
        {
            Event evt = new Event("RI-RegTypeDirectUrl");
            RegType regType1 = new RegType("First");
            RegType regType2 = new RegType("Second");
            evt.StartPage.RegTypes.Add(regType1);
            evt.StartPage.RegTypes.Add(regType2);

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

            Registrant reg = new Registrant(evt);
            reg.EventFee_Response = new EventFeeResponse(regType1);
            reg.Register_Method = RegisterMethod.RegTypeDirectUrl;

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeRadioButton.IsPresent);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeDropDown.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg.Email);
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            KeywordProvider.RegistrationCreation.Checkout(reg);
        }
        public void RegistrationWithEventFeeGroupDiscount()
        {
            Event eventWithFeeGroupDiscount = new Event("RI-SingleRegistrationWithEventFeeGroupDiscount");
            RegType regType = new RegType("First");
            regType.Price = 50;
            eventWithFeeGroupDiscount.StartPage.RegTypes.Add(regType);
            GroupDiscount GroupDiscount = new GroupDiscount();
            GroupDiscount.GroupSize = 2;
            GroupDiscount.GroupSizeOption = GroupDiscount_GroupSizeOption.SizeOrMore;
            GroupDiscount.DiscountAmount = 1;
            GroupDiscount.GroupDiscountType = GroupDiscount_DiscountType.USDollar;
            GroupDiscount.AddtionalRegOption = GroupDiscount_AdditionalRegOption.AnyAdditional;
            eventWithFeeGroupDiscount.StartPage.GroupDiscount = GroupDiscount;

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

            Registrant registrant = new Registrant(eventWithFeeGroupDiscount);
            registrant.EventFee_Response = new EventFeeResponse(eventWithFeeGroupDiscount.StartPage.RegTypes[0]);

            KeywordProvider.RegistrationCreation.Checkin(registrant);

            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);
        }
        public void UpdateGroup_AddAPerson_ForceSameRegType()
        {
            Event evt = new Event("RI-GroupRegistrationForceSameRegType");
            RegType regType = new RegType("First");
            evt.StartPage.RegTypes.Add(regType);
            evt.StartPage.ForceSelectSameRegType = true;

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

            Registrant reg1 = new Registrant(evt);
            Registrant reg2 = new Registrant(evt);
            reg1.EventFee_Response = new EventFeeResponse(regType);
            Group group = new Group();
            group.Primary = reg1;
            group.Secondaries.Add(reg2);

            KeywordProvider.RegistrationCreation.GroupRegistration(group);

            PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.ChangeMyRegistration_Click();
            KeywordProvider.RegistrationCreation.Login(reg1);
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();

            Registrant reg3 = new Registrant(evt);

            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeRadioButton.IsPresent);
            Assert.False(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeDropDown.IsPresent);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg3);
        }
Esempio n. 29
0
 public CheckBox RegTypeEnabled(RegType regType)
 {
     return new CheckBox(string.Format("//td[text()='{0}']/following-sibling::td/input", regType.Name), LocateBy.XPath);
 }
        public void RegistrationWithRegTypeDiffEvent()
        {
            Registrant registrant = this.CreateEventAndRegisterWithRegType();

            Event diffEventWithRegType = new Event("RI-SingleRegistrationWithRegTypeDiffEvent");
            RegType regType1 = new RegType("Third");
            RegType regType2 = new RegType("Fourth");
            diffEventWithRegType.StartPage.RegTypes.Add(regType1);
            diffEventWithRegType.StartPage.RegTypes.Add(regType2);

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

            registrant.Event = diffEventWithRegType;
            registrant.EventFee_Response = new EventFeeResponse(diffEventWithRegType.StartPage.RegTypes[1]);

            KeywordProvider.RegistrationCreation.Checkin(registrant);

            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Login.Password.IsPresent);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Login.PasswordOnAutoRecall.IsPresent);

            KeywordProvider.RegistrationCreation.Login(registrant);

            AssertHelper.VerifyOnPage(FormData.RegisterPage.PersonalInfo, true);

            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(
                            FormData.PersonalInfoField.FirstName).Text.Trim().Equals(DataCollection.DefaultPersonalInfo.FirstName));

            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(
                FormData.PersonalInfoField.MiddleName).Text.Trim().Equals(DataCollection.DefaultPersonalInfo.MiddleName));

            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.PersonalInfo.PersonalInfoFields(
                FormData.PersonalInfoField.Password).Text != null);
        }