Пример #1
0
        public void Test011_CopyPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Copy a Page'");
            var blankPage = new BlankPage(_driver);

            blankPage.OpenCopyPageFrameUsingControlPanel(_baseUrl);
            blankPage.CopyPage(_copiedPageName, _parentPageName, _copyFromPage);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
                            _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName);
            Assert.That(blankPage.CurrentWindowUrl(),
                        Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName),
                        "The page URL is not correct");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT 3 new modules added.");
            Assert.That(blankPage.FindElements(By.XPath("//li[@class = 'actionMenuMove']")).Count, Is.EqualTo(3),
                        "The Modules are not added correctly");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _copiedPageName + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _parentPageName +
                             " ']]//div/span[text() = '" + _copiedPageName + " ']")),
                "The page is not present in the list");
        }
Пример #2
0
        public void Test004_DeletePage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

            BlankPage blankPage = new BlankPage(_driver);

            blankPage.OpenUsingUrl(_baseUrl, _pageName);

            blankPage.DeletePage(_pageName);

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the list");
            Assert.IsFalse(adminPageManagementPage.ElementPresent(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
                           "The page is present in the list");

            AdminRecycleBinPage adminRecycleBinPage = new AdminRecycleBinPage(_driver);

            adminRecycleBinPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in Recycle Bin");
            Assert.IsTrue(adminRecycleBinPage.ElementPresent(By.XPath(AdminRecycleBinPage.RecycleBinPageContainerOption + "[contains(text(), '" + _pageName + "')]")));
        }
Пример #3
0
        public void Test001_AddPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Page'");

            var blankPage = new BlankPage(_driver);

            blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);

            blankPage.AddNewPage(_pageName);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
                            _baseUrl.ToLower() + "/" + _pageName);
            Assert.That(blankPage.CurrentWindowUrl(), Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _pageName),
                        "The page URL is not correct");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + " is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
                "The page is not present in the list");
        }
Пример #4
0
        public void Test001_AddWebPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Website Page'");

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.AddPage(_pageName, "Web", _addWebAfter);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[div/span[text() = '" + _addWebAfter + " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page is not present in the list");
        }
Пример #5
0
        public void Test007_AddHostMultiplePages()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add new Host Pages'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.AddPages(_pageName1, _pageName2, _pageName3, _pageName4, "Host", _addHostAfter);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);
            adminPageManagementPage.RadioButtonSelect(By.XPath(AdminPageManagementPage.HostPagesRadioButton));
            adminPageManagementPage.WaitForElement(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//span[text() = 'Host ']"));

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName1 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
                             " ']]//div/span[text() = '" + _pageName1 + " ']")),
                "The page " + _pageName1 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName2 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
                             " ']]//div/span[text() = '" + _pageName2 + " ']")),
                "The page " + _pageName2 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName3 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
                             _pageName3 + " ']")),
                "The page " + _pageName3 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName4 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
                             _pageName4 + " ']")),
                "The page " + _pageName4 + " is not present in the list");
        }
Пример #6
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++;
            }
        }
Пример #7
0
        public void Test006_AddHostPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Host Page'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.AddPage(_pageName, "Host", _addHostAfter);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);
            adminPageManagementPage.RadioButtonSelect(By.XPath(AdminPageManagementPage.HostPagesRadioButton));
            adminPageManagementPage.WaitForElement(By.XPath(AdminPageManagementPage.PageList + "//span[text() = 'Host ']"));

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
                             " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page is not present in the list");
        }
Пример #8
0
        public void Test002_AddWebMultiplePages()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add new Website Pages'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.AddPages(_pageName1, _pageName2, _pageName3, _pageName4, "Web", _addWebAfter);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName1 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addWebAfter +
                             " ']]//div/span[text() = '" + _pageName1 + " ']")),
                "The page " + _pageName1 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName2 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addWebAfter +
                             " ']]//div/span[text() = '" + _pageName2 + " ']")),
                "The page " + _pageName2 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName3 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
                             _pageName3 + " ']")),
                "The page " + _pageName3 + " is not present in the list");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName4 + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _pageName2 + " ']]//div/span[text() = '" +
                             _pageName4 + " ']")),
                "The page " + _pageName4 + " is not present in the list");
        }
Пример #9
0
        //[TestFixtureTearDown]
        public void DeleteData()
        {
            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

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

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            int pageNumber = 1;

            while (pageNumber < 51)
            {
                adminPageManagementPage.OpenUsingButtons(_baseUrl);
                adminPageManagementPage.DeletePage("Page" + pageNumber, "Web");

                pageNumber++;
            }
        }
Пример #10
0
        public void Test010_DeleteHostPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.DeletePage(_pageName, "Host");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is  NOT present in the list");
            Assert.IsFalse(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[div/span[text() = '" + _addHostAfter + " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is present in the list");
        }
Пример #11
0
        public void Test005_DeleteWebPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.DeletePage(_pageName, "Web");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is  NOT present in the list");
            Assert.IsFalse(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addWebAfter +
                             " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is present in the list");
        }
Пример #12
0
        public void Test008_EditHostPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit a Host Page'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.AddDescriptionToPage(_pageName, _pageDescription, "Host");

            var blankPage = new BlankPage(_driver);

            blankPage.OpenUsingUrl(_baseUrl, "Host/" + _addHostAfter + "/" + _pageName);
            blankPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page description: " + _pageName1 + "is saved correctly");
            Assert.That(_pageDescription, Is.EqualTo(blankPage.WaitForElement(By.XPath(BlankPage.PageDescriptionTextBox)).Text),
                        "The page description is not added correctly");
        }
Пример #13
0
        public void Test004_MoveWebPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move a Page'");

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.MovePage(_pageName, _moveAfterWebPage, "Web");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the old location");
            Assert.IsFalse(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[div/span[text() = '" + _addWebAfter + " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is present in the list after Page '" + _addWebAfter + "'");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the new location");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[div/span[text() = '" + _moveAfterWebPage + " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is not present in the list");
        }
Пример #14
0
        public void Test013_ImportPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Import a Page'");

            PageImportPage pageImportPage = new PageImportPage(_driver);

            pageImportPage.OpenUsingControlPanel(_baseUrl);

            pageImportPage.ImportPage(_templateName, _importedPageName, _insertPageAfter);

            //Assert.That(pageImportPage.CurrentWindowUrl(), Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _importedPageName),
            //					"The page URL is not correct");

            AdminPageManagementPage adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _importedPageName + "is present in the list");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath("//li[div/span[text() = '" + _insertPageAfter + " ']]/following-sibling::li[div/span[text() = '" + _importedPageName + " ']]")),
                "The page is not present in the list");
        }
Пример #15
0
        public void Test009_MoveHostPage()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move a Page'");

            var adminPageManagementPage = new AdminPageManagementPage(_driver);

            adminPageManagementPage.OpenUsingButtons(_baseUrl);

            adminPageManagementPage.MovePage(_pageName, _moveAfterHostPage, "Host");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the old location");
            Assert.IsFalse(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _addHostAfter +
                             " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is present in the list after Page '" + _addHostAfter + "'");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in the new location");
            Assert.IsTrue(
                adminPageManagementPage.ElementPresent(
                    By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _moveAfterHostPage +
                             " ']]//div/span[text() = '" + _pageName + " ']")),
                "The page " + _pageName + " is not present in the list");
        }