@Test(dependsOnMethods = "clickRead") public void isTopicPresented() { assertTrue(discussionsPage.isTopicPresented(text)); }
public boolean isTopicPresented(String title) { boolean isDisplayed; if (title == null || title.isEmpty()) { throw new IllegalArgumentException("Title is required"); } try { WebElement theItem = drone.find(By.xpath(String.format(DISCUSSION_TOPIC_TITLE, title))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("File directory info with title %s was not found", title), e); } return isDisplayed; }
DiscussionsPage extends TopicsListPage { public boolean isTopicPresented(String title) { boolean isDisplayed; if (title == null || title.isEmpty()) { throw new IllegalArgumentException("Title is required"); } try { WebElement theItem = drone.find(By.xpath(String.format(DISCUSSION_TOPIC_TITLE, title))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("File directory info with title %s was not found", title), e); } return isDisplayed; } }
DiscussionsPage extends TopicsListPage { public boolean isTopicPresented(String title) { boolean isDisplayed; if (title == null || title.isEmpty()) { throw new IllegalArgumentException("Title is required"); } try { WebElement theItem = drone.find(By.xpath(String.format(DISCUSSION_TOPIC_TITLE, title))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("File directory info with title %s was not found", title), e); } return isDisplayed; } DiscussionsPage(WebDrone drone); }
DiscussionsPage extends TopicsListPage { public boolean isTopicPresented(String title) { boolean isDisplayed; if (title == null || title.isEmpty()) { throw new IllegalArgumentException("Title is required"); } try { WebElement theItem = drone.find(By.xpath(String.format(DISCUSSION_TOPIC_TITLE, title))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("File directory info with title %s was not found", title), e); } return isDisplayed; } DiscussionsPage(WebDrone drone); @SuppressWarnings("unchecked") @Override DiscussionsPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override DiscussionsPage render(); @SuppressWarnings("unchecked") @Override DiscussionsPage render(long time); TopicViewPage createTopic(String titleField, String textLines); TopicViewPage createTopic(String titleField); TopicViewPage createTopic(String titleField, String textLines, String tag); TopicDirectoryInfo getTopicDirectoryInfo(final String title); boolean isNewTopicEnabled(); TopicViewPage viewTopic(String title); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines, String tagName); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines, String tagName,  boolean removeTag); DiscussionsPage deleteTopicWithConfirm(String title); int getTopicsCount(); boolean isEditTopicDisplayed(String title); boolean isDeleteTopicDisplayed(String title); TopicsListFilter getTopicsListFilter(); List<String> getTopicTitles(); boolean isTopicPresented(String title); boolean checkTags(String title, String tag); boolean isNoTopicsDisplayed(); }
DiscussionsPage extends TopicsListPage { public boolean isTopicPresented(String title) { boolean isDisplayed; if (title == null || title.isEmpty()) { throw new IllegalArgumentException("Title is required"); } try { WebElement theItem = drone.find(By.xpath(String.format(DISCUSSION_TOPIC_TITLE, title))); isDisplayed = theItem.isDisplayed(); } catch (NoSuchElementException nse) { isDisplayed = false; } catch (TimeoutException e) { throw new PageException(String.format("File directory info with title %s was not found", title), e); } return isDisplayed; } DiscussionsPage(WebDrone drone); @SuppressWarnings("unchecked") @Override DiscussionsPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override DiscussionsPage render(); @SuppressWarnings("unchecked") @Override DiscussionsPage render(long time); TopicViewPage createTopic(String titleField, String textLines); TopicViewPage createTopic(String titleField); TopicViewPage createTopic(String titleField, String textLines, String tag); TopicDirectoryInfo getTopicDirectoryInfo(final String title); boolean isNewTopicEnabled(); TopicViewPage viewTopic(String title); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines, String tagName); TopicViewPage editTopic(String oldTitle, String newTitle, String txtLines, String tagName,  boolean removeTag); DiscussionsPage deleteTopicWithConfirm(String title); int getTopicsCount(); boolean isEditTopicDisplayed(String title); boolean isDeleteTopicDisplayed(String title); TopicsListFilter getTopicsListFilter(); List<String> getTopicTitles(); boolean isTopicPresented(String title); boolean checkTags(String title, String tag); boolean isNoTopicsDisplayed();  }