@Test(groups="Enterprise-only", dependsOnMethods = "testAssignRole", expectedExceptions = { UnsupportedOperationException.class }) public void testAssignRoleToNullUser() { Assert.assertNotNull(siteMembersPage.assignRole(null, UserRole.COLLABORATOR)); }
public SiteMembersPage assignRole(String userName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Members page: Assign role"); } if (userName == null || userName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } if (!isUserPresent(userName)) { throw new UnsupportedOperationException("Unable to find the user"); } for (WebElement role : getRoles(userName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteMembersPage(drone); } } throw new PageException("Unable to find the rolename."); }
SiteMembersPage extends SharePage { public SiteMembersPage assignRole(String userName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Members page: Assign role"); } if (userName == null || userName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } if (!isUserPresent(userName)) { throw new UnsupportedOperationException("Unable to find the user"); } for (WebElement role : getRoles(userName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteMembersPage(drone); } } throw new PageException("Unable to find the rolename."); } }
SiteMembersPage extends SharePage { public SiteMembersPage assignRole(String userName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Members page: Assign role"); } if (userName == null || userName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } if (!isUserPresent(userName)) { throw new UnsupportedOperationException("Unable to find the user"); } for (WebElement role : getRoles(userName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteMembersPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteMembersPage(WebDrone drone); }
SiteMembersPage extends SharePage { public SiteMembersPage assignRole(String userName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Members page: Assign role"); } if (userName == null || userName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } if (!isUserPresent(userName)) { throw new UnsupportedOperationException("Unable to find the user"); } for (WebElement role : getRoles(userName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteMembersPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SiteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteMembersPage render(); @SuppressWarnings("unchecked") @Override SiteMembersPage render(final long time); SiteMembersPage renderWithUserSearchResults(final long time); SiteMembersPage renderWithUserSearchResults(); SiteMembersPage renderWithUserSearchResults(RenderTime timer); List<String> searchUser(String userName); SiteMembersPage assignRole(String userName, UserRole userRole); SiteMembersPage removeUser(String userName); boolean isUserCanBeRemoved(String userName, String siteName); InviteMembersPage selectInvitePeople(); PendingInvitesPage navigateToPendingInvites(); boolean isInviteLinkPresent(); boolean isPeopleLinkPresent(); boolean isGroupLinkPresent(); boolean isRemoveButtonPresent(String userName); SiteGroupsPage navigateToSiteGroups(); boolean isAssignRolePresent(String userName); boolean isUserHasRole(String userName, UserRole userRole); }
SiteMembersPage extends SharePage { public SiteMembersPage assignRole(String userName, UserRole userRole) { if (logger.isTraceEnabled()) { logger.trace("Members page: Assign role"); } if (userName == null || userName.isEmpty()) { throw new UnsupportedOperationException("usreName is required."); } if (userRole == null) { throw new UnsupportedOperationException("userRole is required."); } if (!isUserPresent(userName)) { throw new UnsupportedOperationException("Unable to find the user"); } for (WebElement role : getRoles(userName)) { String roleText = role.getText().trim(); if (roleText != null && userRole.getRoleName().equalsIgnoreCase(roleText)) { role.click(); return new SiteMembersPage(drone); } } throw new PageException("Unable to find the rolename."); } SiteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SiteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteMembersPage render(); @SuppressWarnings("unchecked") @Override SiteMembersPage render(final long time); SiteMembersPage renderWithUserSearchResults(final long time); SiteMembersPage renderWithUserSearchResults(); SiteMembersPage renderWithUserSearchResults(RenderTime timer); List<String> searchUser(String userName); SiteMembersPage assignRole(String userName, UserRole userRole); SiteMembersPage removeUser(String userName); boolean isUserCanBeRemoved(String userName, String siteName); InviteMembersPage selectInvitePeople(); PendingInvitesPage navigateToPendingInvites(); boolean isInviteLinkPresent(); boolean isPeopleLinkPresent(); boolean isGroupLinkPresent(); boolean isRemoveButtonPresent(String userName); SiteGroupsPage navigateToSiteGroups(); boolean isAssignRolePresent(String userName); boolean isUserHasRole(String userName, UserRole userRole);  }