コード例 #1
0
ファイル: BVTUsers.cs プロジェクト: rut5949/Dnn.Platform
		public void Test004_RegisterUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Register the User'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var loginPage = new LoginPage(_driver);
			loginPage.RegisterUser(_registeredUserName, _registeredUserDisplayName, "*****@*****.**", _registeredUserPassword);

			_driver.Navigate().Refresh();

			loginPage.LoginAsHost(_baseUrl);

			var manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingUrl(_baseUrl);

			manageUsersPage.AuthorizeUser(_registeredUserName);

			manageUsersPage.OpenUsingControlPanel(_baseUrl);

			loginPage.LoginUsingLoginLink(_registeredUserName, _registeredUserPassword);

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present on the screen");
			Assert.That(mainPage.FindElement(By.XPath(ControlPanelIDs.RegisterLink)).Text, Is.EqualTo(_registeredUserDisplayName),
						"The registered User is not logged in correctly");
		}
コード例 #2
0
ファイル: CommonTestSteps.cs プロジェクト: rrsc/Dnn.Platform
		public void OpenMainPageAndLoginAsHost()
		{
			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);
		}
コード例 #3
0
ファイル: P1Modules.cs プロジェクト: rut5949/Dnn.Platform
		public void Test001_CountAvailableModules()
		{
			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var modules = new Modules(_driver);
			modules.OpenModulePanelUsingControlPanel();

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of available Modules: " +
			                Modules.NumberOfAvailableModules);
			Assert.That(modules.FindElements(By.XPath(Modules.List)).Count, Is.EqualTo(Modules.NumberOfAvailableModules),
			            "The number of available Modules is not correct");
		}
コード例 #4
0
ファイル: CommonTestSteps.cs プロジェクト: rrsc/Dnn.Platform
		public void CreateAdminAndLoginAsAdmin(string userName, string displayName, string email, string password)
		{
			ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.AddNewUser(userName, displayName, email, password);
			manageUsersPage.ManageRoles(userName);
			manageUsersPage.AssignRoleToUser("Administrators");

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.LoginUsingLoginLink(userName, password);
		}
コード例 #5
0
ファイル: P1Languages.cs プロジェクト: rrsc/Dnn.Platform
		public void Test002_EnableLanguage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Enable Language'");

			var adminLanguagesPage = new AdminLanguagesPage(_driver);
			adminLanguagesPage.OpenUsingButtons(_baseUrl);

			adminLanguagesPage.EnableLanguage(adminLanguagesPage.SetLanguageName(_languagePackToDeploy));

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "Two language flags should be available");
			Assert.That(adminLanguagesPage.FindElements(By.XPath(ControlPanelIDs.LanguageIcon)).Count, Is.EqualTo(2),
			            "The language flag number is not correct");
		}
コード例 #6
0
ファイル: P1Modules.cs プロジェクト: rajeshvar/Dnn.Platform
		public void EditContentOfExistingModuleWithCopy(string assyName, string moduleClassName, Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleContent)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit content to HTML Module'");

			var module = new Modules(_driver);

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			string moduleNameOnPage = modulesDescription["ContactUsModule"].IdWhenOnPage;
			string locationOnPage = Modules.LocationDescription["ContentPane"].IdWhenOnPage;

			Trace.WriteLine(BasePage.TraceLevelPage + "Find the original module number on 'Home' page");
			string originalModuleNumber =
				mainPage.WaitForElement(By.XPath(Modules.LocationDescription["FooterRightPane"].IdWhenOnPage + "/div[last()]/a")).GetAttribute("name");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, pageName);
			blankPage.SetPageToEditMode();

			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumberOnNewPage =
				module.WaitForElement(By.XPath(locationOnPage + moduleNameOnPage + "/a")).GetAttribute("name");

			GetHTMLModule(assyName, moduleClassName, moduleNumberOnNewPage, moduleContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content is present on the page");
			Assert.That(moduleContent,
			            Is.EqualTo(
				            module.FindElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumberOnNewPage +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content changed on 'Home' page");
			Assert.That(moduleContent,
			            Is.Not.EqualTo(
				            module.WaitForElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + originalModuleNumber +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));
		
		}
コード例 #7
0
		//[Test]
		public void NavigationToLoginPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Login Page'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var 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(ControlPanelIDs.PageTitleID)).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(ControlPanelIDs.SearchBox)),
			              "The Search Box is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present'");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(ControlPanelIDs.SearchButton)),
			              "The Search Button is missing.");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present'");
			Utilities.SoftAssert(
				() => StringAssert.Contains(ControlPanelIDs.CopyrightText, loginPage.FindElement(By.Id(ControlPanelIDs.CopyrightNotice)).Text,
				                            "Copyright notice is not present or contains wrong text message"));
		}
