@Test(dependsOnMethods = "testSelectInviteeAndAssignRoleToNull", groups = "Enterprise-only", expectedExceptions = UnsupportedOperationException.class) public void testSelectNullInviteeAndAssignRole() { Assert.assertNotNull(membersPage.selectInviteeAndAssignRole(null, UserRole.COLLABORATOR)); }
public InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role) { List<WebElement> inviteesList = getInvitees(); if (user == null || inviteesList == null || inviteesList.isEmpty() || role == null) { throw new UnsupportedOperationException("user input required or inviteesList should not be blank."); } for (WebElement link : inviteesList) { try { WebElement invitee = link.findElement(By.cssSelector(INVITEE)); String text = invitee.getText(); if (text != null && user.equalsIgnoreCase(text)) { selectRolesDropdown(); getRoles(); assignRole(role); break; } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the invitee css.", e); } } } return new InviteMembersPage(drone); }
InviteMembersPage extends SharePage { public InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role) { List<WebElement> inviteesList = getInvitees(); if (user == null || inviteesList == null || inviteesList.isEmpty() || role == null) { throw new UnsupportedOperationException("user input required or inviteesList should not be blank."); } for (WebElement link : inviteesList) { try { WebElement invitee = link.findElement(By.cssSelector(INVITEE)); String text = invitee.getText(); if (text != null && user.equalsIgnoreCase(text)) { selectRolesDropdown(); getRoles(); assignRole(role); break; } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the invitee css.", e); } } } return new InviteMembersPage(drone); } }
InviteMembersPage extends SharePage { public InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role) { List<WebElement> inviteesList = getInvitees(); if (user == null || inviteesList == null || inviteesList.isEmpty() || role == null) { throw new UnsupportedOperationException("user input required or inviteesList should not be blank."); } for (WebElement link : inviteesList) { try { WebElement invitee = link.findElement(By.cssSelector(INVITEE)); String text = invitee.getText(); if (text != null && user.equalsIgnoreCase(text)) { selectRolesDropdown(); getRoles(); assignRole(role); break; } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the invitee css.", e); } } } return new InviteMembersPage(drone); } InviteMembersPage(WebDrone drone); }
InviteMembersPage extends SharePage { public InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role) { List<WebElement> inviteesList = getInvitees(); if (user == null || inviteesList == null || inviteesList.isEmpty() || role == null) { throw new UnsupportedOperationException("user input required or inviteesList should not be blank."); } for (WebElement link : inviteesList) { try { WebElement invitee = link.findElement(By.cssSelector(INVITEE)); String text = invitee.getText(); if (text != null && user.equalsIgnoreCase(text)) { selectRolesDropdown(); getRoles(); assignRole(role); break; } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the invitee css.", e); } } } return new InviteMembersPage(drone); } InviteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override InviteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override InviteMembersPage render(); @SuppressWarnings("unchecked") @Override InviteMembersPage render(final long time); InviteMembersPage renderWithUserSearchResults(final long time); InviteMembersPage renderWithUserSearchResults(); InviteMembersPage renderWithUserSearchResults(RenderTime timer); boolean titlePresent(); List<String> searchUser(String userName); InviteMembersPage clickAddUser(String user); InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role); InviteMembersPage clickInviteButton(); InviteMembersPage selectRole(String user, UserRole role); SiteGroupsPage navigateToSiteGroupsPage(); void removeUserFromInvite(String userName); void selectRoleForAll(UserRole role); boolean isAddButtonEnabledFor(String userName); boolean isInviteButtonEnabled(); boolean isSelectRoleEnabledFor(String userName); boolean isRemoveIconEnabledFor(String userName); SiteMembersPage navigateToMembersSitePage(); PendingInvitesPage navigateToPendingInvitesPage(); void invExternalUser(String firstName, String lastName, String email, UserRole userRole); }
InviteMembersPage extends SharePage { public InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role) { List<WebElement> inviteesList = getInvitees(); if (user == null || inviteesList == null || inviteesList.isEmpty() || role == null) { throw new UnsupportedOperationException("user input required or inviteesList should not be blank."); } for (WebElement link : inviteesList) { try { WebElement invitee = link.findElement(By.cssSelector(INVITEE)); String text = invitee.getText(); if (text != null && user.equalsIgnoreCase(text)) { selectRolesDropdown(); getRoles(); assignRole(role); break; } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the invitee css.", e); } } } return new InviteMembersPage(drone); } InviteMembersPage(WebDrone drone); @SuppressWarnings("unchecked") @Override InviteMembersPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override InviteMembersPage render(); @SuppressWarnings("unchecked") @Override InviteMembersPage render(final long time); InviteMembersPage renderWithUserSearchResults(final long time); InviteMembersPage renderWithUserSearchResults(); InviteMembersPage renderWithUserSearchResults(RenderTime timer); boolean titlePresent(); List<String> searchUser(String userName); InviteMembersPage clickAddUser(String user); InviteMembersPage selectInviteeAndAssignRole(String user, UserRole role); InviteMembersPage clickInviteButton(); InviteMembersPage selectRole(String user, UserRole role); SiteGroupsPage navigateToSiteGroupsPage(); void removeUserFromInvite(String userName); void selectRoleForAll(UserRole role); boolean isAddButtonEnabledFor(String userName); boolean isInviteButtonEnabled(); boolean isSelectRoleEnabledFor(String userName); boolean isRemoveIconEnabledFor(String userName); SiteMembersPage navigateToMembersSitePage(); PendingInvitesPage navigateToPendingInvitesPage(); void invExternalUser(String firstName, String lastName, String email, UserRole userRole);  }