/// <summary> /// Checks or unchecks monthly newsletters check box. /// </summary> /// <param name="signMeUpNewsletters">TRUE = Check the box, FALSE = Uncheck the box. If the checkbox is already in the /// requested state it will be left alone.</param> public void CheckOrUncheckMonthlyNewsletters(bool signMeUpNewsletters) { AccountInfo accountInfo = new AccountInfo(); accountInfo.SignMeUpNewsletters = signMeUpNewsletters; browser.ClickTitleBar(); accountInfo.CheckOrUncheckMonthlyNewsletters(); }
public void CheckOrUncheckNewReleases(bool signMeUpNewReleases) { AccountInfo accountInfo = new AccountInfo(); accountInfo.SignMeUpNewReleases = signMeUpNewReleases; browser.ClickTitleBar(); accountInfo.CheckOrUncheckNewReleases(); }
/// <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 = 100; Keyboard.DefaultKeyPressTime = 40; Delay.SpeedFactor = 1.0; const string homePageURI = "integration.lynda.com/member.aspx"; Browser browserIE = new Browser(BrowserProduct.IE,homePageURI,true); browserIE.HalfSize(); Browser browserFF = new Browser(BrowserProduct.Firefox,homePageURI,true); browserFF.HalfSize(); browserFF.Move(200,200); //Create new member home page instance which also waits for the page to load HomePageMember homePageMemberIE = new HomePageMember(browserIE); HomePageMember homePageMemberFF = new HomePageMember(browserFF); homePageMemberIE.ClickSubscribeLink(); homePageMemberFF.ClickSubscribeLink(); RegPageStep1 regPageStep1IE = new RegPageStep1(browserIE); RegPageStep1 regPageStep1FF = new RegPageStep1(browserFF); regPageStep1IE.SelectOTLSubscription(OTLSubscriptionPlanRegPage1.SubscriptionPlan.MonthlyPremium); regPageStep1FF.SelectOTLSubscription(OTLSubscriptionPlanRegPage1.SubscriptionPlan.Annual); regPageStep1IE.FillAccountInfo(new AccountInfo(AccountInfo.DefaultInfo.Standard)); AccountInfo accountInfo = new AccountInfo(AccountInfo.DefaultInfo.Standard); accountInfo.FirstName="John"; regPageStep1FF.FillAccountInfo(accountInfo); regPageStep1IE.ClickContinue(); regPageStep1FF.ClickContinue(); RegPageStep2 regPageStep2IE = new RegPageStep2(browserIE,BillingInformation.DefaultInfo.Standard, PaymentInformation.DefaultInfo.Standard); RegPageStep2 regPageStep2FF = new RegPageStep2(browserFF,BillingInformation.DefaultInfo.Standard, PaymentInformation.DefaultInfo.Standard); regPageStep2IE.ClickIHaveRead(); regPageStep2IE.ClickStartMembership(); regPageStep2FF.ClickIHaveRead(); regPageStep2FF.ClickStartMembership(); }
public void CheckOrUncheckSpecialAnnouncements(bool signMeUpSpecial) { AccountInfo accountInfo = new AccountInfo(); accountInfo.SignMeUpSpecial=signMeUpSpecial; browser.ClickTitleBar(); accountInfo.CheckOrUncheckSpecial(); }
/// <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); }
/// <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)) { }
/// <summary> /// Gets account information from web page. /// </summary> /// <returns>Account information from web page.</returns> public AccountInfo GetAccountInfo() { AccountInfo accountInfo = new AccountInfo(); browser.ClickTitleBar(); accountInfo.GetAccountInfo(); return accountInfo; }
/// <summary> /// Enters custom Lynda.Test.ConsumerPages.AccountInfo.Field data into web page field. /// </summary> /// <param name="formField">Field to enter data in.</param> /// <param name="fieldData">Data to enter.</param> public void FillAccountInfo(AccountInfo.Field formField, string fieldData) { AccountInfo accountInfo = new AccountInfo(); browser.ClickTitleBar(); accountInfo.EnterAccountInfo(formField, fieldData); }
/// <summary> /// Enters custom account information into web page. /// </summary> /// <param name="accountInfo">Custom account information.</param> public void FillAccountInfo(AccountInfo accountInfo) { browser.ClickTitleBar(); accountInfo.EnterAccountInfo(); }
/// <summary> /// Enters Lynda.Test.ConsumerPages.AccountInfo.DefaultInfo.Standard account information into web page. /// </summary> public void FillAccountInfo() { AccountInfo accountInfo = new AccountInfo(AccountInfo.DefaultInfo.Standard); FillAccountInfo(accountInfo); }
/// <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(); }
/// <summary> /// Enters value for field Lynda.Test.ConsumerPage.AccountInfo.Field from this AccountInfo instance /// into the Ranorex.Adpater field on the web page. /// </summary> internal void EnterAccountInfo(AccountInfo.Field formField, string fieldData) { switch (formField) { case Field.FirstName: { FirstName=fieldData; TypeFirstName(); break; } case Field.LastName: { LastName=fieldData; TypeLastName(); break; } case Field.Email: { Email=fieldData; TypeEmail(); break; } case Field.Username: { Username=fieldData; TypeUsername(); break; } case Field.Password: { Password=fieldData; TypePassword(); break; } case Field.ConfirmPassword: { PasswordConfirm=fieldData; TypeConfirmPassword(); break; } default: throw new Exception(String.Format("Code not implemented yet: {0}", formField.ToString())); } }