@Test(dependsOnMethods = "testSearchGroup") public void testAssignRole() { siteGroupsPage.assignRole(groupName, UserRole.MANAGER); }
public SiteGroupsPage assignRole(String groupName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Groups page: Assign role"); } if (groupName == null || groupName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } for (WebElement role : getRoles(groupName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteGroupsPage(drone); } } throw new PageException("Unable to find the rolename."); }
SiteGroupsPage extends SharePage { public SiteGroupsPage assignRole(String groupName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Groups page: Assign role"); } if (groupName == null || groupName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } for (WebElement role : getRoles(groupName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteGroupsPage(drone); } } throw new PageException("Unable to find the rolename."); } }
SiteGroupsPage extends SharePage { public SiteGroupsPage assignRole(String groupName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Groups page: Assign role"); } if (groupName == null || groupName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } for (WebElement role : getRoles(groupName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteGroupsPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteGroupsPage(WebDrone drone); }
SiteGroupsPage extends SharePage { public SiteGroupsPage assignRole(String groupName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Groups page: Assign role"); } if (groupName == null || groupName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } for (WebElement role : getRoles(groupName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteGroupsPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteGroupsPage(WebDrone drone); @Override @SuppressWarnings("unchecked") SiteGroupsPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteGroupsPage render(long time); @SuppressWarnings("unchecked") @Override SiteGroupsPage render(); SiteGroupsPage renderWithGroupSearchResults(final long time); SiteGroupsPage renderWithGroupSearchResults(); SiteGroupsPage renderWithGroupSearchResults(RenderTime timer); AddGroupsPage navigateToAddGroupsPage(); boolean isSiteGroupsPage(); boolean isAddGroupDisplayed(); List<String> searchGroup(String groupName); SiteGroupsPage assignRole(String groupName, UserRole userRole); boolean isAssignRolePresent(String groupName); boolean isRemoveButtonPresent(String groupName); SiteGroupsPage removeGroup(String groupName); }
SiteGroupsPage extends SharePage { public SiteGroupsPage assignRole(String groupName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Groups page: Assign role"); } if (groupName == null || groupName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } for (WebElement role : getRoles(groupName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteGroupsPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteGroupsPage(WebDrone drone); @Override @SuppressWarnings("unchecked") SiteGroupsPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteGroupsPage render(long time); @SuppressWarnings("unchecked") @Override SiteGroupsPage render(); SiteGroupsPage renderWithGroupSearchResults(final long time); SiteGroupsPage renderWithGroupSearchResults(); SiteGroupsPage renderWithGroupSearchResults(RenderTime timer); AddGroupsPage navigateToAddGroupsPage(); boolean isSiteGroupsPage(); boolean isAddGroupDisplayed(); List<String> searchGroup(String groupName); SiteGroupsPage assignRole(String groupName, UserRole userRole); boolean isAssignRolePresent(String groupName); boolean isRemoveButtonPresent(String groupName); SiteGroupsPage removeGroup(String groupName); static final String ADD_GROUPS; }