public void AddLatePrice(LatePrice latePrice, FormData.Location location)
        {
            switch (location)
            {
                case FormData.Location.RegType:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddLatePrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePriceTime_Type(latePrice.LatePriceTime);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePriceDate_Type(latePrice.LatePriceDate);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.LatePrice.Type(latePrice.latePrice);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.StandardPrice.Click();
                    break;
                case FormData.Location.Agenda:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddLatePrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePriceTime_Type(latePrice.LatePriceTime);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePriceDate_Type(latePrice.LatePriceDate);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.LatePrice.Type(latePrice.latePrice);
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.StandardPrice.Click();
                    break;
                default:
                    break;
            }

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.WaitForAJAX();
            Utility.ThreadSleep(2);
        }
        public double GetTotal(FormData.RegisterPage page)
        {
            string amount = string.Empty;

            switch (page)
            {
                case FormData.RegisterPage.Agenda:
                    amount = PageObject.PageObjectProvider.Register.RegistationSite.Agenda.Total.Text;
                    break;
                case FormData.RegisterPage.Confirmation:
                    amount = PageObject.PageObjectProvider.Register.RegistationSite.Confirmation.Total.Text;
                    break;
                default:
                    break;
            }

            string a = "";

            for (int i = 0; i < amount.Length; i++)
            {
                if (Char.IsNumber(amount, i) || (amount.Substring(i, 1) == "."))
                {
                    a += amount.Substring(i, 1);
                }
            }

            return Convert.ToDouble(a);
        }
 public void EventStatusChange(Event details, FormData.EventStatus status)
 {
     PageObject.PageObjectProvider.Manager.Dashboard.ChangeStatus_Click();
     PageObject.PageObjectProvider.Manager.Dashboard.ChangeStatusFrame.SelectByName();
     PageObject.PageObjectProvider.Manager.Dashboard.ChangeStatusFrame.ChangeStatusNow_Set(true);
     PageObject.PageObjectProvider.Manager.Dashboard.ChangeStatusFrame.Status.SelectWithText(CustomStringAttribute.GetCustomString(status));
     PageObject.PageObjectProvider.Manager.Dashboard.ChangeStatusFrame.OK_Click();
 }
        public void AddEarlyPrice(EarlyPrice earlyPrice, FormData.Location location)
        {
            switch (location)
            {
                case FormData.Location.RegType:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddEarlyPrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPrice.Type(earlyPrice.earlyPrice);

                    switch (earlyPrice.EarlyPriceType)
                    {
                        case FormData.EarlyPriceType.DateAndTime:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPriceDateTime.Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPriceDate_Type(earlyPrice.EarlyPriceDate.Value);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPriceTime_Type(earlyPrice.EarlyPriceTime.Value);
                            break;
                        case FormData.EarlyPriceType.Registrants:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPriceRegLimit.Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.EarlyPriceRegistrations.Type(earlyPrice.FirstNRegistrants.Value);
                            break;
                        default:
                            break;
                    }

                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.StandardPrice.Click();
                    break;

                case FormData.Location.Agenda:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddEarlyPrice_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPrice.Type(earlyPrice.earlyPrice);

                    switch (earlyPrice.EarlyPriceType)
                    {
                        case FormData.EarlyPriceType.DateAndTime:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPriceDateTime.Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPriceDate_Type(earlyPrice.EarlyPriceDate.Value);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPriceTime_Type(earlyPrice.EarlyPriceTime.Value);
                            break;
                        case FormData.EarlyPriceType.Registrants:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPriceRegistrations.Type(earlyPrice.FirstNRegistrants.Value);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.EarlyPriceRegLimit.Click();
                            break;
                        default:
                            break;
                    }

                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.StandardPrice.Click();
                    break;

                default:
                    break;
            }

            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.WaitForAJAX();
            Utility.ThreadSleep(2);
        }
 public void SelectRegType(FormData.XAuthType xAuthType)
 {
     if (xAuthType == FormData.XAuthType.NotUse)
     {
         RegisterMgr.SelectRegType(nonXAuthRegTypeName);
     }
     else
     {
         RegisterMgr.SelectRegType(xauthRegTypeName);
     }
 }
 public void SetPersonalInfoFieldRequired(FormData.PersonalInfoField field, bool checkRequiredOption)
 {
     switch (field)
     {
         case FormData.PersonalInfoField.SocialSecurityNumber:
             CheckBox SSNVisible = new CheckBox("ctl00_cph_chkCollectionFieldsrSSNID", LocateBy.Id);
             SSNVisible.Set(checkRequiredOption);
             break;
         case FormData.PersonalInfoField.ContactInfo:
             CheckBox ContactInfoVisible = new CheckBox(string.Format("//*[contains(text(),'{0}')]/../td[3]/input", StringEnum.GetStringValue(field)), LocateBy.XPath);
             ContactInfoVisible.Set(checkRequiredOption);
             break;
         default:
             CheckBox StandardFieldVisible = new CheckBox(string.Format("//*[text()='{0}']/../../../..//td[3]/input", CustomStringAttribute.GetCustomString(field)), LocateBy.XPath);
             StandardFieldVisible.Set(checkRequiredOption);
             break;
     }
 }
        public void GotoPage(FormData.Page page)
        {
            string accesskey = string.Empty;

            switch (page)
            {
                case FormData.Page.Start:
                    accesskey = "S";
                    break;

                case FormData.Page.PI:
                    accesskey = "I";
                    break;

                case FormData.Page.Agenda:
                    accesskey = "H";
                    break;

                case FormData.Page.LodgingTravel:
                    accesskey = "L";
                    break;

                case FormData.Page.Merchandise:
                    accesskey = "M";
                    break;

                case FormData.Page.Checkout:
                    accesskey = "K";
                    break;

                case FormData.Page.Confirmation:
                    accesskey = "C";
                    break;

                default:
                    break;
            }

            Clickable Page = new Clickable(string.Format("//a[@accesskey='{0}']", accesskey), LocateBy.XPath);
            Page.WaitForDisplay();
            Page.Click();
            WaitForLoad();
            UIUtil.DefaultProvider.HideActiveSpecificFooter(true);
        }
        public List<string> VerifyStandardReport(FormData.StandardReports reportType)
        {
            this.standardReport = new PageObject.Reports.StandardReports(reportType);
            List<string> results = new List<string>();

            switch (reportType)
            {
                case FormData.StandardReports.AgendaReport:
                    foreach (PageObject.Reports.AgendaReportRow agendarow in standardReport.AgendaReportRows)
                    {
                        results.Add(agendarow.AgendaName.Text);
                    }
                    break;
                case FormData.StandardReports.AttendeeReport:
                    break;
                default:
                    break;
            }

            return results;
        }
        public void TestOnsiteKioskWithxAuthRegTypeFixture(FormData.XAuthType xAuthType)
        {
            ChangeAdvancedSettingInxAuthEventFixture changeAdvancedSettingInxAuthEvent =
                new ChangeAdvancedSettingInxAuthEventFixture();

            int eventId =
                changeAdvancedSettingInxAuthEvent.ChangeAdvancedSettingInxAuthEvent(xAuthType, true);

            this.VerifyOnSiteCheckInProcess(
                true,
                true,
                true,
                true,
                true,
                true,
                true,
                false,
                xAuthType,
                eventId,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].Email,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].UserName,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].XAuthPassword,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].Password);

            this.VerifyOnSiteCheckInProcess(
                true,
                true,
                true,
                false,
                true,
                true,
                true,
                false,
                xAuthType,
                eventId,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].Email,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].UserName,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].XAuthPassword,
                RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1].Password);
        }
        public void SetXAuthType(FormData.XAuthType type)
        {
            switch (type)
            {
                case FormData.XAuthType.ByUserName:
                    SetValidateMemberByUserName();
                    TypeDescriptionForIdentifer("User ID");
                    SetValidateMemberRequirePassword(false);
                    break;
                case FormData.XAuthType.ByUserNamePassword:
                    SetValidateMemberByUserName();
                    TypeDescriptionForIdentifer("User ID");
                    SetValidateMemberRequirePassword(true);
                    break;
                case FormData.XAuthType.ByEmail:
                    SetValidateMemberByEmail();
                    SetValidateMemberRequirePassword(false);
                    break;
                case FormData.XAuthType.ByEmailPassword:
                    SetValidateMemberByEmail();
                    SetValidateMemberRequirePassword(true);
                    break;
            }

            TypeServiceEndpointURL(type);
        }
        public void VerifyErrorMessages(FormData.TestAccountResult errorType)
        {
            List<string> errors = new List<string>();
            switch (errorType)
            {
                case FormData.TestAccountResult.InvalidEmail:
                    errors.Add(ErrorMsg_InvalidEmail);
                    break;
                case FormData.TestAccountResult.AuthenticateFail:
                    errors.Add(ErrorMsg_AuthenticateFail);
                    break;
                case FormData.TestAccountResult.RequiredUsername:
                    errors.Add(ErrorMsg_RequiredUsername);
                    break;
                case FormData.TestAccountResult.RequiredEmail:
                    errors.Add(ErrorMsg_RequiredEmail);
                    break;
                case FormData.TestAccountResult.RequiredPassword:
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.RequiredUsernamePassword:
                    errors.Add(ErrorMsg_RequiredUsername);
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.RequiredEmailPassword:
                    errors.Add(ErrorMsg_RequiredEmail);
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.UrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    break;
                case FormData.TestAccountResult.RequiredUsernameAndUrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    errors.Add(ErrorMsg_RequiredUsername);
                    break;
                case FormData.TestAccountResult.RequiredEmailAndUrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    errors.Add(ErrorMsg_RequiredEmail);
                    break;
                case FormData.TestAccountResult.RequiredPasswordAndUrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.RequiredUsernamePasswordAndUrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    errors.Add(ErrorMsg_RequiredUsername);
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.RequiredEmailPasswordAndUrlStartWithHttps:
                    errors.Add(ErrorMsg_UrlStartWithHttps);
                    errors.Add(ErrorMsg_RequiredEmail);
                    errors.Add(ErrorMsg_RequiredPassword);
                    break;
                case FormData.TestAccountResult.Success:
                    break;
            }

            VerifyErrors(errors, errors.Count);
        }
