@Test(dependsOnMethods = "testNavigateToAddGroupsPage") public void testSearchGroup() throws Exception { List<String> searchGroups = null; for (int searchCount = 1; searchCount <= retrySearchCount; searchCount++) { try { searchGroups = siteGroupsPage.searchGroup(groupName); siteGroupsPage.renderWithGroupSearchResults(refreshDuration); } catch (PageRenderTimeException exception) { } if (searchGroups != null && searchGroups.size() > 0) { break; } } Assert.assertTrue(searchGroups.size() > 0); }
public List<String> searchGroup(String groupName) { if (getAlfrescoVersion().isCloud()) throw new UnsupportedOperationException("The version is cloud"); if (groupName == null) { throw new UnsupportedOperationException("GroupName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Groups page: searchGroup :" + groupName); } try { WebElement groupRoleSearchTextBox = drone.findAndWait(SEARCH_GROUP_ROLE_TEXT); groupRoleSearchTextBox.clear(); groupRoleSearchTextBox.sendKeys(groupName); WebElement searchButton = drone.findAndWait(SEARCH_GROUP_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_GROUPS, WAIT_TIME_3000); List<String> groupNamesList = new ArrayList<String>(); for (WebElement group : list) { WebElement groupNameElement = group.findElement(GROUP_NAME_FROM_LIST); if (groupNameElement != null && groupNameElement.getText() != null) { groupNamesList.add(groupNameElement.getText()); } } return groupNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the group list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the group list css.", e); } } return Collections.emptyList(); }
SiteGroupsPage extends SharePage { public List<String> searchGroup(String groupName) { if (getAlfrescoVersion().isCloud()) throw new UnsupportedOperationException("The version is cloud"); if (groupName == null) { throw new UnsupportedOperationException("GroupName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Groups page: searchGroup :" + groupName); } try { WebElement groupRoleSearchTextBox = drone.findAndWait(SEARCH_GROUP_ROLE_TEXT); groupRoleSearchTextBox.clear(); groupRoleSearchTextBox.sendKeys(groupName); WebElement searchButton = drone.findAndWait(SEARCH_GROUP_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_GROUPS, WAIT_TIME_3000); List<String> groupNamesList = new ArrayList<String>(); for (WebElement group : list) { WebElement groupNameElement = group.findElement(GROUP_NAME_FROM_LIST); if (groupNameElement != null && groupNameElement.getText() != null) { groupNamesList.add(groupNameElement.getText()); } } return groupNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the group list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the group list css.", e); } } return Collections.emptyList(); } }
SiteGroupsPage extends SharePage { public List<String> searchGroup(String groupName) { if (getAlfrescoVersion().isCloud()) throw new UnsupportedOperationException("The version is cloud"); if (groupName == null) { throw new UnsupportedOperationException("GroupName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Groups page: searchGroup :" + groupName); } try { WebElement groupRoleSearchTextBox = drone.findAndWait(SEARCH_GROUP_ROLE_TEXT); groupRoleSearchTextBox.clear(); groupRoleSearchTextBox.sendKeys(groupName); WebElement searchButton = drone.findAndWait(SEARCH_GROUP_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_GROUPS, WAIT_TIME_3000); List<String> groupNamesList = new ArrayList<String>(); for (WebElement group : list) { WebElement groupNameElement = group.findElement(GROUP_NAME_FROM_LIST); if (groupNameElement != null && groupNameElement.getText() != null) { groupNamesList.add(groupNameElement.getText()); } } return groupNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the group list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the group list css.", e); } } return Collections.emptyList(); } SiteGroupsPage(WebDrone drone); }
SiteGroupsPage extends SharePage { public List<String> searchGroup(String groupName) { if (getAlfrescoVersion().isCloud()) throw new UnsupportedOperationException("The version is cloud"); if (groupName == null) { throw new UnsupportedOperationException("GroupName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Groups page: searchGroup :" + groupName); } try { WebElement groupRoleSearchTextBox = drone.findAndWait(SEARCH_GROUP_ROLE_TEXT); groupRoleSearchTextBox.clear(); groupRoleSearchTextBox.sendKeys(groupName); WebElement searchButton = drone.findAndWait(SEARCH_GROUP_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_GROUPS, WAIT_TIME_3000); List<String> groupNamesList = new ArrayList<String>(); for (WebElement group : list) { WebElement groupNameElement = group.findElement(GROUP_NAME_FROM_LIST); if (groupNameElement != null && groupNameElement.getText() != null) { groupNamesList.add(groupNameElement.getText()); } } return groupNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the group list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the group list css.", e); } } return Collections.emptyList(); } 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 List<String> searchGroup(String groupName) { if (getAlfrescoVersion().isCloud()) throw new UnsupportedOperationException("The version is cloud"); if (groupName == null) { throw new UnsupportedOperationException("GroupName value is required"); } if (logger.isTraceEnabled()) { logger.trace("Groups page: searchGroup :" + groupName); } try { WebElement groupRoleSearchTextBox = drone.findAndWait(SEARCH_GROUP_ROLE_TEXT); groupRoleSearchTextBox.clear(); groupRoleSearchTextBox.sendKeys(groupName); WebElement searchButton = drone.findAndWait(SEARCH_GROUP_ROLE_BUTTON); searchButton.click(); List<WebElement> list = drone.findAndWaitForElements(LIST_OF_GROUPS, WAIT_TIME_3000); List<String> groupNamesList = new ArrayList<String>(); for (WebElement group : list) { WebElement groupNameElement = group.findElement(GROUP_NAME_FROM_LIST); if (groupNameElement != null && groupNameElement.getText() != null) { groupNamesList.add(groupNameElement.getText()); } } return groupNamesList; } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Unable to find the group list css.", e); } } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Time exceeded to find the group list css.", e); } } return Collections.emptyList(); } 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; }