public void Test001_AddPage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Page'"); BlankPage 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"); AdminPageManagementPage 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"); }
public void LoginToSite() { var doc = XDocument.Load(@"BVT\" + Settings.Default.BVTDataFile); XElement settings = doc.Document.Element("Tests").Element("settings"); _driver = StartBrowser(settings.Attribute("browser").Value); _baseUrl = settings.Attribute("baseURL").Value; Trace.WriteLine(BasePage.RunningTestKeyWord + "'Modules BVT'"); Trace.WriteLine(BasePage.PreconditionsKeyWord); MainPage mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); _loginPage = new LoginPage(_driver); _loginPage.OpenUsingUrl(_baseUrl); _loginPage.DoLoginUsingUrl("host", "dnnhost"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl); blankPage.AddNewPage(_pageName); }