Пример #1
0
			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); 
			}
Пример #2
0
			public void Test001_AddSecurityRoleGroup()
			{
				Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role Group'");

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