Пример #1
0
		public void CreateAdminAndLoginAsAdmin(string userName, string displayName, string email, string password)
		{
			ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.AddNewUser(userName, displayName, email, password);
			manageUsersPage.ManageRoles(userName);
			manageUsersPage.AssignRoleToUser("Administrators");

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

			LoginPage loginPage = new LoginPage(_driver);
			loginPage.LoginUsingLoginLink(userName, password);
		}
Пример #2
0
		public void Test004_AssignRoleToUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Assign the Role to User'");

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

			manageUsersPage.ManageRoles(_userName + "001");

			manageUsersPage.AssignRoleToUser(_assignedRoleName + "001");

			var manageRolesPage = new ManageRolesPage(_driver);

			manageRolesPage.OpenUsingControlPanel(_baseUrl);

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