Ejemplo n.º 1
0
		public void Test003_DeleteSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Security Role'");

			var manageRolesPage = new ManageRolesPage(_driver);
			manageRolesPage.OpenUsingControlPanel(_baseUrl);
			manageRolesPage.WaitForElement(By.XPath(ManageRolesPage.SecurityRolesTable));
			int itemNumber = manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count;

			manageRolesPage.DeleteSecurityRole(_roleName);

			manageRolesPage.WaitForElement(By.XPath(ManageRolesPage.SecurityRolesTable));
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1");
			Assert.That(itemNumber - 1,
			            Is.EqualTo(manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count),
			            "The security role is not deleted correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Security role is not present in the list");
			Assert.IsFalse(manageRolesPage.ElementPresent(By.XPath("//tr[td[text() = '" + _roleName + "']]")),
			               "The Security role is not deleted correctly");
		}