@Test(dependsOnMethods = "selectTopicUser") public void selectTopicsFilter() throws Exception { navigateToSiteDashboard(); myDiscussionsDashlet = siteDashBoard.getDashlet(MY_DISCUSSIONS).render(); drone.findAndWaitWithRefresh(By.xpath(String.format(" myDiscussionsDashlet.clickTopicsButtton(); siteDashBoard = myDiscussionsDashlet.selectTopicsFilter(ALL_TOPICS).render(); List<ShareLink> allTopics = myDiscussionsDashlet.getTopics(LinkType.Topic); Assert.assertNotNull(allTopics); Assert.assertEquals(allTopics.size(), 3); Assert.assertEquals(allTopics.get(0).getDescription(), TOPIC_DETAILS_TITLE_THREE); Assert.assertEquals(allTopics.get(1).getDescription(), TOPIC_DETAILS_TITLE_TWO); Assert.assertEquals(allTopics.get(2).getDescription(), TOPIC_DETAILS_TITLE_ONE); myDiscussionsDashlet.clickTopicsButtton(); siteDashBoard = myDiscussionsDashlet.selectTopicsFilter(MY_TOPICS).render(); List<ShareLink> myTopics = myDiscussionsDashlet.getTopics(LinkType.User); Assert.assertNotNull(myTopics); Assert.assertEquals(myTopics.size(), 3); for (ShareLink myTopic : myTopics) { Assert.assertEquals(myTopic.getDescription(), TOPIC_DETAILS_AUTHOR); } }
public HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter) { clickTopicsButtton(); List<WebElement> filterElements = drone.findAndWaitForElements(By.cssSelector(DASHLET_LIST_OF_FILTER_BUTTONS)); if (filterElements != null) { for (WebElement webElement : filterElements) { if (webElement.getText().equals(filter.getDescription())) { webElement.click(); } } } waitUntilAlert(1); return FactorySharePage.resolvePage(drone); }
MyDiscussionsDashlet extends AbstractDashlet implements Dashlet { public HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter) { clickTopicsButtton(); List<WebElement> filterElements = drone.findAndWaitForElements(By.cssSelector(DASHLET_LIST_OF_FILTER_BUTTONS)); if (filterElements != null) { for (WebElement webElement : filterElements) { if (webElement.getText().equals(filter.getDescription())) { webElement.click(); } } } waitUntilAlert(1); return FactorySharePage.resolvePage(drone); } }
MyDiscussionsDashlet extends AbstractDashlet implements Dashlet { public HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter) { clickTopicsButtton(); List<WebElement> filterElements = drone.findAndWaitForElements(By.cssSelector(DASHLET_LIST_OF_FILTER_BUTTONS)); if (filterElements != null) { for (WebElement webElement : filterElements) { if (webElement.getText().equals(filter.getDescription())) { webElement.click(); } } } waitUntilAlert(1); return FactorySharePage.resolvePage(drone); } protected  MyDiscussionsDashlet(WebDrone drone); }
MyDiscussionsDashlet extends AbstractDashlet implements Dashlet { public HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter) { clickTopicsButtton(); List<WebElement> filterElements = drone.findAndWaitForElements(By.cssSelector(DASHLET_LIST_OF_FILTER_BUTTONS)); if (filterElements != null) { for (WebElement webElement : filterElements) { if (webElement.getText().equals(filter.getDescription())) { webElement.click(); } } } waitUntilAlert(1); return FactorySharePage.resolvePage(drone); } protected  MyDiscussionsDashlet(WebDrone drone); @SuppressWarnings("unchecked") MyDiscussionsDashlet render(); @SuppressWarnings("unchecked") @Override MyDiscussionsDashlet render(final long time); @SuppressWarnings("unchecked") MyDiscussionsDashlet render(RenderTime timer); String getEmptyDashletMessage(); boolean isHelpButtonDisplayed(); boolean isNewTopicLinkDisplayed(); void clickHelpButton(); CreateNewTopicPage clickNewTopicButton(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); MyDiscussionsDashlet closeHelpBallon(); void clickTopicsButtton(); void clickHistoryButtton(); List<MyDiscussionsTopicsFilter> getTopicFilters(); List<MyDiscussionsHistoryFilter> getHistoryFilters(); HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter); MyDiscussionsTopicsFilter getCurrentTopicFilter(); MyDiscussionsHistoryFilter getCurrentHistoryFilter(); HtmlPage selectTopicsHistoryFilter(MyDiscussionsHistoryFilter lastDayTopics); ShareLink selectLink(final String name); ShareLink selectTopicTitle(final String name); ShareLink selectTopicUser(final String name); synchronized List<ShareLink> getTopics(LinkType linkType); synchronized List<TopicStatusDetails> getUpdatedTopics(); boolean isTopicTitleDisplayed(String topicTitle); void resizeDashlet(int x, int y); }
MyDiscussionsDashlet extends AbstractDashlet implements Dashlet { public HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter) { clickTopicsButtton(); List<WebElement> filterElements = drone.findAndWaitForElements(By.cssSelector(DASHLET_LIST_OF_FILTER_BUTTONS)); if (filterElements != null) { for (WebElement webElement : filterElements) { if (webElement.getText().equals(filter.getDescription())) { webElement.click(); } } } waitUntilAlert(1); return FactorySharePage.resolvePage(drone); } protected  MyDiscussionsDashlet(WebDrone drone); @SuppressWarnings("unchecked") MyDiscussionsDashlet render(); @SuppressWarnings("unchecked") @Override MyDiscussionsDashlet render(final long time); @SuppressWarnings("unchecked") MyDiscussionsDashlet render(RenderTime timer); String getEmptyDashletMessage(); boolean isHelpButtonDisplayed(); boolean isNewTopicLinkDisplayed(); void clickHelpButton(); CreateNewTopicPage clickNewTopicButton(); boolean isBalloonDisplayed(); String getHelpBalloonMessage(); MyDiscussionsDashlet closeHelpBallon(); void clickTopicsButtton(); void clickHistoryButtton(); List<MyDiscussionsTopicsFilter> getTopicFilters(); List<MyDiscussionsHistoryFilter> getHistoryFilters(); HtmlPage selectTopicsFilter(MyDiscussionsTopicsFilter filter); MyDiscussionsTopicsFilter getCurrentTopicFilter(); MyDiscussionsHistoryFilter getCurrentHistoryFilter(); HtmlPage selectTopicsHistoryFilter(MyDiscussionsHistoryFilter lastDayTopics); ShareLink selectLink(final String name); ShareLink selectTopicTitle(final String name); ShareLink selectTopicUser(final String name); synchronized List<ShareLink> getTopics(LinkType linkType); synchronized List<TopicStatusDetails> getUpdatedTopics(); boolean isTopicTitleDisplayed(String topicTitle); void resizeDashlet(int x, int y);  }