public void CheckoutPage(RegisterManager.PaymentMethod paymentMethod, double totalAmount)
 {
     RegisterMgr.VerifyCheckoutTotal(totalAmount);
     RegisterMgr.VerifyCheckoutSubTotal(totalAmount);
     RegisterMgr.PayMoney(paymentMethod);
     RegisterMgr.FinishRegistration();
 }
 public static void ResetManagers()
 {
     ManagerSiteMgr = new ManagerSiteManager();
     BuilderMgr = new FormDetailManager();
     BackendMgr = new BackendManager();
     RegisterMgr = new RegisterManager();
     ReportMgr = new ReportManager();
     EmailMgr = new EmailManager();
     DataHelperTool = new DataHelper();
 }
 private bool CreateRegistrant(RegisterManager.XAuthPersonalInfo user, string regTypeName)
 {
     RegisterMgr.OpenRegisterPage(eventId);
     RegisterMgr.Checkin(user.Email);
     if (RegisterMgr.IsRegTypeEditable(regTypeName))
         RegisterMgr.SelectRegType(regTypeName);
     else
         return false;
     RegisterMgr.Continue();
     RegisterMgr.EnterPassword(Managers.ManagerProvider.XAuthMgr.DefaultAccount_Password);
     RegisterMgr.Continue();
     RegisterMgr.XAuth_VerifyPI(user);
     RegisterMgr.Continue();
     RegisterMgr.FinishRegistration();
     RegisterMgr.ConfirmRegistration();
     return true;
 }
        public void SingleRegistration(RegisterManager.PaymentMethod paymentMethod, double subTotal)
        {
            OnSiteFixtureHelper.RegistrationInfo regInfo = new OnSiteFixtureHelper.RegistrationInfo();
            this.CheckinPage("One");
            regInfo.emailAddress = RegisterMgr.CurrentEmail;
            RegisterMgr.Continue();
            this.PersonalInfoPage();
            regInfo.fullName = RegisterMgr.CurrentRegistrantFullName;
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            RegisterMgr.Continue();
            this.helper.CheckoutPage(paymentMethod, subTotal);
            RegisterMgr.ConfirmRegistration();

            regInfo.regId = Convert.ToInt32(
                RegisterMgr.GetConfirmationPageValueForPrimaryAttendee(RegisterManager.ConfirmationPageField.RegistrationId));

            this.regs.Add(regInfo);
        }
 private void RegisterNoAgendaItemsMerch(RegisterManager.PaymentMethod paymentMethod)
 {
     RegisterMgr.OpenRegisterPage(eventId);
     RegisterMgr.Checkin();
     RegisterMgr.SelectRegType(ProEvent.RegType.Name.One);
     RegisterMgr.Continue();
     this.PersonalInfoPage();
     this.emailAddress = RegisterMgr.CurrentEmail;
     RegisterMgr.Continue();
     RegisterMgr.Continue();
     RegisterMgr.Continue();
     this.CheckoutPage(RegisterType.ProEvent_Simple, ProEvent.FeeCalculation_SimpleReg.Default, paymentMethod);
     this.ConfirmationPage(RegisterType.ProEvent_Simple, ProEvent.FeeCalculation_SimpleReg.Default);
     this.regId = RegisterMgr.GetRegID();
 }
        // Determines what data to verify on checkout page
        private void CheckoutPage(RegisterType type, IFeeCalculation feeCalculation, RegisterManager.PaymentMethod paymentMethod)
        {
            switch (type)
            {
                case RegisterType.ProEvent_Single:
                case RegisterType.ProEvent_Group:
                case RegisterType.Membership:
                case RegisterType.ProEvent_Simple:
                case RegisterType.ProEvent_Update:
                    this.VerifyCheckoutFeeTotals(feeCalculation);
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;

                case RegisterType.EnduranceEvent_Single_USD:
                    this.VerifyCheckoutFeeTotals(feeCalculation);
                    RegisterMgr.ClickCheckoutActiveWaiver();
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;

                case RegisterType.EnduranceEvent_Single_Pound:
                    this.VerifyCheckoutFeeTotals(feeCalculation, MoneyTool.CurrencyCode.GBP);
                    RegisterMgr.ClickCheckoutActiveWaiver();
                    RegisterMgr.PayMoney(paymentMethod);
                    RegisterMgr.FinishRegistration();
                    break;
            }
        }
 private void PayMoneyAndVerify(RegisterManager.FeeResponse[] expFees, double amount)
 {
     RegisterMgr.VerifyRegistrationFees(expFees);
     RegisterMgr.PayMoneyAndVerify(amount, RegisterManager.PaymentMethod.Check);
 }
 private void FinishRegistrationAndVerify(RegisterManager.FeeResponse[] expFees)
 {
     RegisterMgr.FinishRegistration();
     RegisterMgr.ConfirmRegistration();
     RegisterMgr.VerifyRegistrationFees(expFees);
 }
        private void AttendeePageTransactionTest(RegisterManager.PaymentMethod method)
        {
            ManagerSiteMgr.OpenLogin();
            this.sessionId = ManagerSiteMgr.Login();
            this.managerURL = ManagerSiteMgr.GetManagerURL(this.sessionId);
            BackendMgr.OpenAttendeeInfoURL(sessionId, regId);

            if (method == RegisterManager.PaymentMethod.Check)
            {
                EventRegTypeCostTest();
                AgendaCostTest();
                MerchandiseCostTest();
                ManagerSiteMgr.OpenLogin();
                this.sessionId = ManagerSiteMgr.Login();
                this.managerURL = ManagerSiteMgr.GetManagerURL(this.sessionId);
                BackendMgr.OpenAttendeeInfoURL(sessionId, regId);
                TransactionCancelTest();
                ManagerSiteMgr.OpenLogin();
                this.sessionId = ManagerSiteMgr.Login();
                this.managerURL = ManagerSiteMgr.GetManagerURL(this.sessionId);
                BackendMgr.OpenAttendeeInfoURL(sessionId, regId);
                NewTransactionTest();
                VerifyAttendeeReport(EventName,eventId,RegisterManager.PaymentMethod.Check);
            }
            else
            {
                CreditCardTest();
                VerifyAttendeeReport(EventName,eventId,RegisterManager.PaymentMethod.CreditCard);
            }
        }
        private void VerifyAttendeeReport(string eventName,int eventId,RegisterManager.PaymentMethod method)
        {
            OpenTransactionReport(eventName);

            string tableName = "Table1"; //table id

            string thirty = MoneyTool.FormatMoney(30);
            string minusThirty = MoneyTool.FormatMoney(-30);
            string zero = MoneyTool.FormatMoney(0);
            string twenty = MoneyTool.FormatMoney(20);
            string ten = MoneyTool.FormatMoney(10);
            string minusTen = MoneyTool.FormatMoney(-10);

            if (method == RegisterManager.PaymentMethod.Check)
            {
                ReportMgr.VerifyTableReport(tableName, 1, 6, thirty);

                ReportMgr.VerifyTableReport(tableName, 1, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 2, 6, minusTen);
                ReportMgr.VerifyTableReport(tableName, 2, 7, twenty);

                ReportMgr.VerifyTableReport(tableName, 3, 6, ten);
                ReportMgr.VerifyTableReport(tableName, 3, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 4, 6, minusTen);
                ReportMgr.VerifyTableReport(tableName, 4, 7, twenty);

                ReportMgr.VerifyTableReport(tableName, 5, 6, ten);
                ReportMgr.VerifyTableReport(tableName, 5, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 6, 6, minusTen);
                ReportMgr.VerifyTableReport(tableName, 6, 7, twenty);

                ReportMgr.VerifyTableReport(tableName, 7, 6, ten);
                ReportMgr.VerifyTableReport(tableName, 7, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 8, 6, minusThirty);
                ReportMgr.VerifyTableReport(tableName, 8, 7, zero);

                ReportMgr.VerifyTableReport(tableName, 9, 6, thirty);
                ReportMgr.VerifyTableReport(tableName, 9, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 10, 6, ten);
                ReportMgr.VerifyTableReport(tableName, 10, 7, MoneyTool.FormatMoney(40));

                ReportMgr.VerifyTableReport(tableName, 11, 6, minusTen);
                ReportMgr.VerifyTableReport(tableName, 11, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 12, 6, minusTen);
                ReportMgr.VerifyTableReport(tableName, 12, 7, twenty);
            }
            else
            {
                ReportMgr.VerifyTableReport(tableName, 1, 6, thirty);
                ReportMgr.VerifyTableReport(tableName, 1, 7, thirty);

                ReportMgr.VerifyTableReport(tableName, 2, 6, minusThirty);
                ReportMgr.VerifyTableReport(tableName, 2, 7, zero);

                ReportMgr.VerifyTableReport(tableName, 3, 6, zero);
                ReportMgr.VerifyTableReport(tableName, 3, 7, zero);
            }
        }
        private void RegForTransactionTest(double totalToVerify, RegisterManager.PaymentMethod method)
        {
            //start new registration
            RegisterMgr.OpenRegisterPage(eventId);

            //check in
            RegisterMgr.Checkin();
            RegisterMgr.Continue();

            //enter profile info
            RegisterMgr.EnterProfileInfo();
            regId = RegisterMgr.GetRegIdFromSession();
            RegisterMgr.CurrentRegistrationId = regId;
            RegisterMgr.Continue();

            //select all agenda items
            RegisterMgr.SelectAgendaItems();
            RegisterMgr.Continue();

            //select merchandise
            RegisterMgr.SelectMerchandise(1);
            RegisterMgr.Continue();

            //TODO: need to abstract calculating the total
            RegisterMgr.PayMoneyAndVerify(totalToVerify, method);
            RegisterMgr.FinishRegistration();
            RegisterMgr.ConfirmRegistration();
        }
        public void VerifyTravelInformation(RegisterManager registration)
        {
            //TODO: need to verify all travel information

            string foundArrivalAirline = UIUtil.DefaultProvider.GetText(TravelArrivalAirline, LocateBy.XPath);
            Assert.AreEqual(registration.travelResponses.ArrivalAirline, foundArrivalAirline);

            string foundArrivalFlightNumber = UIUtil.DefaultProvider.GetText(TravelArrivalFlightNumber, LocateBy.XPath);
            Assert.AreEqual(registration.travelResponses.ArrivalFlightNumber, foundArrivalFlightNumber);
        }
        public void VerifyLodgingInformation(RegisterManager registration)
        {
            //TODO: need to verify ALL lodging information
            //DateTime foundArrivalDate = DateTime.Parse(GetText(LodgingArrivalDate));
            //Assert.AreEqual(registration.lodgingResponses.ArrivalDate, foundArrivalDate);

            //DateTime foundDepartureDate = DateTime.Parse(GetText(LodgingDepartureDate));
            //Assert.AreEqual(registration.lodgingResponses.DepartureDate, foundDepartureDate);

            string foundBedPreference = UIUtil.DefaultProvider.GetText(LodgingBedPreference, LocateBy.XPath);
            Assert.AreEqual(registration.lodgingResponses.BedType, foundBedPreference);

            string foundRoomPreference = UIUtil.DefaultProvider.GetText(LodgingRoomPreference, LocateBy.XPath);
            Assert.AreEqual(registration.lodgingResponses.RoomType, foundRoomPreference);

            string foundSmokingPreference = UIUtil.DefaultProvider.GetText(LodgingSmokingPreference, LocateBy.XPath);
            Assert.AreEqual(registration.lodgingResponses.SmokingPreference, foundSmokingPreference);
        }
 public void VerifyAttendeeInfoInformation(RegisterManager registration, int registrationID)
 {
     this.VerifyCustomFields(registration.customFieldResponses, registrationID);
     this.VerifyAgendaItems(registration.customFieldResponses, registrationID);
     this.VerifyMerchandise(registration.merchandiseResponses, registrationID);
     this.VerifyLodgingInformation(registration);
     this.VerifyTravelInformation(registration);
     this.VerifyTotalCharges(registration.CurrentTotal);
     this.VerifyTotalTransactions(registration.CurrentTotal);
     this.VerifyTotalBalanceDue(registration.CurrentTotal);
 }
 public void VerifyAttendeeInfoInformation(RegisterManager registration)
 {
     this.VerifyAttendeeInfoInformation(registration, registration.CurrentRegistrationId);
 }
 /// <summary>
 /// Only type the JobTitle,Company,AddressLineOne,AddressLineTwo,City,State,ZipCode,WorkPhone,Extension,Fax
 /// </summary>
 public void XAuth_SetDefaultStandardPersonalInfoFields(RegisterManager.XAuthPersonalInfo personalInfo,bool isAttendeeExisted)
 {
     SetDefaultStandardPersonalInfoFields((PersonalInfo)personalInfo, isAttendeeExisted);
 }