@Test(groups="Enterprise-only") public void testSearchUser() throws Exception { List<String> searchUsers = null; for (int searchCount = 1; searchCount <= retrySearchCount; searchCount++) { try { searchUsers = siteMembersPage.searchUser(userName); siteMembersPage.renderWithUserSearchResults(refreshDuration); } catch (PageRenderTimeException exception) { } if (searchUsers != null && searchUsers.size() > 0) { break; } } Assert.assertTrue(searchUsers.size() > 0); }
public List<String> searchUser(String userName) { if (userName == null) { throw new UnsupportedOperationException("UserName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Members page: searchUser :" + userName); } try { WebElement userRoleSearchTextBox = drone.find(SEARCH_USER_ROLE_TEXT); userRoleSearchTextBox.clear(); userRoleSearchTextBox.sendKeys(userName); WebElement searchButton = drone.find(SEARCH_USER_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_USERS, WAIT_TIME_3000); List<String> userNamesList = new ArrayList<String>(); for (WebElement user : list) { WebElement userNameElement = user.findElement(USER_NAME_FROM_LIST); if (userNameElement != null && userNameElement.getText() != null) { userNamesList.add(userNameElement.getText()); } } return userNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the users list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the users list css.", e); } } return Collections.emptyList(); }
SiteMembersPage extends SharePage { public List<String> searchUser(String userName) { if (userName == null) { throw new UnsupportedOperationException("UserName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Members page: searchUser :" + userName); } try { WebElement userRoleSearchTextBox = drone.find(SEARCH_USER_ROLE_TEXT); userRoleSearchTextBox.clear(); userRoleSearchTextBox.sendKeys(userName); WebElement searchButton = drone.find(SEARCH_USER_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_USERS, WAIT_TIME_3000); List<String> userNamesList = new ArrayList<String>(); for (WebElement user : list) { WebElement userNameElement = user.findElement(USER_NAME_FROM_LIST); if (userNameElement != null && userNameElement.getText() != null) { userNamesList.add(userNameElement.getText()); } } return userNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the users list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the users list css.", e); } } return Collections.emptyList(); } }
SiteMembersPage extends SharePage { public List<String> searchUser(String userName) { if (userName == null) { throw new UnsupportedOperationException("UserName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Members page: searchUser :" + userName); } try { WebElement userRoleSearchTextBox = drone.find(SEARCH_USER_ROLE_TEXT); userRoleSearchTextBox.clear(); userRoleSearchTextBox.sendKeys(userName); WebElement searchButton = drone.find(SEARCH_USER_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_USERS, WAIT_TIME_3000); List<String> userNamesList = new ArrayList<String>(); for (WebElement user : list) { WebElement userNameElement = user.findElement(USER_NAME_FROM_LIST); if (userNameElement != null && userNameElement.getText() != null) { userNamesList.add(userNameElement.getText()); } } return userNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the users list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the users list css.", e); } } return Collections.emptyList(); } SiteMembersPage(WebDrone drone); }
SiteMembersPage extends SharePage { public List<String> searchUser(String userName) { if (userName == null) { throw new UnsupportedOperationException("UserName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Members page: searchUser :" + userName); } try { WebElement userRoleSearchTextBox = drone.find(SEARCH_USER_ROLE_TEXT); userRoleSearchTextBox.clear(); userRoleSearchTextBox.sendKeys(userName); WebElement searchButton = drone.find(SEARCH_USER_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_USERS, WAIT_TIME_3000); List<String> userNamesList = new ArrayList<String>(); for (WebElement user : list) { WebElement userNameElement = user.findElement(USER_NAME_FROM_LIST); if (userNameElement != null && userNameElement.getText() != null) { userNamesList.add(userNameElement.getText()); } } return userNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the users list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the users list css.", e); } } return Collections.emptyList(); } 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 List<String> searchUser(String userName) { if (userName == null) { throw new UnsupportedOperationException("UserName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Members page: searchUser :" + userName); } try { WebElement userRoleSearchTextBox = drone.find(SEARCH_USER_ROLE_TEXT); userRoleSearchTextBox.clear(); userRoleSearchTextBox.sendKeys(userName); WebElement searchButton = drone.find(SEARCH_USER_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_USERS, WAIT_TIME_3000); List<String> userNamesList = new ArrayList<String>(); for (WebElement user : list) { WebElement userNameElement = user.findElement(USER_NAME_FROM_LIST); if (userNameElement != null && userNameElement.getText() != null) { userNamesList.add(userNameElement.getText()); } } return userNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the users list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the users list css.", e); } } return Collections.emptyList(); } 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);  }