コード例 #8
0
ファイル: BVTSearch.cs プロジェクト: rut5949/Dnn.Platform
		public void SearchResultsOnMainPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results Main Page'");

			var loginPage = new LoginPage(_driver);

			loginPage.LetMeOut();
			loginPage.OpenUsingUrl(_baseUrl);
			loginPage.DoLoginUsingLoginLink("host", "dnnhost");

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);
			VerifySearchResults(mainPage);
		}
コード例 #9
0
ファイル: BVTChildSite.cs プロジェクト: rut5949/Dnn.Platform
		public void Test003_NavigateToChildSite()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigate to Child Site'");

			var hostSiteManagementPage = new HostSiteManagementPage(_driver);

			hostSiteManagementPage.OpenUsingButtons(_baseUrl);

			hostSiteManagementPage.NavigateToChildSite(_baseUrl, _siteAlias);

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT current window Title");
			Assert.That(mainPage.CurrentWindowTitle(), Is.StringContaining(_siteName + " > Home"),
			            "The website name is not correct");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT current window Url");
			Assert.That(mainPage.CurrentWindowUrl(), Is.StringStarting("http://" + _baseUrl + "/" + _siteAlias),
			            "The website URL is not correct");
		}
コード例 #10
0
ファイル: BVTNavigation.cs プロジェクト: rrsc/Dnn.Platform
		public void NavigationToMainPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Main Page'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);
			VerifyStandardPageLayout(mainPage);
		}
コード例 #11
0
ファイル: BVTSearch.cs プロジェクト: rajeshvar/Dnn.Platform
		public void SearchResultsOnMainPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results Main Page'");

			var loginPage = new LoginPage(_driver);

			loginPage.LoginAsHost(_baseUrl);

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);
			VerifySearchResults(mainPage);
		}
コード例 #12
0
		public void Test004_DismissNotification()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Dismiss Notification'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);

			var module = new MessageCenterModule(_driver);
			module.OpenNotificationsUsingIcon();

			module.DismissNotification(MessageCenterModule.NotificationSubject);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New notification is Not present in the list:");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@class = 'messages']//li[@class = 'ListCol-3']//span[contains(text(), '" + MessageCenterModule.NotificationSubject + "')]")),
						"Notification subject is found");
		}
コード例 #13
0
		public void Test003_SendNotification()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Send Notification'");

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			var loginPage = new LoginPage(_driver);
			loginPage.RegisterUser("RegisteredUserName", "RegisteredUserDisplayName", "*****@*****.**", _password);

			loginPage.LoginAsHost(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Notification icon contains number '1' for incoming notification :");
			Assert.That(loginPage.WaitForElement(By.XPath(ControlPanelIDs.NotificationLink + "/span")).Text, Is.EqualTo("1"));

			var module = new MessageCenterModule(_driver);
			module.OpenNotificationsUsingIcon();

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New notification is present in the list:");
			Assert.That(module.WaitForElement(By.XPath("//ul[@class = 'messages']//li[@class = 'ListCol-3']//span")).Text,
						Is.StringContaining("New User Registration"),
						"Notification subject is not found");
		}
コード例 #14
0
ファイル: P1Search.cs プロジェクト: kp-xcess/Dnn.Platform
		public void QuickSearchOnMainPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Quick Search Main Page'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);
			VerifyQuickSearch(mainPage);
		}