@Test(dependsOnMethods = "deletePostWithConfirm") public void isPostPresented() { assertTrue(blogPage.isNewPostEnabled()); postViewPage = blogPage.createPostInternally(postName, postText, tagName).render(); blogPage = postViewPage.clickBackLink().render(); Assert.assertTrue(blogPage.isPostPresented(postName), "Expected post with title '" + postName + "'"); }
public boolean isPostPresented(String postName) { boolean isDisplayed; checkNotNull(postName); try { WebElement theItem = drone.find(By.xpath(String.format(POST_TITLE, postName))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("Blog info with title %s was not found", postName), e); } return isDisplayed; }
BlogPage extends SitePage { public boolean isPostPresented(String postName) { boolean isDisplayed; checkNotNull(postName); try { WebElement theItem = drone.find(By.xpath(String.format(POST_TITLE, postName))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("Blog info with title %s was not found", postName), e); } return isDisplayed; } }
BlogPage extends SitePage { public boolean isPostPresented(String postName) { boolean isDisplayed; checkNotNull(postName); try { WebElement theItem = drone.find(By.xpath(String.format(POST_TITLE, postName))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("Blog info with title %s was not found", postName), e); } return isDisplayed; } BlogPage(WebDrone drone); }
BlogPage extends SitePage { public boolean isPostPresented(String postName) { boolean isDisplayed; checkNotNull(postName); try { WebElement theItem = drone.find(By.xpath(String.format(POST_TITLE, postName))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("Blog info with title %s was not found", postName), e); } return isDisplayed; } BlogPage(WebDrone drone); @SuppressWarnings("unchecked") @Override BlogPage render(RenderTime timer); @SuppressWarnings("unchecked") BlogPage render(); @SuppressWarnings("unchecked") @Override BlogPage render(long time); PostViewPage createPostInternally(String titleField); PostViewPage createPostInternally(String titleField, String txtLines); PostViewPage createPostInternally(String titleField, String txtLines, String tagName); PostViewPage createPostInternally(String titleField, String txtLines, List<String> tags); PostViewPage saveAsDraft(String titleField, String txtLines); boolean isNewPostEnabled(); PostViewPage openBlogPost(String title); int getPostsCount(); boolean isPostPresented(String postName); PostViewPage saveAsDraft(String titleField, String txtLines, List<String> tagName); RssFeedPage clickRssFeedBtn(String username, String password); boolean checkTags(String title, String tag); PostViewPage editPost(String oldTitle, String newTitle, String txtLines, String tagName, boolean removeTag); PostDirectoryInfo getPostDirectoryInfo(final String title); BlogTreeMenuNavigation getLeftMenus(); }
BlogPage extends SitePage { public boolean isPostPresented(String postName) { boolean isDisplayed; checkNotNull(postName); try { WebElement theItem = drone.find(By.xpath(String.format(POST_TITLE, postName))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("Blog info with title %s was not found", postName), e); } return isDisplayed; } BlogPage(WebDrone drone); @SuppressWarnings("unchecked") @Override BlogPage render(RenderTime timer); @SuppressWarnings("unchecked") BlogPage render(); @SuppressWarnings("unchecked") @Override BlogPage render(long time); PostViewPage createPostInternally(String titleField); PostViewPage createPostInternally(String titleField, String txtLines); PostViewPage createPostInternally(String titleField, String txtLines, String tagName); PostViewPage createPostInternally(String titleField, String txtLines, List<String> tags); PostViewPage saveAsDraft(String titleField, String txtLines); boolean isNewPostEnabled(); PostViewPage openBlogPost(String title); int getPostsCount(); boolean isPostPresented(String postName); PostViewPage saveAsDraft(String titleField, String txtLines, List<String> tagName); RssFeedPage clickRssFeedBtn(String username, String password); boolean checkTags(String title, String tag); PostViewPage editPost(String oldTitle, String newTitle, String txtLines, String tagName, boolean removeTag); PostDirectoryInfo getPostDirectoryInfo(final String title); BlogTreeMenuNavigation getLeftMenus();  }