Ejemplo n.º 1
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 = 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();
        }
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 = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;

            string installedBrowserPath = Browser.GetInstalledExePath(BrowserProduct.IE);
            if (installedBrowserPath == null)
            {
                throw new Exception("Internet Explorer is not installed.");
            }
            int installedBrowserVersion = Browser.GetInstalledVersion(BrowserProduct.IE);
            if (installedBrowserVersion != 9)
            {
                throw new Exception(string.Format("Internet Explorer version {0} ({1}) is not supported by this test. Supported version: 9.", installedBrowserVersion, installedBrowserPath));
            }

              			const string uri = "www.lynda.com";

            Browser browser1 = new Browser(BrowserProduct.IE, uri, true);
            browser1.HalfSize();
            browser1.Move(100, 100);

            Browser browser2 = new Browser(BrowserProduct.Safari, uri, true);
            browser2.HalfSize();
            browser2.Move(200, 200);

            Browser browser3 = new Browser(BrowserProduct.Firefox, uri, true);
            browser3.HalfSize();
            browser3.Move(300, 300);

            Browser browser4 = new Browser(BrowserProduct.Chrome, uri, true);
            browser4.HalfSize();
            browser4.Move(400,400);

            Ranorex.ATag loginLink;
            const string loginLinkRxPath = "dom/body/div[@id='eyebrow']/div[1]/ul/li[4]/a[@id='login-modal']";

            browser1.ClickTitleBar();
            loginLink = Host.Local.FindSingle<Ranorex.ATag>(loginLinkRxPath);
            loginLink.Click();
            Report.Log(ReportLevel.Info,browser1.CurrentUri);

            browser2.ClickTitleBar();
            loginLink = Host.Local.FindSingle<Ranorex.ATag>(loginLinkRxPath);
            loginLink.Click();
            Report.Log(ReportLevel.Info,browser2.CurrentUri);

            browser3.ClickTitleBar();
            loginLink = Host.Local.FindSingle<Ranorex.ATag>(loginLinkRxPath);
            loginLink.Click();
            Report.Log(ReportLevel.Info,browser3.CurrentUri);

            browser4.ClickTitleBar();
            loginLink = Host.Local.FindSingle<Ranorex.ATag>(loginLinkRxPath);
            loginLink.Click();
            Report.Log(ReportLevel.Info,browser4.CurrentUri);

            browser1.Navigate(uri);
            browser2.Navigate(uri);
            browser3.Navigate(uri);
            browser4.Navigate(uri);

            int total = 3;
            Browser[] browsers = new Browser[total];
            for (int i = 0; i <= total-1; i++)
            {
                browsers[i] = new Browser(BrowserProduct.IE, "lynda.com");
                browsers[i].HalfSize();
                browsers[i].HalfSize();
                browsers[i].Move((i+1) * 10, (i+1) * 10);
            }

            browsers[2].Fun();
        }