public void Checkin(Registrant reg)
        {
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);

            if (reg.Event.AgendaPage != null && reg.Event.AgendaPage.IsShoppingCart)
            {
                this.ShoppingCart(reg);
            }

            if (PageObject.PageObjectProvider.Register.RegistationSite.IsOnPage(FormData.RegisterPage.Login))
            {
                PageObject.PageObjectProvider.Register.RegistationSite.Login.StartNewRegistration_Click();
            }

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type(reg.Email);

            if (PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyEmailAddress.IsPresent)
            {
                PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyEmailAddress.WaitForDisplay();
                PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyEmailAddress.Type(reg.Email);
            }

            if ((reg.EventFee_Response != null) && (reg.Register_Method != RegisterMethod.RegTypeDirectUrl))
            {
                KeywordProvider.RegisterDefault.SelectRegType(reg);
                KeywordProvider.RegisterDefault.TypeEventFeeDiscountCode(reg);
            }

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
        }
        public void TestEventFeeWithDiscountCodeAccessCode()
        {
            evt = new Event("TestEventFeeWithDiscountCodeAccessCode");
            paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
            EventFee ef = new EventFee();
            ef.StandardPrice = 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;
            ef.AllCustomCodes.Add(dc1);
            ef.AllCustomCodes.Add(ac1);
            evt.StartPage.Event_Fee = ef;

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);
            Registrant reg1 = new Registrant(evt);
            reg1.Payment_Method = paymentMethod;
            reg1.EventFee_Response = new EventFeeResponse();
            reg1.EventFee_Response.Code = dc1;
            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 90);
            Registrant reg2 = new Registrant(evt);
            reg2.Payment_Method = paymentMethod;
            reg2.EventFee_Response = new EventFeeResponse();
            reg2.EventFee_Response.Code = ac1;
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 100);
        }
        public double CalculateTotalFee(Registrant reg)
        {
            Group group = new Group();
            group.Primary = reg;

            return this.CalculateTotalFee(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 UpdateCustomField(Registrant reg)
        {
            if (reg.CustomField_Responses.Count != 0)
            {
                foreach (CustomFieldResponse resp in reg.CustomField_Responses)
                {
                    if (resp is AgendaResponse)
                    {
                        AgendaResponse respAgenda = resp as AgendaResponse;
                        attendeeInfo.AgendaEdit_Click();
                        PageObject.PageObjectHelper.SelectTopWindow();

                        switch (respAgenda.AgendaItem.Type)
                        {
                            case FormData.CustomFieldType.CheckBox:
                                {
                                    AgendaResponse_Checkbox ckresp = respAgenda as AgendaResponse_Checkbox;
                                    ((agendaEdit.AgendaType(ckresp.AgendaItem)) as CheckBox).Set(ckresp.Checked.Value);
                                }
                                break;
                            default:
                                break;
                        }

                        agendaEdit.SaveAndClose_Click();
                        PageObject.PageObjectHelper.SelectTopWindow();
                    }
                }
            }
        }
        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 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 Agenda(Registrant reg)
 {
     if (reg.CustomField_Responses.Count != 0 && reg.CustomField_Responses.HasAgendaResponse())
     {
         this.PerformDefaultActions_Agenda(reg);
         PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
     }
 }
        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 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 SelectRegType(Registrant reg)
 {
     if (reg.EventFee_Response.RegType != null)
     {
         if (reg.Event.StartPage.Customize_RegType_DisplayOptions.DisplayOption == FormData.RegTypeDisplayOption.DropDownList)
         {
             PageObject.PageObjectProvider.Register.RegistationSite.Checkin.RegTypeDropDown.SelectWithText(reg.EventFee_Response.RegType.Name);
         }
         else
         {
             PageObject.PageObjectProvider.Register.RegistationSite.Checkin.SelectRegTypeRadioButton(reg.EventFee_Response.RegType);
         }
     }
 }
        public void ForgetPasswordLink()
        {
            Event evt = new Event("RI-ForgetPassword");

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

            Registrant reg = new Registrant(evt);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            KeywordProvider.RegistrationCreation.Checkin(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.Login.ForgotPassword_Click();
            PageObject.PageObjectProvider.Register.RegistationSite.Login.ForgotPasswordPopup.SelectByIndex();
            string email = PageObject.PageObjectProvider.Register.RegistationSite.Login.ForgotPasswordPopup.EmailAddress.GetAttribute("value");
            Assert.True(reg.Email == email);
        }
        public void GroupInvalidEmail()
        {
            Event evt = new Event("RI-GroupInvalidEmail");

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

            Registrant reg = new Registrant(evt);
            Registrant reg1 = new Registrant(evt, "abc");

            KeywordProvider.RegistrationCreation.Checkin(reg);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            PageObject.PageObjectProvider.Register.RegistationSite.AddAnotherPerson_Click();
            KeywordProvider.RegistrationCreation.Checkin(reg1);

            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.YouMustEnterValidEmailAddress));
        }
        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 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 AddVerifyEmailField()
        {
            Event evt = new Event("RI-VerifyEmail");
            PersonalInfoPageStandardField VerifyEmail = new PersonalInfoPageStandardField();
            VerifyEmail.StandardField = FormData.PersonalInfoField.VerifyEmail;
            VerifyEmail.Visible = true;
            evt.PersonalInfoPage.StandardFields.Add(VerifyEmail);

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

            Registrant reg = new Registrant(evt);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            Assert.True(PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyEmailAddress.IsPresent);
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EmailAddress.Type("*****@*****.**");
            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.VerifyEmailAddress.Type("*****@*****.**");
            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.EmailAddressesDoNotMatch));
        }
        public void Checkout(Registrant reg)
        {
            if (reg.WhetherToVerifyFeeOnCheckoutPage)
            {
                VerifyFeeSummary(reg);
            }

            if (reg.Payment_Method != null)
            {
                if (PageObject.PageObjectProvider.Register.RegistationSite.Checkout.PaymentMethodList.IsPresent)
                {
                    PageObject.PageObjectProvider.Register.RegistationSite.Checkout.PaymentMethodList.SelectWithText(
                        FormData.PaymentMethodCheckouLabelAttribute.GetPaymentMethodCheckouLabel(reg.Payment_Method.PMethod));
                }

                switch (reg.Payment_Method.PMethod)
                {
                    /*****
                     To implement
                     *****/
                    case FormData.PaymentMethod.CreditCard:
                        break;
                    default:
                        break;
                }
            }

            if (PageObject.PageObjectProvider.Register.RegistationSite.Checkout.AggreementToWaiver.IsDisplay)
            {
                PageObject.PageObjectProvider.Register.RegistationSite.Checkout.AggreementToWaiver.Set(true);
            }

            PageObject.PageObjectProvider.Register.RegistationSite.Checkout.Finish_Click();

            if (PageObject.PageObjectProvider.Register.RegistationSite.IsOnPage(FormData.RegisterPage.ConfirmationRedirect))
            {
                PageObject.PageObjectProvider.Register.RegistationSite.Checkout.AANoThanks_Click();
            }

            reg.Id = Convert.ToInt32(PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.RegistrationId.Text);

            reg.Event.Registrants.Add(reg);
        }
        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);
        }
        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);
        }
