Exemplo n.º 1
0
		public void Test001_AddUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new User'");

			var manageUsersPage = new ManageUsersPage(_driver);

			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.WaitForElement(By.XPath(ManageUsersPage.UsersTable));
			int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

			manageUsersPage.AddNewUser(_userName, _userDisplayName, "*****@*****.**", "wordPass30");

			manageUsersPage.WaitForElement(By.XPath(ManageUsersPage.UsersTable));
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1");
			Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber + 1),
			            "The User is not added correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present in the list");
			Assert.IsTrue(manageUsersPage.ElementPresent(By.XPath("//tr/td[text() = '" + _userName + "']")),
			              "The User is not added correctly");
		}
Exemplo n.º 2
0
		public void Test003_RemoveDeletedUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Remove the User'");

			var manageUsersPage = new ManageUsersPage(_driver);

			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.WaitForElement(By.XPath(ManageUsersPage.UsersTable));
			int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

			manageUsersPage.RemoveDeletedUser(_userName);

			manageUsersPage.WaitForElement(By.XPath(ManageUsersPage.UsersTable));
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1");
			Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber - 1),
			            "The User is not removed correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is not present in the list");
			Assert.IsFalse(manageUsersPage.ElementPresent(By.XPath("//tr[td[text() = '" + _userName + "']]")),
			               "The User is not removed correctly");
		}
Exemplo n.º 3
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");
		}
Exemplo n.º 4
0
		public void Test006_DeleteUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the User'");

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

			int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

			manageUsersPage.DeleteUser(_userName);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list is not changed");
			Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber),
						"The User is not deleted correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present in the list");
			Assert.IsTrue(manageUsersPage.ElementPresent(By.XPath("//tr/td[text() = '" + _userName + "']")),
						"The User is not deleted correctly");
		}
Exemplo n.º 5
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");
		}