public void Test001_AddSecurityRole() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new 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.AddNewSecurityRole(_roleName); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.WaitForElement(By.XPath(ManageRolesPage.SecurityRolesTable)); 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"); }
public void Test002_EditSecurityRole() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Security Role'"); var manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddDescriptionToSecurityRole(_roleName, _roleDescription); manageRolesPage.WaitForElement(By.XPath(ManageRolesPage.SecurityRolesTable)); 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 Test002_EditSecurityRoleGroup() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Security Role Group'"); var 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.WaitForElement(By.XPath(ManageRolesPage.RoleGroupNameDescriptionTextBox)).Text), "The role description is not added 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"); }