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