Exemple #1
0
		public void Test001_AddSecurityRoleWithFees()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role with Fees'");

			ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewSecurityRoleWithFees(_roleName, _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() = '" + _roleName + "']]/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() = '" + _roleName + "']]/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() = '" + _roleName + "']]/td/span[contains(@id, '_lblBillingFrequency')]")).Text, Is.EqualTo(_billingPeriod),
						"The Billing frequency is not added correctly");
		}
			public void LoginToSite()
			{
				var doc = XDocument.Load(@"P1\" + Settings.Default.P1DataFile);

				XElement settings = doc.Document.Element("Tests").Element("settings");
				XElement groupSettings = doc.Document.Element("Tests").Element("securityRoleGroup");

				string testName = groupSettings.Attribute("name").Value;
				_roleGroupName = groupSettings.Attribute("roleGroupName").Value;
				_roleGroupDescription = groupSettings.Attribute("roleGroupDescription").Value;
				_roleName = groupSettings.Attribute("roleName").Value;
				_assignedRoleGroupName = groupSettings.Attribute("assignedRoleGroupName").Value;

				_driver = StartBrowser(settings.Attribute("browser").Value);
				_baseUrl = settings.Attribute("baseURL").Value;

				Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
				Trace.WriteLine(BasePage.PreconditionsKeyWord);

				MainPage mainPage = new MainPage(_driver);
				mainPage.OpenUsingUrl(_baseUrl);

				_loginPage = new LoginPage(_driver);
				_loginPage.OpenUsingUrl(_baseUrl);
				_loginPage.DoLoginUsingUrl("host", "dnnhost");

				ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);
				manageRolesPage.OpenUsingControlPanel(_baseUrl);
				manageRolesPage.AddNewSecurityRole(_roleName);

				manageRolesPage.OpenUsingControlPanel(_baseUrl);
				manageRolesPage.AddNewSecurityRoleGroup(_assignedRoleGroupName); 
			}
		public void LoginToSite()
		{
			var doc = XDocument.Load(@"BVT\" + Settings.Default.BVTDataFile);

			XElement settings = doc.Document.Element("Tests").Element("settings");

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Security Roles BVT'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			_loginPage = new LoginPage(_driver);
			_loginPage.OpenUsingUrl(_baseUrl);
			_loginPage.DoLoginUsingUrl("host", "dnnhost");

			ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);
			manageRolesPage.OpenUsingControlPanel(_baseUrl);
			manageRolesPage.AddNewSecurityRole(_assignedRoleName);

			ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.AddNewUser(_userName, _userDisplayName, _userEmail, _userPassword);
		}
		public void Test001_AddSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role'");

			ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			manageRolesPage.AddNewSecurityRole(_roleName);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Security role is present in the list");
			Assert.IsTrue(manageRolesPage.ElementPresent(By.XPath("//tr[td[text() = '" + _roleName + "']]")),
				"The Security role is not added correctly");
		}
Exemple #5
0
		public void Test002_AddPublicSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Public Security Role'");

			ManageRolesPage 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");
		}
Exemple #6
0
		public void Test003_AddPendingSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new pending Security Role'");

			ManageRolesPage 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");

		}
		public void Test004_AssignRoleToUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Assign the Role to User'");

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

			manageUsersPage.ManageRoles(_userName);

			manageUsersPage.AssignRoleToUser(_assignedRoleName);

			ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of Users assigned to the Role");
			Assert.That("1", Is.EqualTo(manageRolesPage.FindElement(By.XPath("//tr[td[text() = '" + _assignedRoleName + "']]/td[13]")).Text),
						"The role is not assigned correctly to User");
		}
		public void Test002_EditSecurityRole()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Security Role'");

			ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

			manageRolesPage.AddDescriptionToSecurityRole(_roleName, _roleDescription);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Security description is present in the list");
			Assert.That(_roleDescription, Is.EqualTo(manageRolesPage.FindElement(By.XPath("//tr[td[text() = '" + _roleName + "']]/td[4]")).Text),
						"The role description is not added correctly");
		}
			public void Test003_DeleteSecurityRoleGroup()
			{
				Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Security Role Group'");

				ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

				manageRolesPage.OpenUsingControlPanel(_baseUrl);

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

				manageRolesPage.DeleteSecurityRoleGroup(_roleGroupName);

				Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the drop-down decreased by 1");
				Assert.That(itemNumber - 1, Is.EqualTo(manageRolesPage.FindElements(By.XPath(ManageRolesPage.FilterByGroupDropdownList)).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(ManageRolesPage.FilterByGroupDropdownList + "[text() = '" + _roleGroupName + "']")),
							"The Security role is not deleted correctly");
			}
			public void Test004_AssignRoleToRoleGroup()
			{
				Trace.WriteLine(BasePage.RunningTestKeyWord + "'Assign the Role to Role Group'");

				ManageRolesPage 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");
			}
			public void Test002_EditSecurityRoleGroup()
			{
				Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Security Role Group'");

				ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

				manageRolesPage.OpenUsingControlPanel(_baseUrl);

				manageRolesPage.AddDescriptionToSecurityRoleGroup(_roleGroupName, _roleGroupDescription);

				manageRolesPage.OpenUsingControlPanel(_baseUrl);
				manageRolesPage.EditSecurityRoleGroup(_roleGroupName);

				Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Security role Group description is present in the box");
				Assert.That(_roleGroupDescription, Is.EqualTo(manageRolesPage.FindElement(By.XPath(ManageRolesPage.RoleGroupNameDescriptionTextBox)).Text),
							"The role description is not added correctly");
			}