Exemplo n.º 12
0
        public void CommonlyUsedItem_Click(FormData.CommonlyUsedMultipleChoice choiceItem)
        {
            Clickable item = new Clickable(string.Format("//div[@id='divPredefinedTypes']/div[text()='{0}']",
                CustomStringAttribute.GetCustomString(choiceItem)), LocateBy.XPath);

            item.WaitForDisplay();
            item.Click();
            Utility.ThreadSleep(1);
            WaitForAJAX();
        }
 public void SetDefaultAccount(FormData.XAuthType type)
 {
     switch (type)
     {
         case FormData.XAuthType.ByUserName:
             TypeTestUserName(DefaultAccount_UserName);
             break;
         case FormData.XAuthType.ByUserNamePassword:
             TypeTestUserName(DefaultAccount_UserName);
             TypeTestPassword(DefaultAccount_Password);
             break;
         case FormData.XAuthType.ByEmail:
             TypeTestEmail(DefaultAccount_Email);
             break;
         case FormData.XAuthType.ByEmailPassword:
             TypeTestEmail(DefaultAccount_Email);
             TypeTestPassword(DefaultAccount_Password);
             break;
     }
 }
 public PaymentMethod(FormData.PaymentMethod pMethod)
 {
     this.PMethod = pMethod;
 }
