Esempio n. 1
0
        /// <summary>
        /// Selects an OTL subscription plan on the web page.
        /// </summary>
        /// <param name="subscriptionPlan">Lynda.Test.ConsumerPages.OTLSubscriptionPlan.SubscriptionPlan type to select.</param>
        public void SelectOTLSubscription(OTLSubscriptionPlanRegPage1.SubscriptionPlan subscriptionPlan)
        {
            OTLSubscriptionPlanRegPage1 otlSubscriptionPlan = new OTLSubscriptionPlanRegPage1(subscriptionPlan);

            browser.ClickTitleBar();
            otlSubscriptionPlan.EnterOTLSubscriptionPlan();
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new Lynda.Test.ConsumerPages.RegPageStep1 class.
 /// </summary>
 /// <param name="browserForPage">Browser instance containing the consumer registration page step 1.</param>
 /// <param name="subscription">Subscription to select.</param>
 /// <param name="customAccountInfo">Custom account information to enter.</param>
 public RegPageStep1(Browser browserForPage, OTLSubscriptionPlanRegPage1.SubscriptionPlan subscription, AccountInfo customAccountInfo) :
     this(browserForPage)
 {
     SelectOTLSubscription(subscription);
     FillAccountInfo(customAccountInfo);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new Lynda.Test.ConsumerPages.RegPageStep1 class.
 /// </summary>
 /// <param name="browserForPage">Browser instance containing the consumer registration page step 1.</param>
 /// <param name="subscription">Subscription to select.</param>
 /// <param name="accountDefaultInfo">Type of account information to enter.</param>
 public RegPageStep1(Browser browserForPage, OTLSubscriptionPlanRegPage1.SubscriptionPlan subscription, AccountInfo.DefaultInfo accountDefaultInfo) :
     this(browserForPage, subscription, new AccountInfo(accountDefaultInfo))
 {
 }
Esempio n. 4
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()
        {
            const string testCaseName                = "AllRegistrations";
            string       subscriptionPlanRow         = TestSuite.Current.GetTestCase(testCaseName).DataContext.CurrentRow["SubscriptionPlan"];
            string       regPage2PlanNameExpected    = TestSuite.Current.GetTestCase(testCaseName).DataContext.CurrentRow["regPage2PlanNameExpected"];
            string       confirmPagePlanNameExpected = TestSuite.Current.GetTestCase(testCaseName).DataContext.CurrentRow["confirmPagePlanNameExpected"];

            OTLSubscriptionPlanRegPage1.SubscriptionPlan subscriptionPlanToSelect = (OTLSubscriptionPlanRegPage1.SubscriptionPlan)
                                                                                    Enum.Parse(typeof(OTLSubscriptionPlanRegPage1.SubscriptionPlan), subscriptionPlanRow, false);

            Mouse.DefaultMoveTime        = AppSettings.MouseDefaultMoveTime;
            Keyboard.DefaultKeyPressTime = AppSettings.KeyboardDefaultKeyPressTime;
            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, subscriptionPlanToSelect,
                                                         AccountInfo.DefaultInfo.Standard);

            OTLSubscriptionPlanRegPage1 otlPlan = regPageStep1.GetOTLSubscriptionPlan();

            //e.g. Monthly, MonthlyPremium, Annual, AnnualPremium
            OTLSubscriptionPlanRegPage1.SubscriptionPlan regPage1PlanSelected = otlPlan.Subscription;
            //e.g. "$37.50/month" "$250.00/year" "$375.00/year" "$25.00/month"
            string regPage1PlanPrice = otlPlan.SubscriptionPrice;

            regPageStep1.ClickContinue();

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

            OTLSubscriptionPlanRegPage2 otlPlanPage2 = regPageStep2.GetOTLSubscriptionPlan();
            //e.g. "Monthly Premium Subscription" "Monthly Subscription" "Annual Subscription" "Annual Premium Subscription"
            string regPage2PlanName = otlPlanPage2.PlanName;
            //e.g. "$37.50/month" "$25.00/month" "$250.00/year" "$375.00/year"
            string regPage2PlanPrice = otlPlanPage2.PlanPrice;

            regPageStep2.ClickIHaveRead();
            regPageStep2.ClickStartMembership();

            RegConfirm  regPageConfirm       = new RegConfirm(browser);
            OTLPlanInfo otlPlanInfo          = regPageConfirm.GetOTLPlanInfo();
            string      confirmPagePlanName  = otlPlanInfo.Name;  //e.g. "Monthly Premium" "Monthly" "Annual" "Annual Premium"
            string      confirmPagePlanPrice = otlPlanInfo.Price; //e.g. "$37.50" "$25.00" "$250.00" "$375.00"

            regPageConfirm.ClickLogoutLink();

            homePageMember.WaitForLoad();

            //Verify displayed subscription info on reg page 2 and confirm page matches what was selected on reg page 1.
            Validate.AreEqual(string.Compare(regPage2PlanName, regPage2PlanNameExpected, false), 0,
                              "Actual:{0} Expected:{1}", true);
            Validate.AreEqual(string.Compare(confirmPagePlanName, confirmPagePlanNameExpected, false), 0,
                              "Actual:{0} Expected:{1}", true);
            Validate.AreEqual(string.Compare(regPage1PlanPrice, regPage2PlanPrice, false), 0,
                              "Actual:{0} Expected:{1}", true);
            Validate.AreEqual(string.Compare(confirmPagePlanPrice, regPage2PlanPrice.Substring(0, confirmPagePlanPrice.Length), false), 0,
                              "Actual:{0} Expected:{1}", true);
        }
Esempio n. 5
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();
        }