Ejemplo n.º 1
0
        /// <summary>
        /// Gets billing information from web page.
        /// </summary>
        /// <returns>Billing information from web page.</returns>
        public BillingInformation GetBillingInfo()
        {
            BillingInformation billingInfo = new BillingInformation();

            browser.ClickTitleBar();
            billingInfo.GetBillingInfo();
            return(billingInfo);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 50;
            Keyboard.DefaultKeyPressTime = 50;
            Delay.SpeedFactor = 1.0;

            string url = string.Format("http://{0}/member.aspx",AppSettings.Domain);

            Browser browser = new Browser(AppSettings.Browser, url,true);

            HomePageMember homePageMember = new HomePageMember(browser);
            homePageMember.ClickSubscribeLink();

            RegPageStep1 regPageStep1 = new RegPageStep1(browser,OTLSubscriptionPlanRegPage1.SubscriptionPlan.MonthlyPremium,
                                                         AccountInfo.DefaultInfo.Standard);

            regPageStep1.CheckOrUncheckMonthlyNewsletters(true);
            regPageStep1.CheckOrUncheckNewReleases(true);
            regPageStep1.CheckOrUncheckSpecialAnnouncements(true);
            regPageStep1.FillAccountInfo(); //standard info default.

            //custom
            AccountInfo accountInfo = new AccountInfo(); //Nothing initialized

            accountInfo.SignMeUpNewReleases=true;
            accountInfo = new AccountInfo(AccountInfo.DefaultInfo.Standard); //Standard account info
            //change standard values to custom
            accountInfo.FirstName="Trebek";
            accountInfo.SignMeUpSpecial=false;
            regPageStep1.FillAccountInfo(accountInfo);
            //write to one field only
            regPageStep1.FillAccountInfo(AccountInfo.Field.LastName, "Connery");
            regPageStep1.FillAccountInfo(AccountInfo.Field.FirstName, "Sean");
            //get current account info
            accountInfo = regPageStep1.GetAccountInfo();
            string firstName = accountInfo.Username;
            bool newReleasesChecked = accountInfo.SignMeUpNewReleases;
            //change subscription plan
            regPageStep1.SelectOTLSubscription(OTLSubscriptionPlanRegPage1.SubscriptionPlan.Monthly);
            //get current plan
            OTLSubscriptionPlanRegPage1 otlSubscriptionPlan = regPageStep1.GetOTLSubscriptionPlan();
            OTLSubscriptionPlanRegPage1.SubscriptionPlan otlCurrentPlan = otlSubscriptionPlan.Subscription;

            regPageStep1.ClickContinue();

            RegPageStep2 regPageStep2 = new RegPageStep2(browser, BillingInformation.DefaultInfo.Standard,
                                                         PaymentInformation.DefaultInfo.Standard);

            regPageStep2.FillBillingInfo(); //standard info default
            regPageStep2.FillPaymentInfo(); //standard info default
            //custom
            BillingInformation billingInfo = new BillingInformation(); //nothing initialized
            billingInfo.HowHear="Radio";
            PaymentInformation paymentInfo = new PaymentInformation(); //nothing ititialized
            paymentInfo.ExpirationYear="2013";
            billingInfo = new BillingInformation(BillingInformation.DefaultInfo.Standard); //standard billing info
            paymentInfo = new PaymentInformation(PaymentInformation.DefaultInfo.Standard); //standard payment info
            //change standard values to custom
            billingInfo.Phone="5555551234";
            paymentInfo.ExpirationYear="2014";
            regPageStep2.FillBillingInfo(billingInfo);
            regPageStep2.FillPaymentInfo(paymentInfo);
            //write to one field only
            regPageStep2.FillBillingInfo(BillingInformation.Field.Apt, "1");
            regPageStep2.FillPaymentInfo(PaymentInformation.Field.ExpireYear, "2015");
            //get current billing and payment info
            billingInfo = regPageStep2.GetBillingInfo();
            paymentInfo = regPageStep2.GetPaymentInfo();
            string billingAddress = billingInfo.Address;
            string paymentNameOnCard = paymentInfo.NameOnCard;

            regPageStep2.ClickIHaveRead();
            regPageStep2.ClickStartMembership();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Enters Lynda.Test.ConsumerPages.BillingInformation.DefaultInfo.Standard billing information into web page.
 /// </summary>
 public void FillBillingInfo()
 {
     BillingInformation billingInfo = new BillingInformation(BillingInformation.DefaultInfo.Standard);
     FillBillingInfo(billingInfo);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new Lynda.Test.ConsumerPages.RegPageStep2 class.
 /// </summary>
 /// <param name="browserForPage">Browser instance containing the consumer registration page step 2.</param>
 /// <param name="customBillingInfo">Custom billing information to enter.</param>
 /// <param name="customPaymentInfo">Custom payment information to enter.</param>
 public RegPageStep2(Browser browserForPage, BillingInformation customBillingInfo, PaymentInformation customPaymentInfo)
     : this(browserForPage)
 {
     FillBillingInfo(customBillingInfo);
     FillPaymentInfo(customPaymentInfo);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new Lynda.Test.ConsumerPages.RegPageStep2 class.
 /// </summary>
 /// <param name="browserForPage">Browser instance containing the consumer registration page step 2.</param>
 /// <param name="billingDefaultInfo">Type of billing information to enter.</param>
 /// <param name="paymentDefaultInfo">Type of payment information to enter.</param>
 public RegPageStep2(Browser browserForPage, BillingInformation.DefaultInfo billingDefaultInfo,
                     PaymentInformation.DefaultInfo paymentDefaultInfo)
     : this(browserForPage, new BillingInformation(billingDefaultInfo), new PaymentInformation(paymentDefaultInfo))
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets billing information from web page.
 /// </summary>
 /// <returns>Billing information from web page.</returns>
 public BillingInformation GetBillingInfo()
 {
     BillingInformation billingInfo = new BillingInformation();
     browser.ClickTitleBar();
     billingInfo.GetBillingInfo();
     return billingInfo;
 }
Ejemplo n.º 7
0
 public void FillBillingInfo(BillingInformation.Field formField, string fieldData)
 {
     BillingInformation billingInfo = new BillingInformation();
     browser.ClickTitleBar();
     billingInfo.EnterBillingInfo(formField, fieldData);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Enters custom billing information into web page.
 /// </summary>
 /// <param name="billingInfo">Custom billing information.</param>
 public void FillBillingInfo(BillingInformation billingInfo)
 {
     browser.ClickTitleBar();
     billingInfo.EnterBillingInfo();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Enters custom billing information into web page.
 /// </summary>
 /// <param name="billingInfo">Custom billing information.</param>
 public void FillBillingInfo(BillingInformation billingInfo)
 {
     browser.ClickTitleBar();
     billingInfo.EnterBillingInfo();
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Enters Lynda.Test.ConsumerPages.BillingInformation.DefaultInfo.Standard billing information into web page.
        /// </summary>
        public void FillBillingInfo()
        {
            BillingInformation billingInfo = new BillingInformation(BillingInformation.DefaultInfo.Standard);

            FillBillingInfo(billingInfo);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new Lynda.Test.ConsumerPages.RegPageStep2 class.
 /// </summary>
 /// <param name="browserForPage">Browser instance containing the consumer registration page step 2.</param>
 /// <param name="customBillingInfo">Custom billing information to enter.</param>
 /// <param name="customPaymentInfo">Custom payment information to enter.</param>
 public RegPageStep2(Browser browserForPage, BillingInformation customBillingInfo, PaymentInformation customPaymentInfo) :
     this(browserForPage)
 {
     FillBillingInfo(customBillingInfo);
     FillPaymentInfo(customPaymentInfo);
 }
Ejemplo n.º 12
0
 internal void EnterBillingInfo(BillingInformation.Field formField, string fieldData)
 {
     switch (formField)
     {
         case Field.Firstname:
             {
                 FirstName=fieldData;
                 TypeFirstName();
                 break;
             }
         case Field.Lastname:
             {
                 LastName=fieldData;
                 TypeLastName();
                 break;
             }
         case Field.Company:
             {
                 Company=fieldData;
                 TypeCompany();
                 break;
             }
         case Field.Address:
             {
                 Address=fieldData;
                 TypeAddress();
                 break;
             }
         case Field.Apt:
             {
                 Apt=fieldData;
                 TypeApt();
                 break;
             }
         case Field.City:
             {
                 City=fieldData;
                 TypeCity();
                 break;
             }
         case Field.State:
             {
                 State=fieldData;
                 SelectState();
                 break;
             }
         case Field.Zip:
             {
                 Zip=fieldData;
                 TypeZip();
                 break;
             }
         case Field.Country:
             {
                 Country=fieldData;
                 SelectCountry();
                 break;
             }
         case Field.Phone:
             {
                 Phone=fieldData;
                 TypePhone();
                 break;
             }
         case Field.BillingEmail:
             {
                 BillingEmail=fieldData;
                 TypeBilling();
                 break;
             }
         case Field.HowHear:
             {
                 HowHear=fieldData;
                 SelectHowHear();
                 break;
             }
         default:
             throw new Exception(String.Format("Code not implemented yet: {0}", formField.ToString()));
     }
 }