@Test(dependsOnMethods="getSimpleViewInformation") public void getDetailedViewInformation() throws Exception { navigateToSiteDashboard(); SiteContentDashlet dashlet = siteDashBoard.getDashlet(SITE_CONTENT).render(); dashlet.clickDetailView(); int count = 0; boolean rendered = false; while (count < 10) { dashlet.selectFilter(SiteContentFilter.I_HAVE_RECENTLY_MODIFIED); try { count++; dashlet = dashlet.renderDetailViewWithContent(); rendered = true; break; } catch (TimeoutException timeoutException) { } catch (PageRenderTimeException exception) { } dashlet.render(); } assertTrue(rendered, "Detail view not able render with contents"); dashlet.clickDetailView(); dashlet.renderDetailViewWithContent(); List<DetailedViewInformation> informations = dashlet.getDetailedViewInformation(); assertNotNull(informations); assertEquals(informations.size(), 1); for (DetailedViewInformation detailedViewInformation : informations) { assertTrue(detailedViewInformation.getContentStatus().contains("Created")); assertFalse(detailedViewInformation.isPreviewDisplayed()); assertNotNull(detailedViewInformation.getContentDetail()); assertNotNull(detailedViewInformation.getThumbnail()); assertNotNull(detailedViewInformation.getUser()); assertEquals(detailedViewInformation.getDescription(), "No Description"); assertEquals(detailedViewInformation.getVersion(), 1.0); assertEquals(detailedViewInformation.getLikecount(), 1); assertEquals(detailedViewInformation.getFileSize(), "33 bytes"); assertNotNull(detailedViewInformation.getLike()); assertNotNull(detailedViewInformation.getFavorite()); assertNotNull(detailedViewInformation.getComment()); } }
public List<DetailedViewInformation> getDetailedViewInformation() { List<DetailedViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_DETAILED_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); if (links == null || links.isEmpty()) { return Collections.emptyList(); } informations = new ArrayList<DetailedViewInformation>(); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(DETAIL_THUMBNAIL_LINK); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(By.cssSelector(".filename>a")); ShareLink contentDetail = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(USER_LINK); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(DETAIL_CONTENT_STATUTS).getText(); WebElement commentLink = tr.findElement(COMMENT_LINK); ShareLink comment = new ShareLink(commentLink, drone); WebElement likeLink = tr.findElement(LIKE_LINK); ShareLink like = new ShareLink(likeLink, drone); boolean likeEnabled = false; String likeClass = likeLink.getAttribute("class"); if (likeClass != null) { likeEnabled = likeClass.endsWith("enabled"); } WebElement favouriteLink = tr.findElement(FAVOURITE_LINK); ShareLink favourite = new ShareLink(favouriteLink, drone); boolean favouriteEnabled = false; String favouriteClass = favouriteLink.getAttribute("class"); if (favouriteClass != null) { favouriteEnabled = favouriteClass.endsWith("enabled"); } int likeCount = Integer.parseInt(tr.findElement(LIKE_COUNT).getText()); String fileSize = tr.findElement(FILE_SIZE).getText(); String desc = tr.findElement(By.cssSelector(DETAIL_DESC)).getText(); drone.mouseOverOnElement(thumbnailLink); WebElement docVersionElement = tr.findElement(DOCUMENT_VERSION); double docVersion = 0; if (docVersionElement != null && !docVersionElement.getText().isEmpty()) { docVersion = Double.parseDouble(docVersionElement.getText()); } DetailedViewInformation detailedView = new DetailedViewInformation(drone, thumbnail, contentDetail, user, contentStatus, comment, like, favourite, likeCount, fileSize, desc, docVersion, favouriteEnabled, likeEnabled); informations.add(detailedView); } } catch (NoSuchElementException nse) { throw new PageException("Unable to access site content dashlet data", nse); } return informations; }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<DetailedViewInformation> getDetailedViewInformation() { List<DetailedViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_DETAILED_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); if (links == null || links.isEmpty()) { return Collections.emptyList(); } informations = new ArrayList<DetailedViewInformation>(); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(DETAIL_THUMBNAIL_LINK); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(By.cssSelector(".filename>a")); ShareLink contentDetail = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(USER_LINK); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(DETAIL_CONTENT_STATUTS).getText(); WebElement commentLink = tr.findElement(COMMENT_LINK); ShareLink comment = new ShareLink(commentLink, drone); WebElement likeLink = tr.findElement(LIKE_LINK); ShareLink like = new ShareLink(likeLink, drone); boolean likeEnabled = false; String likeClass = likeLink.getAttribute("class"); if (likeClass != null) { likeEnabled = likeClass.endsWith("enabled"); } WebElement favouriteLink = tr.findElement(FAVOURITE_LINK); ShareLink favourite = new ShareLink(favouriteLink, drone); boolean favouriteEnabled = false; String favouriteClass = favouriteLink.getAttribute("class"); if (favouriteClass != null) { favouriteEnabled = favouriteClass.endsWith("enabled"); } int likeCount = Integer.parseInt(tr.findElement(LIKE_COUNT).getText()); String fileSize = tr.findElement(FILE_SIZE).getText(); String desc = tr.findElement(By.cssSelector(DETAIL_DESC)).getText(); drone.mouseOverOnElement(thumbnailLink); WebElement docVersionElement = tr.findElement(DOCUMENT_VERSION); double docVersion = 0; if (docVersionElement != null && !docVersionElement.getText().isEmpty()) { docVersion = Double.parseDouble(docVersionElement.getText()); } DetailedViewInformation detailedView = new DetailedViewInformation(drone, thumbnail, contentDetail, user, contentStatus, comment, like, favourite, likeCount, fileSize, desc, docVersion, favouriteEnabled, likeEnabled); informations.add(detailedView); } } catch (NoSuchElementException nse) { throw new PageException("Unable to access site content dashlet data", nse); } return informations; } }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<DetailedViewInformation> getDetailedViewInformation() { List<DetailedViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_DETAILED_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); if (links == null || links.isEmpty()) { return Collections.emptyList(); } informations = new ArrayList<DetailedViewInformation>(); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(DETAIL_THUMBNAIL_LINK); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(By.cssSelector(".filename>a")); ShareLink contentDetail = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(USER_LINK); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(DETAIL_CONTENT_STATUTS).getText(); WebElement commentLink = tr.findElement(COMMENT_LINK); ShareLink comment = new ShareLink(commentLink, drone); WebElement likeLink = tr.findElement(LIKE_LINK); ShareLink like = new ShareLink(likeLink, drone); boolean likeEnabled = false; String likeClass = likeLink.getAttribute("class"); if (likeClass != null) { likeEnabled = likeClass.endsWith("enabled"); } WebElement favouriteLink = tr.findElement(FAVOURITE_LINK); ShareLink favourite = new ShareLink(favouriteLink, drone); boolean favouriteEnabled = false; String favouriteClass = favouriteLink.getAttribute("class"); if (favouriteClass != null) { favouriteEnabled = favouriteClass.endsWith("enabled"); } int likeCount = Integer.parseInt(tr.findElement(LIKE_COUNT).getText()); String fileSize = tr.findElement(FILE_SIZE).getText(); String desc = tr.findElement(By.cssSelector(DETAIL_DESC)).getText(); drone.mouseOverOnElement(thumbnailLink); WebElement docVersionElement = tr.findElement(DOCUMENT_VERSION); double docVersion = 0; if (docVersionElement != null && !docVersionElement.getText().isEmpty()) { docVersion = Double.parseDouble(docVersionElement.getText()); } DetailedViewInformation detailedView = new DetailedViewInformation(drone, thumbnail, contentDetail, user, contentStatus, comment, like, favourite, likeCount, fileSize, desc, docVersion, favouriteEnabled, likeEnabled); informations.add(detailedView); } } catch (NoSuchElementException nse) { throw new PageException("Unable to access site content dashlet data", nse); } return informations; } protected  SiteContentDashlet(WebDrone drone); }
SiteContentDashlet extends AbstractDashlet implements Dashlet { public List<DetailedViewInformation> getDetailedViewInformation() { List<DetailedViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_DETAILED_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); if (links == null || links.isEmpty()) { return Collections.emptyList(); } informations = new ArrayList<DetailedViewInformation>(); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(DETAIL_THUMBNAIL_LINK); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(By.cssSelector(".filename>a")); ShareLink contentDetail = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(USER_LINK); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(DETAIL_CONTENT_STATUTS).getText(); WebElement commentLink = tr.findElement(COMMENT_LINK); ShareLink comment = new ShareLink(commentLink, drone); WebElement likeLink = tr.findElement(LIKE_LINK); ShareLink like = new ShareLink(likeLink, drone); boolean likeEnabled = false; String likeClass = likeLink.getAttribute("class"); if (likeClass != null) { likeEnabled = likeClass.endsWith("enabled"); } WebElement favouriteLink = tr.findElement(FAVOURITE_LINK); ShareLink favourite = new ShareLink(favouriteLink, drone); boolean favouriteEnabled = false; String favouriteClass = favouriteLink.getAttribute("class"); if (favouriteClass != null) { favouriteEnabled = favouriteClass.endsWith("enabled"); } int likeCount = Integer.parseInt(tr.findElement(LIKE_COUNT).getText()); String fileSize = tr.findElement(FILE_SIZE).getText(); String desc = tr.findElement(By.cssSelector(DETAIL_DESC)).getText(); drone.mouseOverOnElement(thumbnailLink); WebElement docVersionElement = tr.findElement(DOCUMENT_VERSION); double docVersion = 0; if (docVersionElement != null && !docVersionElement.getText().isEmpty()) { docVersion = Double.parseDouble(docVersionElement.getText()); } DetailedViewInformation detailedView = new DetailedViewInformation(drone, thumbnail, contentDetail, user, contentStatus, comment, like, favourite, likeCount, fileSize, desc, docVersion, favouriteEnabled, likeEnabled); informations.add(detailedView); } } catch (NoSuchElementException nse) { throw new PageException("Unable to access site content dashlet data", nse); } 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<DetailedViewInformation> getDetailedViewInformation() { List<DetailedViewInformation> informations = null; try { drone.findAndWait(By.cssSelector(DASHLET_DETAILED_VIEW_BUTTON)).click(); List<WebElement> links = drone.findAndWaitForElements(By.xpath(NUMBER_OF_DOCS_TABLE)); if (links == null || links.isEmpty()) { return Collections.emptyList(); } informations = new ArrayList<DetailedViewInformation>(); for (WebElement tr : links) { WebElement thumbnailLink = tr.findElement(DETAIL_THUMBNAIL_LINK); ShareLink thumbnail = new ShareLink(thumbnailLink, drone); WebElement contentLink = tr.findElement(By.cssSelector(".filename>a")); ShareLink contentDetail = new ShareLink(contentLink, drone); WebElement userLink = tr.findElement(USER_LINK); ShareLink user = new ShareLink(userLink, drone); String contentStatus = tr.findElement(DETAIL_CONTENT_STATUTS).getText(); WebElement commentLink = tr.findElement(COMMENT_LINK); ShareLink comment = new ShareLink(commentLink, drone); WebElement likeLink = tr.findElement(LIKE_LINK); ShareLink like = new ShareLink(likeLink, drone); boolean likeEnabled = false; String likeClass = likeLink.getAttribute("class"); if (likeClass != null) { likeEnabled = likeClass.endsWith("enabled"); } WebElement favouriteLink = tr.findElement(FAVOURITE_LINK); ShareLink favourite = new ShareLink(favouriteLink, drone); boolean favouriteEnabled = false; String favouriteClass = favouriteLink.getAttribute("class"); if (favouriteClass != null) { favouriteEnabled = favouriteClass.endsWith("enabled"); } int likeCount = Integer.parseInt(tr.findElement(LIKE_COUNT).getText()); String fileSize = tr.findElement(FILE_SIZE).getText(); String desc = tr.findElement(By.cssSelector(DETAIL_DESC)).getText(); drone.mouseOverOnElement(thumbnailLink); WebElement docVersionElement = tr.findElement(DOCUMENT_VERSION); double docVersion = 0; if (docVersionElement != null && !docVersionElement.getText().isEmpty()) { docVersion = Double.parseDouble(docVersionElement.getText()); } DetailedViewInformation detailedView = new DetailedViewInformation(drone, thumbnail, contentDetail, user, contentStatus, comment, like, favourite, likeCount, fileSize, desc, docVersion, favouriteEnabled, likeEnabled); informations.add(detailedView); } } catch (NoSuchElementException nse) { throw new PageException("Unable to access site content dashlet data", nse); } 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();  }