Beispiel #1
0
        /// <summary>
        /// Enables Print Manager for Mozilla browsers
        /// </summary>
        /// <param name="CurrentPage">Current page reference</param>
        public static void EnablePrintManager(object CurrentPage)
        {
            System.Web.UI.Page HostPage;
            HostPage = (System.Web.UI.Page)CurrentPage;
            string strHTML = "<script type=\"text/javascript\"><!--\n if(FusionCharts && FusionCharts.printManager) FusionCharts.printManager.enabled(true);\n// --></script>";

            HostPage.ClientScript.RegisterClientScriptBlock(HostPage.GetType(), "", strHTML);
        }
Beispiel #2
0
        private void DoNavigateToOutsidePage(string pageClassName, string openMethod)
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To " + pageClassName + "'");

            Type pageClassType = Type.GetType("DotNetNuke.Tests.DNNSelenium." + pageClassName);

            if (pageClassType != null)
            {
                var navToPage = Activator.CreateInstance(pageClassType, new object[] { _driver });

                HostPage hostPage = new HostPage(_driver);
                Type     myType   = hostPage.GetType();

                var miOpen = myType.GetMethod(openMethod);
                if (miOpen != null)
                {
                    miOpen.Invoke(hostPage, new object[] { _baseUrl });
                }
                else
                {
                    Trace.WriteLine(BasePage.RunningTestKeyWord + "ERROR: cannot call " + openMethod + "for class " + pageClassName);
                }

                var fiWindowTitle = pageClassType.GetField("WindowTitle");
                var windowTitle   = (string)fiWindowTitle.GetValue(null);

                var fiOutsideUrl = pageClassType.GetField("OutsideUrl");
                var outsideUrl   = (string)fiOutsideUrl.GetValue(null);

                var basePage = (BaseOutsidePage)navToPage;

                Utilities.SoftAssert(
                    () => Assert.That(basePage.CurrentWindowTitle(), Is.EqualTo(windowTitle), "Current window Title is not correct."));

                Assert.That(basePage.CurrentWindowUrl(), Is.EqualTo(outsideUrl), "Current window URL is not correct.");
            }
            else
            {
                Trace.WriteLine(BasePage.RunningTestKeyWord + "ERROR: cannot create class " + pageClassName);
            }
        }