Ejemplo n.º 1
0
		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");
		}
Ejemplo n.º 2
0
		public void OpenMainPageAndLoginAsHost()
		{
			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.LoginAsHost(_baseUrl);
		}
Ejemplo n.º 3
0
		public void Test001_VerifyNoneRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'None' registration option'");

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

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.NoneRadioButton);

			loginPage.LetMeOut();
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' link is NOT present on the screen");
			Assert.IsFalse(loginPage.ElementPresent(By.XPath(ControlPanelIDs.RegisterLink)),
			               "The Register link is present on the screen");

			loginPage.OpenUsingUrl(_baseUrl);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' button is NOT present on the screen");
			Assert.IsFalse(loginPage.ElementPresent(By.XPath(LoginPage.RegisterFrameButton)),
			               "The Register button is present on the screen");
		}
Ejemplo n.º 4
0
		public void Test004_HostAccessToMemberDirectory()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Host Access To Member Directory'");

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

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

			var module = new MemberDirectoryModule(_driver);
			module.FindElement(By.XPath("//ul[@id = 'mdMemberList']/li[last()]")).Info();

			Trace.WriteLine("ASSERT the number of Users are correct :");
			Assert.That(module.FindElements(By.XPath("//ul[@id = 'mdMemberList']/li")).Count, Is.EqualTo(4), "The number of Users is incorrect");

			Trace.WriteLine("ASSERT the link visibility is correct :");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[1]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are displayed in User #1 Info");
			Assert.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[2]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are not displayed in User #2 Info");
			Assert.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[3]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are not displayed in User #3 Info");
			Assert.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[4]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are not displayed in User #4 Info");
			
		}
Ejemplo n.º 5
0
		public void VerifyLogs(string logContentBeforeTests)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Verify Logs on Host Settings page: '");

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

			string logContentAfterTests = LogContent();
			StringAssert.AreEqualIgnoringCase(logContentAfterTests, logContentBeforeTests, "ERROR in the Log");
		}
Ejemplo n.º 6
0
		public void Test002_VerifyPrivateRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Private' registration option'");

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

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.PrivateRadioButton);

			loginPage.RegisterUser(_userWithPrivateRegistration, "DisplayName", "*****@*****.**", "www3434");

			loginPage.LoginUsingLoginLink(_userWithPrivateRegistration, "www3434");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message is present");
			Assert.IsTrue(loginPage.ElementPresent(By.XPath(LoginPage.NotAuthorizedWarningMessage)),
			              "The Warning message is not present");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message text is correct");
			Assert.That(loginPage.WaitForElement(By.XPath(LoginPage.NotAuthorizedWarningMessage)).Text,
			            Is.EqualTo(LoginPage.NotAuthorizedWarningMessageText),
			            "The Warning message text is not correct");

			loginPage.LoginAsHost(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is NOT authorized");
			Assert.IsFalse(
				manageUsersPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _userWithPrivateRegistration + "']]/td/img[contains(@id, '_imgApproved')]")),
				"The User is authorized");
		}
Ejemplo n.º 7
0
		public void Test004_VerifyVerifiedRegistration()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Verified' registration option'");

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

			var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);
			adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

			adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.VerifiedRadioButton);

			loginPage.RegisterUser(_userWithVerifiedRegistration, "DisplayName", "*****@*****.**", "www3434");

			var manageUserProfilePage = new ManageUserProfilePage(_driver);
			manageUserProfilePage.OpenUsingLink(_baseUrl);
			manageUserProfilePage.OpenTab(By.XPath(ManageUserProfilePage.ManageAccountTab));
			manageUserProfilePage.AccordionOpen(By.XPath(ManageUserProfilePage.AccountSettings));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User can Edit Profile");
			Assert.IsTrue(manageUserProfilePage.FindElement(By.XPath(ManageUserProfilePage.DisplayName)).Enabled,
			              "Display Name textbox is disabled");

			loginPage.LoginAsHost(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is authorized");
			Assert.IsFalse(
				manageUsersPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _userWithVerifiedRegistration + "']]/td/img[contains(@id, '_imgApproved')]")),
				"The User is authorized");
		}
Ejemplo n.º 8
0
		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);
		}
Ejemplo n.º 9
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");
		}
Ejemplo n.º 10
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");
		}
Ejemplo n.º 11
0
		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);
		}