/// <summary> /// edit role membership by role description /// </summary> /// <returns>EditRoleMembershipPage</returns> public EditRoleMembershipPage EditRoleMembershipRowByRoleDescription() { RolesHomeRow rolesHomeRow = FindRowByRoleDescription(); EditRoleMembershipPage editRoleMembershipPage = rolesHomeRow.SelectEditRoleMembership(); return(editRoleMembershipPage); }
/// <summary> /// edit role membership by role operation /// </summary> /// <returns>EditRoleMembershipPage</returns> public EditRoleMembershipPage EditRoleMembershipRowByOperationTemplates() { RolesHomeRow rolesHomeRow = FindRowByRoleOperationTemplates(); EditRoleMembershipPage editRoleMembershipPage = rolesHomeRow.SelectEditRoleMembership(); return(editRoleMembershipPage); }
/// <summary> /// edit role by role name /// </summary> /// <returns>EditRolePage</returns> public EditRolePage EditRoleRowByRoleName() { RolesHomeRow rolesHomeRow = FindRowByRoleName(); EditRolePage editRolePage = rolesHomeRow.SelectEditRole(); return(editRolePage); }
/// <summary> /// verify role operation does not exist or was removed by role name /// </summary> public void VerifyOperationRemovedByRoleName() { RolesHomeRow rolesHomeRow = FindRowByRoleName(); string operations = rolesHomeRow.GetOperationTemplates(); Assert.IsFalse(operations.Trim().Contains(Data.OperationTemplate), "The expected operation: '" + Data.OperationTemplate + "' is displayed is the actual operations: '" + operations + "'."); }
/// <summary> /// verify role description does not exist or was removed by role name /// </summary> public void VerifyDescriptionRemovedByRoleName() { RolesHomeRow rolesHomeRow = FindRowByRoleName(); string description = rolesHomeRow.GetDescription(); Assert.IsFalse(description.Trim().Contains(Data.Description), "The expected description: '" + Data.Description + "' is displayed in the actual description: '" + description + "'."); }
/// <summary> /// verify role operation exists by role name /// </summary> public void VerifyOperationExistsByRoleName() { RolesHomeRow rolesHomeRow = FindRowByRoleName(); string operations = rolesHomeRow.GetOperationTemplates(); Assert.IsTrue(operations.Trim().Contains(Data.OperationTemplate), "The expected operation: '" + Data.OperationTemplate + "' is missing from the actual operations: '" + operations + "'."); }
/// <summary> /// verify role description exists by role name /// </summary> public void VerifyDescriptionExistsByRoleName() { RolesHomeRow rolesHomeRow = FindRowByRoleName(); string description = rolesHomeRow.GetDescription(); Assert.IsTrue(description.Trim().Contains(Data.Description), "The expected description: '" + Data.Description + "' is missing from the actual description: '" + description + "'."); }
/// <summary> /// Sets the Rows List /// </summary> public override void SetRowLists() { base.SetRowLists(); int rowIndex = 0; foreach (var webElement in WebElementRows) { Report.Write("GridRow by index: " + rowIndex); GridRowType rowType = GetGridRowType(rowIndex); Report.Write("GridRowType: " + rowType); var lineItem = new RolesHomeRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix); RowList.Add(lineItem); rowIndex++; } }
/// <summary> /// gets a list of rows containing the text to find from the row list /// </summary> /// <param name="columnName">the column name</param> /// <param name="textToFind">the text to find</param> /// <returns>list of RolesHomeRow</returns> public new List <RolesHomeRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind) { if (RowList.Count == 0) { Assert.Fail("No items were found in the grid column list."); return(null); } else { List <RolesHomeRow> rowList = new List <RolesHomeRow>(); string text = null; int index = 0; foreach (var row in RowList) { RolesHomeRow configRow = (RolesHomeRow)row; if (configRow.Type != GridRowType.Header && configRow.Type != GridRowType.Pagination) { //get the text by column name if (columnName.Equals(RolesHomeColumnnNames.RoleName)) { text = configRow.GetRoleName(); } if (columnName.Equals(RolesHomeColumnnNames.Description)) { text = configRow.GetDescription(); } if (columnName.Equals(RolesHomeColumnnNames.OperationTemplates)) { text = configRow.GetOperationTemplates(); } //if the text is not null if (text != null) { //if the text contains the text to find if (text.Contains(textToFind)) { rowList.Add(configRow); } } } } //may return empty row list if text is not found return(rowList); } }