示例#1
0
		public void Test001_AddSecurityRoleGroup()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role Group'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewSecurityRoleGroup(_roleGroupName);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Security role group is present in the list");
			Assert.IsTrue(
				manageRolesPage.ElementPresent(
					By.XPath(ManageRolesPage.FilterByGroupDropdownList + "[text() = '" + _roleGroupName + "']")),
				"The Security role is not added correctly");
		}
示例#2
0
		public void Test001_AddSecurityRoleWithFees()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role with Fees'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewSecurityRoleWithFees(_roleNameWithServiceFee, _serviceFee, _numberInBillingPeriod, _billingPeriod);

			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 Service Fee is present in the list");
			Assert.That(
				manageRolesPage.FindElement(By.XPath("//tr[td[text() = '" + _roleNameWithServiceFee + "']]/td/span[contains(@id, '_Label1')]")).
					Text, Is.EqualTo(_serviceFee),
				"The service fee is not added correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Billing Period is present in the list");
			Assert.That(
				manageRolesPage.FindElement(By.XPath("//tr[td[text() = '" + _roleNameWithServiceFee + "']]/td/span[contains(@id, '_Label2')]")).
					Text, Is.EqualTo(_numberInBillingPeriod),
				"The Billing period is not added correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Billing Frequency is present in the list");
			Assert.That(
				manageRolesPage.FindElement(
					By.XPath("//tr[td[text() = '" + _roleNameWithServiceFee + "']]/td/span[contains(@id, '_lblBillingFrequency')]")).Text,
				Is.EqualTo(_billingPeriod),
				"The Billing frequency is not added correctly");
		}
示例#3
0
		public void Test002_AddPublicSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Public Security Role'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewPublicSecurityRole(_publicRoleName);

			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 Public is enabled");
			Assert.IsTrue(
				manageRolesPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _publicRoleName + "']]/td/img[contains(@id, '_imgApproved')]")),
				"The public role is not enabled");
		}
示例#4
0
		public void Test003_AddPendingSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new pending Security Role'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewSecurityRoleWithStatus(_pendingRoleName, "Pending");

			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 Manage Users link is disabled");
			Assert.IsFalse(
				manageRolesPage.ElementPresent(
					By.XPath("//tr[td[text() = '" + _pendingRoleName + "']]/td/a/img[contains(@src, 'Users_16X16_Standard.png')]")),
				"The Manage Users link is enabled");
		}
示例#5
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");
		}
示例#6
0
		public void Test004_AssignRoleToRoleGroup()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Assign the Role to Role Group'");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);
			manageRolesPage.SlidingSelectByValue(By.XPath("//a[contains(@id, '" + ManageRolesPage.FilterByGroupArrow + "')]"),
			                                     By.XPath(ManageRolesPage.FilterByGroupDropdown), _assignedRoleGroupName);

			int itemNumber = manageRolesPage.FindElements(By.XPath("//table/tbody/tr[contains(@id, 'Roles_grdRoles')]")).Count;

			manageRolesPage.OpenUsingControlPanel(_baseUrl);
			manageRolesPage.AssignSecurityRoleToGroup(_roleName, _assignedRoleGroupName);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);
			manageRolesPage.SlidingSelectByValue(By.XPath("//a[contains(@id, '" + ManageRolesPage.FilterByGroupArrow + "')]"),
			                                     By.XPath(ManageRolesPage.FilterByGroupDropdown), _assignedRoleGroupName);
			manageRolesPage.WaitForElement(By.XPath("//table[contains(@id, 'Roles_grdRoles')]/tbody/tr[last()]"));

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of Security roles assigned to the Group");
			Assert.That(itemNumber + 1,
			            Is.EqualTo(
				            manageRolesPage.FindElements(By.XPath("//table/tbody/tr[contains(@id, 'Roles_grdRoles')]")).Count),
			            "The role is not assigned correctly to Group");

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