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 LoginToSite() { XDocument doc = XDocument.Load(DataFileLocation); XElement settings = doc.Document.Element("Tests").Element("settings"); XElement testSettings = doc.Document.Element("Tests").Element("securityRoleGroup"); string testName = testSettings.Attribute("name").Value; _roleGroupName = testSettings.Attribute("roleGroupName").Value; _roleGroupDescription = testSettings.Attribute("roleGroupDescription").Value; _roleName = testSettings.Attribute("roleName").Value; _assignedRoleGroupName = testSettings.Attribute("assignedRoleGroupName").Value; _driver = StartBrowser(settings.Attribute("browser").Value); _baseUrl = settings.Attribute("baseURL").Value; Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'"); Trace.WriteLine(BasePage.PreconditionsKeyWord); OpenMainPageAndLoginAsHost(); var manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddNewSecurityRole(_roleName); manageRolesPage.OpenUsingControlPanel(_baseUrl); manageRolesPage.AddNewSecurityRoleGroup(_assignedRoleGroupName); }
public void Test001_AddSecurityRoleWithFees() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Security Role with Fees'"); var manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); int itemNumber = manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count; manageRolesPage.AddNewSecurityRoleWithFees(_roleNameWithServiceFee, _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() = '" + _roleNameWithServiceFee + "']]/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() = '" + _roleNameWithServiceFee + "']]/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() = '" + _roleNameWithServiceFee + "']]/td/span[contains(@id, '_lblBillingFrequency')]")).Text, Is.EqualTo(_billingPeriod), "The Billing frequency 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 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 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 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"); }
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"); }