Exemplo n.º 15
0
        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;
        }
        public void XAuthRegistration(FormData.XAuthType xauthType)
        {
            Start();
            Managers.ManagerProvider.XAuthMgr.RemoveXAuthTestRegisterAndAttendeeForCustomer();

            addRegTypeAndXauth(xauthType, xauthType == FormData.XAuthType.ByUserNamePassword ? xauthForgotPasswordURL : "");

            Managers.Register.RegisterManager.XAuthPersonalInfo personalInfo = RegisterMgr.TestAccounts[Managers.Register.RegisterManager.TestAccountType.DefaultAccount1];

            RegisterMgr.ProcessRegistration(personalInfo,
                eventID, xauthType, SelectRegType);

            RegisterMgr.ClickViewDirectory(directoryName);

            ManagerSiteMgr.DashboardMgr.SelectAttendeeDirectoryWindow();

            processDirectoryVerify(xauthType, personalInfo);
            //DeleteEvent();
        }
 public void SetLodgingStandardFieldRequired(FormData.LodgingStandardFields field, bool requied)
 {
     CheckBox LodgingStandardFieldRequired = new CheckBox(string.Format("ctl00_cph_chk{0}R", field.ToString()), LocateBy.Id);
     LodgingStandardFieldRequired.Set(requied);
 }
        private void VerifyOnSiteCheckInProcess(
            bool enableBarcodeSearchByRegId,
            bool paidInFull,
            bool allowCC,
            bool requirePassword,
            bool allowOnSiteRegs,
            bool allowUpdates,
            bool allowGroupCheckIn,
            bool allowBadgePrinting,
            FormData.XAuthType xAuthType, 
            int eventId, 
            string email, 
            string userName, 
            string xAuthPassword, 
            string password)
        {
            ManagerSiteMgr.OpenLogin();
            ManagerSiteMgr.Login();
            ManagerSiteMgr.OpenEventDashboard(eventId);

            ManagerSiteMgr.DashboardMgr.LaunchKiosk(
                enableBarcodeSearchByRegId,
                paidInFull,
                allowCC,
                "text",
                requirePassword,
                allowOnSiteRegs,
                allowUpdates,
                allowGroupCheckIn,
                allowBadgePrinting);

            RegisterMgr.KioskSearch("WRONGID");
            VerifyNorecordsfoundShowUp();
            RegisterMgr.KioskClickNewSearch();

            RegisterMgr.KioskSearch(email);

            if (requirePassword)
            {
                if (xAuthType == FormData.XAuthType.ByUserName || xAuthType == FormData.XAuthType.ByUserNamePassword)
                {
                    RegisterMgr.KioskEnterUserId("WRONGID");
                    RegisterMgr.KioskEnterPassword("WRONG PASSWORD");
                    this.VerifyIncorrectMessageShowUp();
                    RegisterMgr.KioskClickNewSearch();

                    RegisterMgr.KioskSearch(email);
                    RegisterMgr.KioskEnterUserId(userName);
                    RegisterMgr.KioskEnterPassword("WRONG PASSWORD");
                    this.VerifyIncorrectMessageShowUp();
                    RegisterMgr.KioskClickNewSearch();

                    RegisterMgr.KioskSearch(email);
                    RegisterMgr.KioskEnterUserId(userName);

                    if (xAuthType == FormData.XAuthType.ByUserName)
                    {
                        RegisterMgr.KioskEnterPassword(password);
                    }

                    if (xAuthType == FormData.XAuthType.ByUserNamePassword)
                    {
                        RegisterMgr.KioskEnterPassword(xAuthPassword);
                    }
                }

                if (xAuthType == FormData.XAuthType.ByEmail || xAuthType == FormData.XAuthType.ByEmailPassword)
                {
                    RegisterMgr.KioskEnterPassword("WRONG PASSWORD");
                    VerifyIncorrectMessageShowUp();
                    RegisterMgr.KioskClickNewSearch();

                    RegisterMgr.KioskSearch(email);

                    if (xAuthType == FormData.XAuthType.ByEmail)
                    {
                        RegisterMgr.KioskEnterPassword(password);
                    }

                    if (xAuthType == FormData.XAuthType.ByEmailPassword)
                    {
                        RegisterMgr.KioskEnterPassword(xAuthPassword);
                    }
                }
            }

            this.VerifyCheckInSucess();
            RegisterMgr.KioskExitCheckIn();
        }
 public static void VerifyOnPage(FormData.RegisterPage page, bool onPage)
 {
     Assert.AreEqual(onPage, PageObject.PageObjectProvider.Register.RegistationSite.IsOnPage(page));
 }
 private void ClickTestAndVerify(FormData.TestAccountResult result)
 {
     Managers.ManagerProvider.XAuthMgr.ClickTestButton();
     Managers.ManagerProvider.XAuthMgr.VerifyErrorMessages(result);
 }
        public void TestAccountWithBadAndGoodData(FormData.XAuthType type)
        {
            ManagerSiteMgr.OpenLogin();
            ManagerSiteMgr.Login();
            ManagerSiteMgr.GoToEventsTabIfNeeded();
            ManagerSiteMgr.SelectFolder("xAuth");
            ManagerSiteMgr.DeleteEventByName(eventName);
            ManagerSiteMgr.ClickAddEvent(Managers.Manager.ManagerSiteManager.EventType.ProEvent);

            BuilderMgr.ClickAddRegType();
            BuilderMgr.RegTypeMgr.SetName("regType1");
            BuilderMgr.RegTypeMgr.ClickOpenXAuthSetup();

            Managers.ManagerProvider.XAuthMgr.SetXAuthType(type);

            string DefaultUserName = Managers.ManagerProvider.XAuthMgr.DefaultAccount_UserName;
            string DefaultEmail = Managers.ManagerProvider.XAuthMgr.DefaultAccount_Email;
            string DefaultPassword = Managers.ManagerProvider.XAuthMgr.DefaultAccount_Password;

            switch (type)
            {
                case FormData.XAuthType.ByEmail:

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredEmail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("[email protected]");
                    ClickTestAndVerify(FormData.TestAccountResult.InvalidEmail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("*****@*****.**");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.SetDefaultAccount(type);
                    ClickTestAndVerify(FormData.TestAccountResult.Success);
                    break;

                case FormData.XAuthType.ByEmailPassword:

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword(DefaultPassword);
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredEmail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail(DefaultEmail);
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredPassword);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredEmailPassword);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("[email protected]");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword(DefaultPassword);
                    ClickTestAndVerify(FormData.TestAccountResult.InvalidEmail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("[email protected]");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("badPassword");
                    ClickTestAndVerify(FormData.TestAccountResult.InvalidEmail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("*****@*****.**");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword(DefaultPassword);
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail("*****@*****.**");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("badPassword");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestEmail(DefaultEmail);
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("badPassword");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.SetDefaultAccount(type);
                    ClickTestAndVerify(FormData.TestAccountResult.Success);
                    break;

                case FormData.XAuthType.ByUserName:

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredUsername);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("badUserName");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.SetDefaultAccount(type);
                    ClickTestAndVerify(FormData.TestAccountResult.Success);
                    break;

                case FormData.XAuthType.ByUserNamePassword:

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword(DefaultPassword);
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredUsername);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName(DefaultUserName);
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredPassword);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("");
                    ClickTestAndVerify(FormData.TestAccountResult.RequiredUsernamePassword);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("badUserName");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword(DefaultPassword);
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName("badUserName");
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("badPassword");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.TypeTestUserName(DefaultUserName);
                    Managers.ManagerProvider.XAuthMgr.TypeTestPassword("badPassword");
                    ClickTestAndVerify(FormData.TestAccountResult.AuthenticateFail);

                    Managers.ManagerProvider.XAuthMgr.SetDefaultAccount(type);
                    ClickTestAndVerify(FormData.TestAccountResult.Success);
                    break;
            }
        }
