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("adminExtensions"); _driver = StartBrowser(settings.Attribute("browser").Value); _baseUrl = settings.Attribute("baseURL").Value; string testName = pageSettings.Attribute("name").Value; _adminExtensionToEdit = pageSettings.Attribute("adminExtensionToEdit").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"); ManageUsersPage manageUsersPage = new ManageUsersPage(_driver); manageUsersPage.OpenUsingControlPanel(_baseUrl); manageUsersPage.AddNewUser("Admin", "Admin", "*****@*****.**", "dnnadmin"); manageUsersPage.ManageRoles("Admin"); manageUsersPage.AssignRoleToUser("Administrators"); _loginPage.LoginUsingUrl(_baseUrl, "Admin", "dnnadmin"); }
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"); HostSettingsPage hostSettingsPage = new HostSettingsPage(_driver); hostSettingsPage.OpenUsingButtons(_baseUrl); hostSettingsPage.Click(By.XPath(HostSettingsPage.BasicSettingsTab)); _serverName = hostSettingsPage.FindElement(By.XPath(HostSettingsPage.HostName)).Text; }
public void LoginToSite() { var doc = XDocument.Load(@"SmokeTest\" + Settings.Default.SmokeDataFile); XElement settings = doc.Document.Element("Tests").Element("settings"); _driver = StartBrowser(settings.Attribute("browser").Value); _baseUrl = settings.Attribute("baseURL").Value; _siteAlias = settings.Attribute("siteAlias").Value; _siteName = settings.Attribute("siteName").Value; _pageName = settings.Attribute("pageName").Value; _userName = settings.Attribute("userName").Value; Trace.WriteLine(BasePage.PreconditionsKeyWord); var installerPage = new InstallerPage(_driver); installerPage.OpenUsingUrl(_baseUrl); //installerPage.WelcomeScreen(); LoginPage loginPage = new LoginPage(_driver); loginPage.WaitForElement(By.XPath("//*[@id='" + LoginPage.LoginLink + "' and not(contains(@href, 'Logoff'))]"), 20).WaitTillVisible(20).Click(); loginPage.WaitAndSwitchToFrame(30); loginPage.DoLoginUsingLoginLink("host", "dnnhost"); loginPage.WaitAndSwitchToWindow(30); AdminSiteSettingsPage adminSiteSettingsPage = new AdminSiteSettingsPage(_driver); adminSiteSettingsPage.OpenUsingButtons(_baseUrl); adminSiteSettingsPage.DisablePopups(); }
public void LoginToSite() { var doc = XDocument.Load(@"P1\" + Settings.Default.P1DataFile); XElement settings = doc.Document.Element("Tests").Element("settings"); XElement groupSettings = doc.Document.Element("Tests").Element("securityRoleGroup"); string testName = groupSettings.Attribute("name").Value; _roleGroupName = groupSettings.Attribute("roleGroupName").Value; _roleGroupDescription = groupSettings.Attribute("roleGroupDescription").Value; _roleName = groupSettings.Attribute("roleName").Value; _assignedRoleGroupName = groupSettings.Attribute("assignedRoleGroupName").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"); ManageRolesPage manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddNewSecurityRole(_roleName); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddNewSecurityRoleGroup(_assignedRoleGroupName); }
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 + "'Security Roles BVT'"); Trace.WriteLine(BasePage.PreconditionsKeyWord); MainPage mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); _loginPage = new LoginPage(_driver); _loginPage.OpenUsingUrl(_baseUrl); _loginPage.DoLoginUsingUrl("host", "dnnhost"); ManageRolesPage manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddNewSecurityRole(_assignedRoleName); ManageUsersPage manageUsersPage = new ManageUsersPage(_driver); manageUsersPage.OpenUsingControlPanel(_baseUrl); manageUsersPage.AddNewUser(_userName, _userDisplayName, _userEmail, _userPassword); }
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 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; _pageName = pageSettings.Attribute("pageName").Value; _pageDescription = pageSettings.Attribute("pageDescription").Value; _pageName1 = pageSettings.Attribute("pageName1").Value; _pageName2 = pageSettings.Attribute("pageName2").Value; _pageName3 = pageSettings.Attribute("pageName3").Value; _pageName4 = pageSettings.Attribute("pageName4").Value; _addWebAfter = pageSettings.Attribute("addWebAfter").Value; _addHostAfter = pageSettings.Attribute("addHostAfter").Value; _moveAfterWebPage = pageSettings.Attribute("moveAfterWebPage").Value; _moveAfterHostPage = pageSettings.Attribute("moveAfterHostPage").Value; _templateName = pageSettings.Attribute("templateName").Value; _templateDescription = pageSettings.Attribute("templateDescription").Value; _importedPageName = pageSettings.Attribute("importedPageName").Value; _insertPageAfter = pageSettings.Attribute("insertPageAfter").Value; _copiedPageName = pageSettings.Attribute("copiedPageName").Value; _parentPageName = pageSettings.Attribute("parentPageName").Value; _copyFromPage = pageSettings.Attribute("copyFromPage").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"); }
public void Login() { 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 + "'Navigation'"); Trace.WriteLine(BasePage.PreconditionsKeyWord); var mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); _loginPage = new LoginPage(_driver); _loginPage.OpenUsingUrl(_baseUrl); _loginPage.DoLoginUsingUrl("host", "dnnhost"); }
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("taxonomy"); 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"); }
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("hostExtensions"); _driver = StartBrowser(settings.Attribute("browser").Value); _baseUrl = settings.Attribute("baseURL").Value; string testName = pageSettings.Attribute("name").Value; _hostExtensionNameToInstall = pageSettings.Attribute("hostExtensionNameToInstall").Value; _hostFileToUpload = pageSettings.Attribute("hostFileToUpload").Value; _hostExtensionToEdit = pageSettings.Attribute("hostExtensionToEdit").Value; _newDescription = pageSettings.Attribute("newDescription").Value; _extensionNameToCreate = pageSettings.Attribute("extensionNameToCreate").Value; _friendlyExtensionNameToCreate = pageSettings.Attribute("friendlyExtensionNameToCreate").Value; _moduleNameToCreate = pageSettings.Attribute("moduleNameToCreate").Value; _adminExtensionNameToInstall = pageSettings.Attribute("adminExtensionNameToInstall").Value; _adminFileToUpload = pageSettings.Attribute("adminFileToUpload").Value; _adminExtensionToEdit = pageSettings.Attribute("adminExtensionToEdit").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"); }
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); }
//[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++; } }
public void NavigationToLoginPage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Login Page'"); MainPage mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); LoginPage loginPage = new LoginPage(_driver); loginPage.LetMeOut(); loginPage.OpenUsingUrl(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Page Title for '" + LoginPage.PageTitleLabel + "' page:"); StringAssert.Contains(LoginPage.PageTitleLabel, loginPage.WaitForElement(By.XPath("//span[contains(@id, '" + BasePage.PageTitle + "')]")).Text, "The wrong page is opened or The title of " + LoginPage.PageTitleLabel + " page is changed"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present'"); Assert.IsTrue(loginPage.ElementPresent(By.XPath(BasePage.SearchBox)), "The Search Box is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present'"); Assert.IsTrue(loginPage.ElementPresent(By.XPath(BasePage.SearchButton)), "The Search Button is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present'"); Utilities.SoftAssert(() => StringAssert.Contains(BasePage.CopyrightText, loginPage.FindElement(By.Id(BasePage.CopyrightNotice)).Text, "Copyright notice is not present or contains wrong text message")); loginPage.DoLoginUsingLoginLink("host", "dnnhost"); }
public void SearchResultsOnMainPage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results Main Page'"); LoginPage loginPage = new LoginPage(_driver); loginPage.LetMeOut(); loginPage.OpenUsingUrl(_baseUrl); loginPage.DoLoginUsingLoginLink("host", "dnnhost"); MainPage mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); VerifySearchResults(mainPage); }
public void SearchResultsOnLoginPage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results On Login Page'"); LoginPage loginPage = new LoginPage(_driver); loginPage.LetMeOut(); loginPage.OpenUsingUrl(_baseUrl); VerifySearchResults(loginPage); }
private void RunUpgradeTest(XElement settings) { string testName = settings.Attribute("name").Value; string baseUrl = settings.Attribute("baseURL").Value; string browser = settings.Attribute("browser").Value; string userName = settings.Attribute("UserName").Value; string password = settings.Attribute("Password").Value; IWebDriver driver = StartBrowser(browser); Trace.WriteLine("Running TEST: '" + testName + "'"); UpgradePage upgradePage = new UpgradePage(driver); upgradePage.OpenUsingUrl(baseUrl); upgradePage.FillAccountInfo(userName, password); upgradePage.ClickOnUpgradeButton(); upgradePage.WaitForUpgradingProcessToFinish(); upgradePage.ClickOnSeeLogsButton(); upgradePage.WaitForLogContainer(); Trace.WriteLine("Assert Log records: "); StringAssert.DoesNotContain("ERROR", upgradePage.FindElement(By.XPath(UpgradePage.UpgraderLogContainer)).Text, "PLZ check log file, it contains error messages"); upgradePage.ClickOnVisitWebsiteButton(); var installerPage = new InstallerPage(driver); installerPage.WelcomeScreen(); LoginPage loginPage = new LoginPage(driver); loginPage.WaitForElement(By.XPath("//*[@id='" + LoginPage.LoginLink + "' and not(contains(@href, 'Logoff'))]"), 20).WaitTillVisible(20).Click(); loginPage.WaitAndSwitchToFrame(30); loginPage.DoLoginUsingLoginLink(userName, password); loginPage.WaitAndSwitchToWindow(30); HostSettingsPage hostSettingsPage = new HostSettingsPage(driver); hostSettingsPage.OpenUsingButtons(baseUrl); hostSettingsPage.Click(By.XPath(HostSettingsPage.LogsTab)); SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"), By.XPath(HostSettingsPage.LogFilesDropDownList), HostSettingsPage.OptionOne, SlidingSelect.SelectByValueType.Contains); hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent)); StringAssert.Contains("the script ran successfully", hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Log File is not empty"); SlidingSelect.SelectByValue(driver, By.XPath("//a[contains(@id, '" + HostSettingsPage.LogFilesDropDownArrow + "')]"), By.XPath(HostSettingsPage.LogFilesDropDownList), HostSettingsPage.OptionTwo, SlidingSelect.SelectByValueType.Contains); hostSettingsPage.WaitForElement(By.XPath(HostSettingsPage.LogContent)); StringAssert.DoesNotContain("ERROR", hostSettingsPage.FindElement(By.XPath(HostSettingsPage.LogContent)).Text, "The Installer Log File contains ERRORS"); }
private void RunInstallTest(XElement settings) { string testName = settings.Attribute("name").Value; string baseUrl = settings.Attribute("baseURL").Value; string browser = settings.Attribute("browser").Value; string template = settings.Attribute("Template").Value; string installerLanguage = settings.Attribute("InstallerLanguage").Value; string language = settings.Attribute("Language").Value; string username = settings.Attribute("UserName").Value; string password = settings.Attribute("Password").Value; string websiteName = settings.Attribute("WebsiteName").Value; IWebDriver driver = StartBrowser(browser); Trace.WriteLine("Running TEST: '" + testName + "'"); InstallerPage installerPage = new InstallerPage(driver); installerPage.OpenUsingUrl(baseUrl); installerPage.SetInstallerLanguage(installerLanguage); installerPage.SetDictionary(installerLanguage); installerPage.FillAccountInfo(settings); installerPage.ClickOnContinueButton(); installerPage.WaitForInstallationProcessToFinish(); installerPage.ClickOnVisitWebsiteButton(); Trace.WriteLine(BasePage.TraceLevelComposite + "Login to the site first time, using 'Visit Website' button:"); Trace.WriteLine(BasePage.TraceLevelComposite + "Set site language: '" + language + "'"); installerPage.SetDictionary(language); Trace.WriteLine(BasePage.TraceLevelPage + "Verify frame title: '" + installerPage.CurrentFrameTitle() + "'"); StringAssert.Contains(installerPage.Translate("WelcomeScreenTitle"), installerPage.CurrentFrameTitle(), "The Welcome Screen title is missing or incorrect"); installerPage.WaitAndSwitchToFrame(60); installerPage.WaitForElement(By.Id(InstallerPage.IntroVideo), 60).WaitTillVisible(60); installerPage.WaitForElement(By.Id(InstallerPage.WhatIsNew), 60).WaitTillVisible(60); installerPage.WaitForElement(By.Id(InstallerPage.LetMeAtIn), 60).WaitTillEnabled().Click(); installerPage.WaitAndSwitchToWindow(60); LoginPage loginPage = new LoginPage(driver); Trace.WriteLine("Verify Website Name: '" + websiteName + "'"); Utilities.SoftAssert(() => StringAssert.Contains(websiteName, installerPage.CurrentWindowTitle(), "The website name is incorrect")); switch (template) { case "Default Template": { loginPage.LoginUsingLoginLinkAndFrame(username, password); //default template; look for menu options, 4 options should be present Trace.WriteLine("Assert current Template: Default: "); Assert.AreEqual(4, installerPage.FindElements(By.XPath("//ul[@id='dnn_pnav']/li")).Count(), "This is not a Default page or The number of options are incorrect"); loginPage.LoginUsingUrl(baseUrl, username, password); //default template; look for menu options, 4 options should be present Trace.WriteLine("Assert current Template: Default: "); Assert.AreEqual(4, installerPage.FindElements(By.XPath("//ul[@id='dnn_pnav']/li")).Count(), "This is not a Default page or The number of options are incorrect"); break; } case "Mobile Template": { Trace.WriteLine("Assert current Template: Mobile: "); Assert.AreEqual(3, installerPage.FindElements(By.XPath("//ol[@class='mobileInstruction']/li")).Count(), "This is not a Mobile page or The mobile instructions are not present on the page or The number of mobile instructions steps are incorrect"); break; } case "Blank Template": { loginPage.LoginUsingLoginLinkAndFrame(username, password); //blank template; look for the "Home" option (only one option is present) Trace.WriteLine("Assert current Template: Blank: "); Assert.AreEqual(1, installerPage.FindElements(By.XPath("//ul[@id='dnn_pnav']/li")).Count(), "This is not a Blank page or The number of options are incorrect"); loginPage.LoginUsingUrl(baseUrl, username, password); //blank template; look for the "Home" option (only one option is present) Trace.WriteLine("Assert current Template: Blank: "); Assert.AreEqual(1, installerPage.FindElements(By.XPath("//ul[@id='dnn_pnav']/li")).Count(), "This is not a Blank page or The number of options are incorrect"); break; } } }