/// <summary> /// Gives the user edit permissions for the page. /// </summary> /// <param name="userName">The users username.</param> /// <param name="displayName">The users display name.</param> public void GiveUserEditPermissionsForPage(string userName, string displayName) { UserPermissionField.Value = userName; AddUserPermissionLink.Click(); System.Threading.Thread.Sleep(2000); Image result = null; foreach (TableRow row in UserPermissionsTable.TableRows) { if (row.TableCells[0].InnerHtml.Contains(displayName)) { if (row.TableCells.Count == 11) { result = row.TableCells[10].Image(Find.Any); break; } else { result = row.TableCells[2].Image(Find.Any); break; } } continue; } result.Click(); }
/// <summary> /// Creates a page using a specific template and gies a user view permissions for the page. /// Will not work unless the test is already on the Add Page form. /// </summary> /// <param name="pageName">The name of the page.</param> /// <param name="userName">The username of the user.</param> /// <param name="templateName">The name of the template.</param> public void AddPageGiveUserViewPermissionSelectTemplate(string pageName, string userName, string templateName) { PageNameField.Value = pageName; PageTemplateSelect.Select(templateName); System.Threading.Thread.Sleep(1000); PermissionsTabLink.Click(); UserPermissionField.Value = userName; AddUserPermissionLink.Click(); System.Threading.Thread.Sleep(1000); AddPageLink.Click(); System.Threading.Thread.Sleep(3000); }