Пример #1
0
		public void Test004_AddAutoAssignedSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new auto assigned Security Role'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

			int itemNumber = manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count;

			manageRolesPage.AddNewAutoAssignedSecurityRole(_autoAssignedRoleName);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Auto checkbox is enabled");
			Assert.IsTrue(
				manageRolesPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _autoAssignedRoleName + "']]/td/img[contains(@id, '_Image1')]")),
				"The Auto checkbox link is disabled");
		}