Esempio n. 24
0
        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 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);
 }
        private Registrant GenerateReg(CustomFieldCode regTypeDc, CustomFieldCode agendaDc, CustomFieldCode merchDc)
        {
            Registrant reg = new Registrant(evt);
            reg.Payment_Method = paymentMethod;
            reg.EventFee_Response = new EventFeeResponse(regType);
            reg.EventFee_Response.Code = regTypeDc;
            AgendaResponse_Checkbox resp1 = new AgendaResponse_Checkbox();
            resp1.AgendaItem = agenda;
            resp1.Checked = true;
            resp1.Code = agendaDc;
            reg.CustomField_Responses.Add(resp1);
            MerchResponse_FixedPrice resp2 = new MerchResponse_FixedPrice();
            resp2.Merchandise_Item = merch;
            resp2.Quantity = 1;
            resp2.Discount_Code = merchDc;
            reg.Merchandise_Responses.Add(resp2);

            return reg;
        }
        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 TypeEventFeeDiscountCode(Registrant reg)
 {
     if (reg.EventFee_Response.Code != null)
     {
         PageObject.PageObjectProvider.Register.RegistationSite.Checkin.EventFeeDiscountCode.Type(reg.EventFee_Response.Code.CodeString);
     }
 }
        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));
        }
        private Registrant GenerateRegForTaxRate(FormData.Countries? country)
        {
            Registrant reg = new Registrant(evt);
            reg.EventFee_Response = new EventFeeResponse(regType);
            reg.EventFee_Response.Fee = regType.Price.Value;
            reg.Payment_Method = paymentMethod;
            if (country.HasValue)
            {
                reg.Country = country.Value;
            }
            AgendaResponse_Checkbox agResp = new AgendaResponse_Checkbox();
            agResp.AgendaItem = agenda;
            agResp.Checked = true;
            agResp.Fee = agenda.Price.Value;
            MerchResponse_FixedPrice merchResp = new MerchResponse_FixedPrice();
            merchResp.Merchandise_Item = merch;
            merchResp.Quantity = 2;
            merchResp.Fee = merch.Price.Value * merchResp.Quantity;
            reg.CustomField_Responses.Add(agResp);
            reg.Merchandise_Responses.Add(merchResp);

            KeywordProvider.RegistrationCreation.CreateRegistration(reg);

            return reg;
        }