@Test(dependsOnMethods = "testAddingNullUser", groups = "Enterprise-only") public void testAddUser() { Assert.assertNotNull(membersPage.clickAddUser(user)); }
public InviteMembersPage clickAddUser(String user) { if (user == null || user.isEmpty()) { throw new UnsupportedOperationException("user input required"); } List<WebElement> invitees = getListOfInvitees(); if (invitees != null) { for (WebElement element : getListOfInvitees()) { WebElement ele = null; try { ele = element.findElement(SEACH_INVITEE_FROM_LIST); String value = ele.getText(); if (value != null && !value.isEmpty()) { if (value.contains(user)) { element.findElement(By.cssSelector(BUTTON)).click(); break; } } } catch (NoSuchElementException e) { logger.error("Unable to find the username for the userElement."); throw new PageException("Unable to find the username for the userElement.", e); } } } return new InviteMembersPage(drone); }
InviteMembersPage extends SharePage { public InviteMembersPage clickAddUser(String user) { if (user == null || user.isEmpty()) { throw new UnsupportedOperationException("user input required"); } List<WebElement> invitees = getListOfInvitees(); if (invitees != null) { for (WebElement element : getListOfInvitees()) { WebElement ele = null; try { ele = element.findElement(SEACH_INVITEE_FROM_LIST); String value = ele.getText(); if (value != null && !value.isEmpty()) { if (value.contains(user)) { element.findElement(By.cssSelector(BUTTON)).click(); break; } } } catch (NoSuchElementException e) { logger.error("Unable to find the username for the userElement."); throw new PageException("Unable to find the username for the userElement.", e); } } } return new InviteMembersPage(drone); } }
InviteMembersPage extends SharePage { public InviteMembersPage clickAddUser(String user) { if (user == null || user.isEmpty()) { throw new UnsupportedOperationException("user input required"); } List<WebElement> invitees = getListOfInvitees(); if (invitees != null) { for (WebElement element : getListOfInvitees()) { WebElement ele = null; try { ele = element.findElement(SEACH_INVITEE_FROM_LIST); String value = ele.getText(); if (value != null && !value.isEmpty()) { if (value.contains(user)) { element.findElement(By.cssSelector(BUTTON)).click(); break; } } } catch (NoSuchElementException e) { logger.error("Unable to find the username for the userElement."); throw new PageException("Unable to find the username for the userElement.", e); } } } return new InviteMembersPage(drone); } InviteMembersPage(WebDrone drone); }
InviteMembersPage extends SharePage { public InviteMembersPage clickAddUser(String user) { if (user == null || user.isEmpty()) { throw new UnsupportedOperationException("user input required"); } List<WebElement> invitees = getListOfInvitees(); if (invitees != null) { for (WebElement element : getListOfInvitees()) { WebElement ele = null; try { ele = element.findElement(SEACH_INVITEE_FROM_LIST); String value = ele.getText(); if (value != null && !value.isEmpty()) { if (value.contains(user)) { element.findElement(By.cssSelector(BUTTON)).click(); break; } } } catch (NoSuchElementException e) { logger.error("Unable to find the username for the userElement."); throw new PageException("Unable to find the username for the userElement.", 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 clickAddUser(String user) { if (user == null || user.isEmpty()) { throw new UnsupportedOperationException("user input required"); } List<WebElement> invitees = getListOfInvitees(); if (invitees != null) { for (WebElement element : getListOfInvitees()) { WebElement ele = null; try { ele = element.findElement(SEACH_INVITEE_FROM_LIST); String value = ele.getText(); if (value != null && !value.isEmpty()) { if (value.contains(user)) { element.findElement(By.cssSelector(BUTTON)).click(); break; } } } catch (NoSuchElementException e) { logger.error("Unable to find the username for the userElement."); throw new PageException("Unable to find the username for the userElement.", 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);  }