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++; } }
public void Test002_AddModule() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Module'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, _pageName); Modules module = new Modules(_driver); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(Modules.HtmlModule, Modules.HtmlModuleOnPage, Modules.LeftPaneID); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.LeftPaneID + Modules.HtmlProModuleOnPage); Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.LeftPaneID + Modules.HtmlProModuleOnPage)), "Module is not found"); }
public void Test0010_DragAngDropHTMLModulesToAllPanesOnPage(string pageName, string moduleName, string moduleNameOnPage, string locationID) { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag & Drop HTML Module'"); 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 fiLocationID = module.GetType().GetField(locationID); locationID = (string)fiLocationID.GetValue(null); Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag And Drop a new Module'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, pageName); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(moduleName, moduleNameOnPage, 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"); }
public void Test001_CountAvailableModules() { MainPage mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); Modules modules = new Modules(_driver); modules.OpenModulePanelUsingControlPanel(); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of available Modules: " + Modules.NumberOfAvailableModulesEEPackage); Assert.That(modules.FindElements(By.XPath(Modules.List)).Count, Is.EqualTo(Modules.NumberOfAvailableModulesEEPackage), "The number of available Modules is not correct"); }