@Test(dependsOnMethods="search") public void getSearchItems() { searchDashlet.search(fileName).render(); List<SiteSearchItem> items = searchDashlet.getSearchItems(); Assert.assertNotNull(items); Assert.assertEquals(items.size(), 1); Assert.assertEquals(items.get(0).getItemName().getDescription(), fileName); Assert.assertEquals(items.get(0).getPath().getDescription(), "/"); Assert.assertNotNull(items.get(0).getThumbnail()); }
public List<SiteSearchItem> getSearchItems() { try { List<WebElement> resultItems = drone.findAndWaitForElements(By.cssSelector("div[id$='default-search-results'] .yui-dt-data>tr")); List<SiteSearchItem> searchItems = Collections.emptyList(); if (resultItems != null && resultItems.size() > 0) { searchItems = new ArrayList<SiteSearchItem>(resultItems.size()); for (WebElement webElement : resultItems) { searchItems.add(new SiteSearchItem(webElement, drone)); } } return searchItems; } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } return Collections.emptyList(); }
SiteSearchDashlet extends AbstractDashlet implements Dashlet { public List<SiteSearchItem> getSearchItems() { try { List<WebElement> resultItems = drone.findAndWaitForElements(By.cssSelector("div[id$='default-search-results'] .yui-dt-data>tr")); List<SiteSearchItem> searchItems = Collections.emptyList(); if (resultItems != null && resultItems.size() > 0) { searchItems = new ArrayList<SiteSearchItem>(resultItems.size()); for (WebElement webElement : resultItems) { searchItems.add(new SiteSearchItem(webElement, drone)); } } return searchItems; } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } return Collections.emptyList(); } }
SiteSearchDashlet extends AbstractDashlet implements Dashlet { public List<SiteSearchItem> getSearchItems() { try { List<WebElement> resultItems = drone.findAndWaitForElements(By.cssSelector("div[id$='default-search-results'] .yui-dt-data>tr")); List<SiteSearchItem> searchItems = Collections.emptyList(); if (resultItems != null && resultItems.size() > 0) { searchItems = new ArrayList<SiteSearchItem>(resultItems.size()); for (WebElement webElement : resultItems) { searchItems.add(new SiteSearchItem(webElement, drone)); } } return searchItems; } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } return Collections.emptyList(); } protected  SiteSearchDashlet(WebDrone drone); }
SiteSearchDashlet extends AbstractDashlet implements Dashlet { public List<SiteSearchItem> getSearchItems() { try { List<WebElement> resultItems = drone.findAndWaitForElements(By.cssSelector("div[id$='default-search-results'] .yui-dt-data>tr")); List<SiteSearchItem> searchItems = Collections.emptyList(); if (resultItems != null && resultItems.size() > 0) { searchItems = new ArrayList<SiteSearchItem>(resultItems.size()); for (WebElement webElement : resultItems) { searchItems.add(new SiteSearchItem(webElement, drone)); } } return searchItems; } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } return Collections.emptyList(); } protected  SiteSearchDashlet(WebDrone drone); @SuppressWarnings("unchecked") @Override synchronized SiteSearchDashlet render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteSearchDashlet render(long time); @SuppressWarnings("unchecked") @Override SiteSearchDashlet render(); boolean isHelpIconDisplayed(); void clickOnHelpIcon(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); SiteSearchDashlet closeHelpBallon(); String getTitle(); String getContent(); List<SiteSearchItem> getSearchItems(); SiteSearchDashlet search(String text); boolean siteSearchWithRetry(String fileName); List<String> getAvailableResultSizes(); String getSearchText(); void setResultSize(SearchLimit searchLimit); SiteSearchDashlet search(String searchString, SearchLimit searchLimit); SearchLimit getSelectedSearchLimit(); }
SiteSearchDashlet extends AbstractDashlet implements Dashlet { public List<SiteSearchItem> getSearchItems() { try { List<WebElement> resultItems = drone.findAndWaitForElements(By.cssSelector("div[id$='default-search-results'] .yui-dt-data>tr")); List<SiteSearchItem> searchItems = Collections.emptyList(); if (resultItems != null && resultItems.size() > 0) { searchItems = new ArrayList<SiteSearchItem>(resultItems.size()); for (WebElement webElement : resultItems) { searchItems.add(new SiteSearchItem(webElement, drone)); } } return searchItems; } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Not able to find the element: ", e); } } return Collections.emptyList(); } protected  SiteSearchDashlet(WebDrone drone); @SuppressWarnings("unchecked") @Override synchronized SiteSearchDashlet render(RenderTime timer); @SuppressWarnings("unchecked") @Override SiteSearchDashlet render(long time); @SuppressWarnings("unchecked") @Override SiteSearchDashlet render(); boolean isHelpIconDisplayed(); void clickOnHelpIcon(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); SiteSearchDashlet closeHelpBallon(); String getTitle(); String getContent(); List<SiteSearchItem> getSearchItems(); SiteSearchDashlet search(String text); boolean siteSearchWithRetry(String fileName); List<String> getAvailableResultSizes(); String getSearchText(); void setResultSize(SearchLimit searchLimit); SiteSearchDashlet search(String searchString, SearchLimit searchLimit); SearchLimit getSelectedSearchLimit(); static Integer retrySearchCount; }