Exemplo n.º 22
0
        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);
        }
 private void TypeServiceEndpointURL(FormData.XAuthType type)
 {
     switch (type)
     {
         case FormData.XAuthType.ByUserName:
             TypeServiceEndpointURL(ServiceEndpointURL_By_UserName);
             break;
         case FormData.XAuthType.ByUserNamePassword:
             TypeServiceEndpointURL(ServiceEndpointURL_By_UserName_Password);
             break;
         case FormData.XAuthType.ByEmail:
             TypeServiceEndpointURL(ServiceEndpointURL_By_Email);
             break;
         case FormData.XAuthType.ByEmailPassword:
             TypeServiceEndpointURL(ServiceEndpointURL_By_Email_Password);
             break;
     }
 }
        private void addRegTypeAndXauth(FormData.XAuthType xauthType, string forgotPasswordUrl = "")
        {
            ManagerSiteMgr.OpenEventBuilderStartPage(eventID, eventSessionId);

            //delete existing regtype first
            if (BuilderMgr.HasRegType(xauthRegTypeName))
            {
                BuilderMgr.DeleteRegType(xauthRegTypeName);
            }
            BuilderMgr.ClickAddRegType();
            BuilderMgr.RegTypeMgr.SetName(xauthRegTypeName);
            BuilderMgr.RegTypeMgr.ClickOpenXAuthSetup();

            Managers.ManagerProvider.XAuthMgr.SetValidateMemberRequirePassword(true);
            Managers.ManagerProvider.XAuthMgr.TypeForgetPasswordUrl(forgotPasswordUrl);
            Managers.ManagerProvider.XAuthMgr.SetValidateMemberRequirePassword(false);

            Managers.ManagerProvider.XAuthMgr.SetXAuthType(xauthType);
            Managers.ManagerProvider.XAuthMgr.SetDefaultAccount(xauthType);

            if (xauthType == FormData.XAuthType.ByUserName ||
                xauthType == FormData.XAuthType.ByUserNamePassword)
            {
                Managers.ManagerProvider.XAuthMgr.TypeDescriptionForIdentifer("User Label");
            }

            if (xauthType == FormData.XAuthType.ByUserNamePassword)
            {
                Managers.ManagerProvider.XAuthMgr.TypeForgetPasswordUrl(forgotPasswordUrl);
            }

            Managers.ManagerProvider.XAuthMgr.ClickTestButton();
            Managers.ManagerProvider.XAuthMgr.VerifyPassTest();
            Managers.ManagerProvider.XAuthMgr.ClickOKButton();

            BuilderMgr.RegTypeMgr.SelectRegTypeFrame();
            Utilities.Utility.ThreadSleep(3);
            BuilderMgr.RegTypeMgr.EnableXAuth(true);
            BuilderMgr.RegTypeMgr.SaveAndClose();
        }
 public Label PersonalInfoFields(FormData.PersonalInfoField field)
 {
     return new Label(string.Format("//ol[@class='fieldList']//*[contains(text(),'{0}')]/../following-sibling::*",
         CustomStringAttribute.GetCustomString(field)), LocateBy.XPath);
 }
        private void processDirectoryVerify(FormData.XAuthType authType,
            Managers.Register.RegisterManager.XAuthPersonalInfo personalInfo)
        {
            drManager.EnterEmailAddressOnLogin(personalInfo.Email);

            drManager.Continue();

            drManager.VerifyEmailTextboxIsPresent();
            if (authType == FormData.XAuthType.ByUserName ||
                authType == FormData.XAuthType.ByUserNamePassword)
            {
                drManager.VerifyUserIDTextboxIsPresent();
                drManager.EnterUserIDOnLogin(personalInfo.UserName);
            }
            if (authType == FormData.XAuthType.ByUserNamePassword)
            {
                drManager.VerifyXAuthForgotPasswordLinkIsPresent(true);
            }
            drManager.VerifyPasswordTextboxIsPresent();

            drManager.EnterEmailAddressOnLogin(personalInfo.Email);
            drManager.EnterPasswordOnLogin(personalInfo.XAuthPassword);

            drManager.Continue();

            drManager.VerifyIsOnReportPage();
        }
 public void SetLodgingStandardFieldVisible(FormData.LodgingStandardFields field, bool visible)
 {
     CheckBox LodgingStandardFieldVisible = new CheckBox(string.Format("ctl00_cph_chk{0}V", field.ToString()), LocateBy.Id);
     LodgingStandardFieldVisible.Set(visible);
 }
        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;
        }
