コード例 #1
0
        public void Test004_AddHTMLModuleToToAllPanesOnOnePage(string pageName, string moduleName, string moduleNameOnPage, string location, string locationID)
        {
            Modules module = new Modules(_driver);

            var fiModuleName = module.GetType().GetField(moduleName);

            moduleName = (string)fiModuleName.GetValue(null);

            var fiModuleNameOnPage = module.GetType().GetField(moduleNameOnPage);

            moduleNameOnPage = (string)fiModuleNameOnPage.GetValue(null);

            var fiLocation = module.GetType().GetField(location);

            location = (string)fiLocation.GetValue(null);

            var fiLocationID = module.GetType().GetField(locationID);

            locationID = (string)fiLocationID.GetValue(null);

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Module'");

            BlankPage blankPage = new BlankPage(_driver);

            blankPage.OpenUsingUrl(_baseUrl, pageName);

            module.OpenModulePanelUsingControlPanel();
            module.AddNewModuleUsingMenu(moduleName, moduleNameOnPage, location, locationID);
            string moduleNumber = blankPage.WaitForElement(By.XPath(locationID + "/div[last()]/a")).GetAttribute("name");

            blankPage.OpenUsingUrl(_baseUrl, pageName);
            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + locationID + moduleNameOnPage);
            Assert.IsTrue(blankPage.ElementPresent(By.XPath(locationID + moduleNameOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found");
        }
コード例 #2
0
        public void LoginToSite()
        {
            var doc = XDocument.Load(@"P1\" + Settings.Default.P1DataFile);

            XElement settings     = doc.Document.Element("Tests").Element("settings");
            XElement pageSettings = doc.Document.Element("Tests").Element("page");

            string testName = pageSettings.Attribute("name").Value;

            _driver  = StartBrowser(settings.Attribute("browser").Value);
            _baseUrl = settings.Attribute("baseURL").Value;

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            _loginPage = new LoginPage(_driver);
            _loginPage.OpenUsingUrl(_baseUrl);
            _loginPage.DoLoginUsingUrl("host", "dnnhost");

            //Preconditions for
            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);
            adminPageManagementPage.AddPagesInBulk("Page", 73, "Web", "Home");

            BlankPage blankPage = new BlankPage(_driver);

            Modules module = new Modules(_driver);

            int pageNumber = 1;

            while (pageNumber < 74)
            {
                blankPage.OpenUsingUrl(_baseUrl, "Home/Page" + pageNumber);
                blankPage.SetPageToEditMode("Home/Page" + pageNumber);
                string moduleNumber = module.WaitForElement(By.XPath(Modules.ContentPaneID + Modules.HtmlProModuleOnPage + "/a")).GetAttribute("name");
                module.DeleteModule(moduleNumber);
                pageNumber++;
            }

            blankPage.OpenUsingUrl(_baseUrl, "Home/Page61");
            module.OpenModulePanelUsingControlPanel();
            int i = 1;

            while (i < 5)
            {
                module.AddNewModuleUsingMenu(Modules.HtmlProModule, Modules.HtmlProModuleOnPage, Modules.ContentPaneOption, Modules.ContentPaneID);
                i++;
            }
        }
コード例 #3
0
        public void Test0011_AddExistingModuleNoCopy(string pageName)
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add Existing Module'");

            BlankPage blankPage = new BlankPage(_driver);

            blankPage.OpenUsingUrl(_baseUrl, pageName);

            Modules module = new Modules(_driver);

            module.OpenExistingModulePanelUsingControlPanel();

            blankPage.LoadableSelectByValue(By.XPath(Modules.PageDropDownId), "Home");
            blankPage.WaitForElement(By.XPath(Modules.List + "[1]"));

            module.AddNewModuleUsingMenu(Modules.ContactUsModule, Modules.HtmlProModuleOnPage, Modules.ContentPaneOption, Modules.ContentPaneID);
            string moduleNumber = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[last()]/a")).GetAttribute("name");

            blankPage.OpenUsingUrl(_baseUrl, pageName);
            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.ContentPaneID + Modules.ContactUsModule);
            Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.ContentPaneID + Modules.HtmlProModuleOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found");
        }