@Test(dependsOnMethods = "testCreateEvent", timeOut = 60000) public void testIsEventPresent() { Assert.assertTrue(calendarPage.isEventPresent(CalendarPage.EventType.MONTH_TAB_SINGLE_EVENT, event1), "The " + event1 + " isn't correctly displayed on the month tab"); }
public boolean isEventPresent(EventType eventType, String eventName) { try { logger.info("Check that link with name " + eventName + " presented at the current tab"); if (!eventName.isEmpty()) { String linkEventXpath = String.format(eventType.getXpathLocator(), eventName); WebElement element = drone.find(By.xpath(linkEventXpath)); return element.isDisplayed(); } else { return false; } } catch (NoSuchElementException te) { logger.debug("Unable to locate expected link on tab table"); return false; } catch (StaleElementReferenceException se) { return isEventPresent(eventType, eventName); } }
CalendarPage extends SitePage { public boolean isEventPresent(EventType eventType, String eventName) { try { logger.info("Check that link with name " + eventName + " presented at the current tab"); if (!eventName.isEmpty()) { String linkEventXpath = String.format(eventType.getXpathLocator(), eventName); WebElement element = drone.find(By.xpath(linkEventXpath)); return element.isDisplayed(); } else { return false; } } catch (NoSuchElementException te) { logger.debug("Unable to locate expected link on tab table"); return false; } catch (StaleElementReferenceException se) { return isEventPresent(eventType, eventName); } } }
CalendarPage extends SitePage { public boolean isEventPresent(EventType eventType, String eventName) { try { logger.info("Check that link with name " + eventName + " presented at the current tab"); if (!eventName.isEmpty()) { String linkEventXpath = String.format(eventType.getXpathLocator(), eventName); WebElement element = drone.find(By.xpath(linkEventXpath)); return element.isDisplayed(); } else { return false; } } catch (NoSuchElementException te) { logger.debug("Unable to locate expected link on tab table"); return false; } catch (StaleElementReferenceException se) { return isEventPresent(eventType, eventName); } } CalendarPage(WebDrone drone); }
CalendarPage extends SitePage { public boolean isEventPresent(EventType eventType, String eventName) { try { logger.info("Check that link with name " + eventName + " presented at the current tab"); if (!eventName.isEmpty()) { String linkEventXpath = String.format(eventType.getXpathLocator(), eventName); WebElement element = drone.find(By.xpath(linkEventXpath)); return element.isDisplayed(); } else { return false; } } catch (NoSuchElementException te) { logger.debug("Unable to locate expected link on tab table"); return false; } catch (StaleElementReferenceException se) { return isEventPresent(eventType, eventName); } } CalendarPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CalendarPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CalendarPage render(); @SuppressWarnings("unchecked") @Override CalendarPage render(long time); AddEventForm clickOnAddEvent(); AddEventForm clickOnTabOrButtonAddEvent(ActionEventVia createEventVia); CalendarPage createEvent(String whatField, String whereField, String description, boolean allDay); CalendarPage createEvent(ActionEventVia createEventVia, String whatField, String whereField, String description, String startDate, String startTime, String endDate, String endTime, String tags, boolean allDay); CalendarPage createEvent(ActionEventVia createEventVia, String whatField, String whereField, String description, String startYear, String startMonth, String startDate, String startTime, String endYear, String endMonth, String endDate, String endTime, String tags, boolean allDay); boolean isAddEventPresent(); CalendarPage editEvent(String eventName, EventType eventType, ActionEventVia editEventVia, String whatField, String whereField, String description, String startDate, String startTime, String endDate, String endTime, String tags, boolean allDay, String[] removeTag); CalendarPage deleteEvent(String eventName, EventType eventType, ActionEventVia editEventVia); HtmlPage chooseDayTab(); HtmlPage chooseWeekTab(); HtmlPage chooseMonthTab(); HtmlPage chooseAgendaTab(); boolean isDayTabOpened(); boolean isWeekTabOpened(); boolean isMonthTabOpened(); boolean isAgendaTabOpened(); boolean isEventPresent(EventType eventType, String eventName); CalendarPage showAllHours(); boolean showAllHoursButtonDisplayed(); CalendarPage showWorkingHours(); boolean showWorkingHoursButtonDisplayed(); boolean checkTableHours(HoursFromTable xpath); InformationEventForm clickOnEvent(EventType eventType, String eventName); String clickIcalFeedButton(); String getIcalFeedHref(); boolean isShowAllItemsPresent(); CalendarPage clickShowAllItems(); boolean isTagPresent(String tagName); CalendarPage clickTagLink(String tagName); boolean isAddEventClickable(ActionEventVia viaTab); int getTheNumOfEvents(ActionEventVia viaTab); }
CalendarPage extends SitePage { public boolean isEventPresent(EventType eventType, String eventName) { try { logger.info("Check that link with name " + eventName + " presented at the current tab"); if (!eventName.isEmpty()) { String linkEventXpath = String.format(eventType.getXpathLocator(), eventName); WebElement element = drone.find(By.xpath(linkEventXpath)); return element.isDisplayed(); } else { return false; } } catch (NoSuchElementException te) { logger.debug("Unable to locate expected link on tab table"); return false; } catch (StaleElementReferenceException se) { return isEventPresent(eventType, eventName); } } CalendarPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CalendarPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CalendarPage render(); @SuppressWarnings("unchecked") @Override CalendarPage render(long time); AddEventForm clickOnAddEvent(); AddEventForm clickOnTabOrButtonAddEvent(ActionEventVia createEventVia); CalendarPage createEvent(String whatField, String whereField, String description, boolean allDay); CalendarPage createEvent(ActionEventVia createEventVia, String whatField, String whereField, String description, String startDate, String startTime, String endDate, String endTime, String tags, boolean allDay); CalendarPage createEvent(ActionEventVia createEventVia, String whatField, String whereField, String description, String startYear, String startMonth, String startDate, String startTime, String endYear, String endMonth, String endDate, String endTime, String tags, boolean allDay); boolean isAddEventPresent(); CalendarPage editEvent(String eventName, EventType eventType, ActionEventVia editEventVia, String whatField, String whereField, String description, String startDate, String startTime, String endDate, String endTime, String tags, boolean allDay, String[] removeTag); CalendarPage deleteEvent(String eventName, EventType eventType, ActionEventVia editEventVia); HtmlPage chooseDayTab(); HtmlPage chooseWeekTab(); HtmlPage chooseMonthTab(); HtmlPage chooseAgendaTab(); boolean isDayTabOpened(); boolean isWeekTabOpened(); boolean isMonthTabOpened(); boolean isAgendaTabOpened(); boolean isEventPresent(EventType eventType, String eventName); CalendarPage showAllHours(); boolean showAllHoursButtonDisplayed(); CalendarPage showWorkingHours(); boolean showWorkingHoursButtonDisplayed(); boolean checkTableHours(HoursFromTable xpath); InformationEventForm clickOnEvent(EventType eventType, String eventName); String clickIcalFeedButton(); String getIcalFeedHref(); boolean isShowAllItemsPresent(); CalendarPage clickShowAllItems(); boolean isTagPresent(String tagName); CalendarPage clickTagLink(String tagName); boolean isAddEventClickable(ActionEventVia viaTab); int getTheNumOfEvents(ActionEventVia viaTab);  }