Exemplo n.º 29
0
        public void AddTaxRates(TaxRate taxRateOne, TaxRate taxRateTwo, FormData.Location location)
        {
            if (((taxRateOne != null) && taxRateOne.ToBeAdded ) || ((taxRateTwo != null) && taxRateTwo.ToBeAdded))
            {
                switch (location)
                {
                    case FormData.Location.RegType:
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddTaxRate_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.SelectByName();

                        if (taxRateOne != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.TaxOneCaption.Type(taxRateOne.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.TaxOneRate.Type(taxRateOne.Rate);
                            taxRateOne.ToBeAdded = false;
                        }

                        if (taxRateTwo != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.TaxTwoCaption.Type(taxRateTwo.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.TaxTwoRate.Type(taxRateTwo.Rate);
                            taxRateTwo.ToBeAdded = false;
                        }

                        if (((taxRateOne != null) && taxRateOne.Country.HasValue) || ((taxRateTwo != null) && taxRateTwo.Country.HasValue))
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.ApplyToSelectedCountry_Set(true);

                            if ((taxRateOne != null) && taxRateOne.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.ApplyToCountry(taxRateOne.Country.Value).Set(true);
                            }

                            if ((taxRateTwo != null) && taxRateTwo.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.ApplyToCountry(taxRateTwo.Country.Value).Set(true);
                            }
                        }

                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.TaxRate_Define.SaveAndClose_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.SelectByName();
                        break;
                    case FormData.Location.Agenda:
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddTaxRate_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.SelectByName();

                        if (taxRateOne != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.TaxOneCaption.Type(taxRateOne.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.TaxOneRate.Type(taxRateOne.Rate);
                            taxRateOne.ToBeAdded = false;
                        }

                        if (taxRateTwo != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.TaxTwoCaption.Type(taxRateTwo.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.TaxTwoRate.Type(taxRateTwo.Rate);
                            taxRateTwo.ToBeAdded = false;
                        }

                        if (((taxRateOne != null) && taxRateOne.Country.HasValue) || ((taxRateTwo != null) && taxRateTwo.Country.HasValue))
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.ApplyToSelectedCountry_Set(true);

                            if ((taxRateOne != null) && taxRateOne.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.ApplyToCountry(taxRateOne.Country.Value).Set(true);
                            }

                            if ((taxRateTwo != null) && taxRateTwo.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.ApplyToCountry(taxRateTwo.Country.Value).Set(true);
                            }
                        }

                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.TaxRateDefine.SaveAndClose_Click();
                        break;
                    case FormData.Location.Merchandise:
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.AddTaxRate_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.SelectByName();

                        if (taxRateOne != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.TaxOneCaption.Type(taxRateOne.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.TaxOneRate.Type(taxRateOne.Rate);
                            taxRateOne.ToBeAdded = false;
                        }

                        if (taxRateTwo != null)
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.TaxTwoCaption.Type(taxRateTwo.TaxRateCaption);
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.TaxTwoRate.Type(taxRateTwo.Rate);
                            taxRateTwo.ToBeAdded = false;
                        }

                        if (((taxRateOne != null) && taxRateOne.Country.HasValue) || ((taxRateTwo != null) && taxRateTwo.Country.HasValue))
                        {
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.ApplyToSelectedCountry_Set(true);

                            if ((taxRateOne != null) && taxRateOne.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.ApplyToCountry(taxRateOne.Country.Value).Set(true);
                            }

                            if ((taxRateTwo != null) && taxRateTwo.Country.HasValue)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.ApplyToCountry(taxRateTwo.Country.Value).Set(true);
                            }
                        }

                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.TaxRate_Define.SaveAndClose_Click();
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.MerchandisePage.MerchandiseDefine.SelectByName();
                        break;
                    default:
                        break;
                }
            }
        }
        public void AddDiscountCodes(CustomFieldCode code, FormData.Location location)
        {
            switch(location)
            {
                case FormData.Location.EventFee:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.AddDiscountCode_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.SelectByName();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.Code.Type(code.CodeString);

                    switch (code.CodeType)
                    {
                        case FormData.CustomFieldCodeType.DiscountCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.Discount_Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.CodeDirection.SelectWithText(code.CodeDirection.Value.ToString());

                            if (code.CodeKind == FormData.ChangeType.Percent)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.Percentage_Click();
                            }

                            if (code.CodeKind == FormData.ChangeType.FixedAmount)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.FixAmount_Click();
                            }

                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.Amount.Type(code.Amount);
                            break;

                        case FormData.CustomFieldCodeType.AccessCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.Access_Click();
                            break;

                        default:
                            break;
                    }

                    if (code.Limit.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.UseLimit.Type(code.Limit.Value);
                    }

                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.Code_Define.SaveAndClose_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.EventFeeDefine.SelectByName();
                    break;

                case FormData.Location.RegType:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.AddDiscountCode_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.SelectByName();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.Code.Type(code.CodeString);

                    switch (code.CodeType)
                    {
                        case FormData.CustomFieldCodeType.DiscountCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.Discount_Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.CodeDirection.SelectWithText(code.CodeDirection.Value.ToString());

                            if (code.CodeKind == FormData.ChangeType.Percent)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.Percentage_Click();
                            }

                            if (code.CodeKind == FormData.ChangeType.FixedAmount)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.FixAmount_Click();
                            }

                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.Amount.Type(code.Amount);
                            break;

                        case FormData.CustomFieldCodeType.AccessCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.Access_Click();
                            break;

                        default:
                            break;
                    }

                    if (code.Limit.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.StartPage.RegTypeDefine.RegTypeFee_Define.Code_Define.UseLimit.Type(code.Limit.Value);
                    }

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

                case FormData.Location.Agenda:
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.AddDiscountCode_Click();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.SelectByName();
                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.Code.Type(code.CodeString);

                    switch (code.CodeType)
                    {
                        case FormData.CustomFieldCodeType.DiscountCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.Discount_Click();
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.CodeDirection.SelectWithText(code.CodeDirection.Value.ToString());

                            if (code.CodeKind == FormData.ChangeType.Percent)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.Percentage_Click();
                            }

                            if (code.CodeKind == FormData.ChangeType.FixedAmount)
                            {
                                PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.FixAmount_Click();
                            }

                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.Amount.Type(code.Amount);
                            break;
                        case FormData.CustomFieldCodeType.AccessCode:
                            PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.Access_Click();
                            break;
                        default:
                            break;
                    }

                    if (code.Limit.HasValue)
                    {
                        PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.UseLimit.Type(code.Limit.Value);
                    }

                    PageObject.PageObjectProvider.Builder.EventDetails.FormPages.AgendaPage.CodeDefine.SaveAndClose_Click();
                    break;

                default:
                    break;
            }
        }