Example #1
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");
		}