@Test(dependsOnMethods="selectAllFilters") public void getSimpleViewInformation() throws Exception { navigateToSiteDashboard(); SiteContentDashlet dashlet = siteDashBoard.getDashlet(SITE_CONTENT).render(); dashlet.clickSimpleView(); int count = 0; boolean rendered = false; while (count < 10) { dashlet.selectFilter(SiteContentFilter.I_HAVE_RECENTLY_MODIFIED); try { count++; dashlet = dashlet.renderSimpleViewWithContent(); rendered = true; break; } catch (TimeoutException timeoutException) { } catch (PageRenderTimeException exception) { } dashlet.render(); } assertTrue(rendered, "Simple view not able render with contents"); List<SimpleViewInformation> informations = dashlet.getSimpleViewInformation(); assertNotNull(informations); assertEquals(informations.size(), 1); for (SimpleViewInformation simpleViewInformation : informations) { assertTrue(simpleViewInformation.getContentStatus().contains("Created")); assertNotNull(simpleViewInformation.getContentDetail()); assertNotNull(simpleViewInformation.getThumbnail()); assertNotNull(simpleViewInformation.getUser()); } }
public List<SimpleViewInformation> getSimpleViewInformation() { List<SimpleViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_SIMPLE_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); informations = new ArrayList<SimpleViewInformation>(links.size()); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(SIMPLE_THUMBNAIL_VIEW); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(SIMPLE_FILENAME); ShareLink content = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(By.cssSelector(".item-simple" + ">a")); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(SIMPLE_ITEM).getText(); drone.mouseOver(thumbnailLink); WebElement docPreview = drone.findAndWait(SIMPLE_PREVIEW_IMAGE); informations.add(new SimpleViewInformation(drone, thumbnail, content, user, contentStatus, docPreview.isDisplayed())); } } catch (NoSuchElementException nse) { logger.error(nse); throw new PageException("Unable to display simple view informationin site content dashlet data"); } return informations; }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<SimpleViewInformation> getSimpleViewInformation() { List<SimpleViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_SIMPLE_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); informations = new ArrayList<SimpleViewInformation>(links.size()); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(SIMPLE_THUMBNAIL_VIEW); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(SIMPLE_FILENAME); ShareLink content = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(By.cssSelector(".item-simple" + ">a")); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(SIMPLE_ITEM).getText(); drone.mouseOver(thumbnailLink); WebElement docPreview = drone.findAndWait(SIMPLE_PREVIEW_IMAGE); informations.add(new SimpleViewInformation(drone, thumbnail, content, user, contentStatus, docPreview.isDisplayed())); } } catch (NoSuchElementException nse) { logger.error(nse); throw new PageException("Unable to display simple view informationin site content dashlet data"); } return informations; } }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<SimpleViewInformation> getSimpleViewInformation() { List<SimpleViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_SIMPLE_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); informations = new ArrayList<SimpleViewInformation>(links.size()); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(SIMPLE_THUMBNAIL_VIEW); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(SIMPLE_FILENAME); ShareLink content = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(By.cssSelector(".item-simple" + ">a")); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(SIMPLE_ITEM).getText(); drone.mouseOver(thumbnailLink); WebElement docPreview = drone.findAndWait(SIMPLE_PREVIEW_IMAGE); informations.add(new SimpleViewInformation(drone, thumbnail, content, user, contentStatus, docPreview.isDisplayed())); } } catch (NoSuchElementException nse) { logger.error(nse); throw new PageException("Unable to display simple view informationin site content dashlet data"); } return informations; } protected  SiteContentDashlet(WebDrone drone); }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<SimpleViewInformation> getSimpleViewInformation() { List<SimpleViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_SIMPLE_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); informations = new ArrayList<SimpleViewInformation>(links.size()); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(SIMPLE_THUMBNAIL_VIEW); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(SIMPLE_FILENAME); ShareLink content = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(By.cssSelector(".item-simple" + ">a")); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(SIMPLE_ITEM).getText(); drone.mouseOver(thumbnailLink); WebElement docPreview = drone.findAndWait(SIMPLE_PREVIEW_IMAGE); informations.add(new SimpleViewInformation(drone, thumbnail, content, user, contentStatus, docPreview.isDisplayed())); } } catch (NoSuchElementException nse) { logger.error(nse); throw new PageException("Unable to display simple view informationin site content dashlet data"); } return informations; } protected  SiteContentDashlet(WebDrone drone); @SuppressWarnings("unchecked") SiteContentDashlet render(); @SuppressWarnings("unchecked") @Override SiteContentDashlet render(final long time); synchronized List<ShareLink> getSiteContents(); synchronized ShareLink select(final String name); @SuppressWarnings("unchecked") synchronized SiteContentDashlet render(RenderTime timer); synchronized SiteContentDashlet renderSimpleViewWithContent(); synchronized SiteContentDashlet renderSimpleViewWithContent(RenderTime timer); synchronized SiteContentDashlet renderDetailViewWithContent(); synchronized SiteContentDashlet renderDetailViewWithContent(RenderTime timer); boolean isDetailButtonDisplayed(); boolean isSimpleButtonDisplayed(); void selectHelpButton(); boolean isHelpButtonDisplayed(); void clickHelpButton(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); SiteContentDashlet closeHelpBallon(); void clickFilterButtton(); SiteDashboardPage selectFilter(SiteContentFilter filter); SiteContentFilter getCurrentFilter(); String getEmptyContentHeading(); List<String> getContentsDetails(); void clickSimpleView(); List<SimpleViewInformation> getSimpleViewInformation(); void clickDetailView(); List<DetailedViewInformation> getDetailedViewInformation(); List<SiteContentFilter> getFilters(); }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<SimpleViewInformation> getSimpleViewInformation() { List<SimpleViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_SIMPLE_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); informations = new ArrayList<SimpleViewInformation>(links.size()); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(SIMPLE_THUMBNAIL_VIEW); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(SIMPLE_FILENAME); ShareLink content = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(By.cssSelector(".item-simple" + ">a")); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(SIMPLE_ITEM).getText(); drone.mouseOver(thumbnailLink); WebElement docPreview = drone.findAndWait(SIMPLE_PREVIEW_IMAGE); informations.add(new SimpleViewInformation(drone, thumbnail, content, user, contentStatus, docPreview.isDisplayed())); } } catch (NoSuchElementException nse) { logger.error(nse); throw new PageException("Unable to display simple view informationin site content dashlet data"); } return informations; } protected  SiteContentDashlet(WebDrone drone); @SuppressWarnings("unchecked") SiteContentDashlet render(); @SuppressWarnings("unchecked") @Override SiteContentDashlet render(final long time); synchronized List<ShareLink> getSiteContents(); synchronized ShareLink select(final String name); @SuppressWarnings("unchecked") synchronized SiteContentDashlet render(RenderTime timer); synchronized SiteContentDashlet renderSimpleViewWithContent(); synchronized SiteContentDashlet renderSimpleViewWithContent(RenderTime timer); synchronized SiteContentDashlet renderDetailViewWithContent(); synchronized SiteContentDashlet renderDetailViewWithContent(RenderTime timer); boolean isDetailButtonDisplayed(); boolean isSimpleButtonDisplayed(); void selectHelpButton(); boolean isHelpButtonDisplayed(); void clickHelpButton(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); SiteContentDashlet closeHelpBallon(); void clickFilterButtton(); SiteDashboardPage selectFilter(SiteContentFilter filter); SiteContentFilter getCurrentFilter(); String getEmptyContentHeading(); List<String> getContentsDetails(); void clickSimpleView(); List<SimpleViewInformation> getSimpleViewInformation(); void clickDetailView(); List<DetailedViewInformation> getDetailedViewInformation(); List<SiteContentFilter> getFilters();  }