public void ChangeNonXAuthRegistrationTypeDuringUpdate()
        {
            List<string> IDs = CreateEvent(false);
            int eventID = Convert.ToInt32(IDs[1]);
            string eventSessionID = IDs[0];
            ChangeAndResetXAuthConfiguration(eventID, eventSessionID, Regtypes.xAuthType1.ToString());
            ManagerSiteMgr.OpenEventBuilderStartPage(eventID, eventSessionID);
            BuilderMgr.SetEventAllowChangeRegistrationType(true);
            BuilderMgr.SetEventAllowUpdateRegistration(true);
            BuilderMgr.SaveAndClose();

            // Do a NonXAuth registration
            string randomEmail = string.Format(randomEmailAddressFormat, Guid.NewGuid().ToString().Replace("-", ""));
            RegisterMgr.OpenRegisterPage(eventID);
            RegisterMgr.Checkin(randomEmail);
            RegisterMgr.SelectRegType(Regtypes.NonxAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(true);
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(false);
            RegisterMgr.EnterProfileInfo();
            RegisterMgr.TypePersonalInfoFax(fax);
            RegisterMgr.TypePersonalInfoAddressLineTwo(addressLineTwo);
            RegisterMgr.EnterPersonalInfoPassword(password);
            RegisterMgr.SetCustomFieldCheckBox(CFName6, true);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();
            RegisterMgr.VerifyRegistrationType(Regtypes.NonxAuthType1.ToString());
            RegisterManager.XAuthPersonalInfo personalInfo = new RegisterManager.XAuthPersonalInfo();
            personalInfo.Email = randomEmail;
            personalInfo.FirstName = RegisterManager.DefaultPersonalInfo.FirstName;
            personalInfo.LastName = RegisterMgr.CurrentRegistrantLastName;
            personalInfo.MiddleName = RegisterManager.DefaultPersonalInfo.MiddleName;
            personalInfo.JobTitle = RegisterManager.DefaultPersonalInfo.JobTitle;
            personalInfo.Address1 = RegisterManager.DefaultPersonalInfo.AddressLineOne;
            personalInfo.Address2 = addressLineTwo;
            personalInfo.City = RegisterManager.DefaultPersonalInfo.City;
            personalInfo.Company = RegisterManager.DefaultPersonalInfo.Company;
            personalInfo.State = RegisterManager.DefaultPersonalInfo.State;
            personalInfo.Phone = RegisterManager.DefaultPersonalInfo.WorkPhone;
            personalInfo.Extension = "";
            personalInfo.Zip = RegisterManager.DefaultPersonalInfo.ZipCode;
            personalInfo.Fax = fax;
            RegisterMgr.VerifyPrimaryRegistrationPersonalInfo(personalInfo);

            // Update Registration Type
            RegisterMgr.OpenRegisterPage(eventID);
            RegisterMgr.ClickCheckinAlreadyRegistered();
            RegisterMgr.EnterEmailAddress(randomEmail);
            RegisterMgr.ContinueWithErrors();
            RegisterMgr.TypeLoginPagePassword(password);
            RegisterMgr.Continue();
            RegisterMgr.AttendeeCheckEditPersonalInfo();
            RegisterMgr.ClickEditRegistrationType();
            RegisterMgr.VerifyRegistrationTypeOptions(new List<string> { Regtypes.NonxAuthType1.ToString(), Regtypes.NonxAuthType2.ToString() });
            RegisterMgr.ChangeRegistrationType(Regtypes.NonxAuthType2.ToString());
            RegisterMgr.ConfirmChangingRegistrationType();
            RegisterMgr.TypePersonalInfoJobTitle("QA Tester");
            RegisterMgr.Continue();
            RegisterMgr.SelectAgendaItem(AGName6);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();
            RegisterMgr.VerifyRegistrationType(Regtypes.NonxAuthType2.ToString());
            personalInfo.JobTitle = "QA Tester";
            RegisterMgr.VerifyPrimaryRegistrationPersonalInfo(personalInfo);
        }
        public void XAuthAndNonXAuthRegistrationsBackendUpdate()
        {
            List<string> IDs = CreateEvent(false);
            int eventID = Convert.ToInt32(IDs[1]);
            string eventSessionID = IDs[0];
            ChangeAndResetXAuthConfiguration(eventID, eventSessionID, Regtypes.xAuthType1.ToString());
            int regID1;
            int regID2;

            // Do registrations
            // Registration with XAuth
            RegisterMgr.OpenRegisterPage(eventID);
            RegisterMgr.Checkin(Managers.ManagerProvider.XAuthMgr.DefaultAccount_Email);
            RegisterMgr.SelectRegType(Regtypes.xAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(true);
            RegisterMgr.TypeLoginPagePassword(Managers.ManagerProvider.XAuthMgr.DefaultAccount_Password);
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(false);
            RegisterMgr.XAuth_VerifyPI(RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1]);
            RegisterMgr.SetCustomFieldCheckBox(CFName1, true);
            RegisterMgr.SetCustomFieldCheckBox(CFName2, true);
            RegisterMgr.SetCustomFieldCheckBox(CFName3, true);
            RegisterMgr.Continue();
            RegisterMgr.SelectAgendaItem(AGName1);
            RegisterMgr.SelectAgendaItem(AGName2);
            RegisterMgr.SelectAgendaItem(AGName5);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();
            RegisterMgr.VerifyPrimaryRegistrationPersonalInfo(RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1]);
            regID1 = RegisterMgr.GetRegistrationIdOnConfirmationPage();
            // Two registrations with NonXAuth
            RegisterMgr.OpenRegisterPage(eventID);
            string randomEmail = string.Format(randomEmailAddressFormat, Guid.NewGuid().ToString().Replace("-", ""));
            RegisterMgr.Checkin(randomEmail);
            RegisterMgr.SelectRegType(Regtypes.NonxAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(true);
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(false);
            RegisterMgr.EnterProfileInfo();
            RegisterMgr.TypePersonalInfoAddressLineTwo(addressLineTwo);
            RegisterMgr.TypePersonalInfoFax(fax);
            RegisterMgr.EnterPersonalInfoPassword(password);
            RegisterMgr.SetCustomFieldCheckBox(CFName1, true);
            RegisterMgr.SetCustomFieldCheckBox(CFName2, true);
            RegisterMgr.SetCustomFieldCheckBox(CFName6, true);
            RegisterMgr.Continue();
            RegisterMgr.SelectAgendaItem(AGName1);
            RegisterMgr.SelectAgendaItem(AGName2);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();
            RegisterManager.XAuthPersonalInfo personalInfo = new RegisterManager.XAuthPersonalInfo();
            personalInfo.Email = randomEmail;
            personalInfo.FirstName = RegisterManager.DefaultPersonalInfo.FirstName;
            personalInfo.LastName = RegisterMgr.CurrentRegistrantLastName;
            personalInfo.MiddleName = RegisterManager.DefaultPersonalInfo.MiddleName;
            personalInfo.JobTitle = RegisterManager.DefaultPersonalInfo.JobTitle;
            personalInfo.Address1 = RegisterManager.DefaultPersonalInfo.AddressLineOne;
            personalInfo.Address2 = addressLineTwo;
            personalInfo.City = RegisterManager.DefaultPersonalInfo.City;
            personalInfo.Company = RegisterManager.DefaultPersonalInfo.Company;
            personalInfo.State = RegisterManager.DefaultPersonalInfo.State;
            personalInfo.Phone = RegisterManager.DefaultPersonalInfo.WorkPhone;
            personalInfo.Extension = "";
            personalInfo.Zip = RegisterManager.DefaultPersonalInfo.ZipCode;
            personalInfo.Fax = fax;
            RegisterMgr.VerifyPrimaryRegistrationPersonalInfo(personalInfo);
            regID2 = RegisterMgr.GetRegistrationIdOnConfirmationPage();

            RegisterMgr.OpenRegisterPage(eventID);
            string randomEmail2 = string.Format(randomEmailAddressFormat, Guid.NewGuid().ToString().Replace("-", ""));
            RegisterMgr.Checkin(randomEmail2);
            RegisterMgr.SelectRegType(Regtypes.NonxAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(true);
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(false);
            RegisterMgr.EnterProfileInfo();
            RegisterMgr.TypePersonalInfoAddressLineTwo(addressLineTwo);
            RegisterMgr.TypePersonalInfoFax(fax);
            RegisterMgr.EnterPersonalInfoPassword(password);
            RegisterMgr.SetCustomFieldCheckBox(CFName6, true);
            RegisterMgr.Continue();
            RegisterMgr.SelectAgendaItem(AGName1);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();

            // Backend Update
            // Update registration with XAuth
            BackendMgr.OpenAttendeeInfoURL(eventSessionID, regID1);

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.VerifyRegistrationTypeOptions(new List<string> { Regtypes.xAuthType1.ToString(), Regtypes.xAuthType2.ToString() });
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.RegType, Regtypes.xAuthType2.ToString());
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.SelectAttendeeInfoWindow();
            BackendMgr.VerifyCustomFieldPresent(CFName1, true);
            BackendMgr.VerifyCustomFieldPresent(CFName2, true);
            BackendMgr.VerifyCustomFieldPresent(CFName3, true);
            BackendMgr.VerifyCustomFieldPresent(AGName1, true);
            BackendMgr.VerifyCustomFieldPresent(AGName2, true);
            BackendMgr.VerifyCustomFieldPresent(AGName5, true);

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Email, randomEmail);
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.VerifyErrorMessage(Managers.Register.RegisterManager.Error.CheckinDisallowDuplicateEmail);
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Email, Managers.ManagerProvider.XAuthMgr.DefaultAccount_Email);
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.SelectAttendeeInfoWindow();

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Email, "*****@*****.**");
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.First_Name, "Dev");
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Last_Name, "One");
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.SelectAttendeeInfoWindow();

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.CustomFields);
            BackendMgr.SetCheckboxCFItem(CFName1, false);
            BackendMgr.SaveAndCloseEditCF();
            BackendMgr.SelectAttendeeInfoWindow();
            BackendMgr.VerifyCustomFieldPresent(CFName1, false);

            // Update registration with NonXAuth
            BackendMgr.OpenAttendeeInfoURL(eventSessionID, regID2);

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.VerifyRegistrationTypeOptions(new List<string> { Regtypes.NonxAuthType1.ToString(), Regtypes.NonxAuthType2.ToString() });
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.RegType, Regtypes.NonxAuthType2.ToString());
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.SelectAttendeeInfoWindow();
            BackendMgr.VerifyCustomFieldPresent(CFName1, true);
            BackendMgr.VerifyCustomFieldPresent(CFName2, true);
            BackendMgr.VerifyCustomFieldPresent(CFName6, true);
            BackendMgr.VerifyCustomFieldPresent(AGName1, true);
            BackendMgr.VerifyCustomFieldPresent(AGName2, true);

            string randomEmail3 = string.Format(randomEmailAddressFormat, Guid.NewGuid().ToString().Replace("-", ""));
            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Email, randomEmail3);
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.SelectAttendeeInfoWindow();

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.PersonalInformation);
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Email, "*****@*****.**");
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.First_Name, "Dev");
            BackendMgr.SetFieldValue(BackendManager.PersonalInfoEditField.Last_Name, "Two");
            BackendMgr.SaveAndCloseEditPersonalInformation();
            BackendMgr.ConfirmWhenSaveAndCloseEditPI(BackendManager.ConfirmWhenSaveEditPI.Correction);
            BackendMgr.SelectAttendeeInfoWindow();

            BackendMgr.OpenEditAttendeeSubPage(Managers.Backend.BackendManager.AttendeeSubPage.CustomFields);
            BackendMgr.SetCheckboxCFItem(CFName6, false);
            BackendMgr.SaveAndCloseEditCF();
            BackendMgr.SelectAttendeeInfoWindow();
            BackendMgr.VerifyCustomFieldPresent(CFName6, false);
        }
        public void GroupRegistrationWithNonXAuthAndXAuthRegTypes(bool onSite)
        {
            List<string> IDs = CreateEvent(onSite);
            int eventID = Convert.ToInt32(IDs[1]);
            string eventSessionID = IDs[0];
            ChangeAndResetXAuthConfiguration(eventID, eventSessionID, Regtypes.xAuthType1.ToString());

            // Part 3. Group Registration With NonXAuth And XAuth RegTypes
            if (onSite)
                RegisterMgr.OpenOnSiteRegisterPage(eventID);
            else
                RegisterMgr.OpenRegisterPage(eventID);
            string randomEmail = string.Format(randomEmailAddressFormat, Guid.NewGuid().ToString().Replace("-", ""));
            RegisterMgr.Checkin(randomEmail);
            RegisterMgr.SelectRegType(Regtypes.NonxAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(true);
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(false);
            RegisterMgr.EnterProfileInfo();
            RegisterMgr.TypePersonalInfoAddressLineTwo(addressLineTwo);
            RegisterMgr.TypePersonalInfoFax(fax);
            RegisterMgr.EnterPersonalInfoPassword(password);
            RegisterMgr.SetCustomFieldCheckBox(CFName6, true);
            RegisterMgr.Continue();
            RegisterMgr.Continue();

            RegisterMgr.ClickAddAnotherPerson();
            RegisterMgr.Checkin(Managers.ManagerProvider.XAuthMgr.DefaultAccount_Email);
            RegisterMgr.SelectRegType(Regtypes.xAuthType1.ToString());
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyMessageToRegistrantPresent(true);
            RegisterMgr.TypeLoginPagePassword(Managers.ManagerProvider.XAuthMgr.DefaultAccount_Password);
            RegisterMgr.Continue();
            RegisterMgr.XAuth_VerifyPasswordSectionPresent(false);
            RegisterMgr.XAuth_VerifyPI(RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1]);
            RegisterMgr.Continue();
            RegisterMgr.SelectAgendaItem(AGName5);
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            RegisterMgr.FinishRegistration();
            RegisterMgr.VerifyOnConfirmationPage();

            if (!onSite)
            {
                RegisterMgr.UnfoldGroupMember(0);

                RegisterManager.XAuthPersonalInfo primaryInfo = new RegisterManager.XAuthPersonalInfo();
                primaryInfo.Email = randomEmail;
                primaryInfo.FirstName = RegisterManager.DefaultPersonalInfo.FirstName;
                primaryInfo.LastName = RegisterMgr.CurrentRegistrantLastName;
                primaryInfo.MiddleName = RegisterManager.DefaultPersonalInfo.MiddleName;
                primaryInfo.JobTitle = RegisterManager.DefaultPersonalInfo.JobTitle;
                primaryInfo.Address1 = RegisterManager.DefaultPersonalInfo.AddressLineOne;
                primaryInfo.Address2 = addressLineTwo;
                primaryInfo.City = RegisterManager.DefaultPersonalInfo.City;
                primaryInfo.Company = RegisterManager.DefaultPersonalInfo.Company;
                primaryInfo.State = RegisterManager.DefaultPersonalInfo.State;
                primaryInfo.Phone = RegisterManager.DefaultPersonalInfo.WorkPhone;
                primaryInfo.Zip = RegisterManager.DefaultPersonalInfo.ZipCode;
                primaryInfo.Fax = fax;
                RegisterMgr.VerifyPrimaryRegistrationPersonalInfo(primaryInfo);
                RegisterMgr.VerifyGroupMemberPersonalInfo(RegisterMgr.TestAccounts[RegisterManager.TestAccountType.DefaultAccount1], 0);
            }
        }