Class TaskManagerGanttMacro


  • public class TaskManagerGanttMacro
    extends org.xwiki.test.ui.po.ViewPage
    Can perform common test actions on a div generated by a taskgantt macro.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static List<String> viewModes  
      • Fields inherited from class org.xwiki.test.ui.po.BasePage

        logo
    • Constructor Summary

      Constructors 
      Constructor Description
      TaskManagerGanttMacro​(org.openqa.selenium.WebElement ganttElement)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void changeViewMode​(String viewMode)
      Changes the time scale of the gantt diagram ('Month', 'Day', 'Quarter Day', etc.).
      boolean dragProgress​(String id, int offset)
      Drag the task progress by the specified amount of pixels.
      void dragTask​(String id, int offset)
      Drag the task by the specified amount of pixels.
      void dragTaskEnd​(String id, int offset)
      Drag the task end date by the specified amount of pixels.
      void dragTaskStart​(String id, int offset)
      Drag the task start date by the specified amount of pixels.
      static List<TaskManagerGanttMacro> getGanttMacrosOnCurrentPage()  
      org.openqa.selenium.WebElement getTaskBar​(String id)
      Get the gantt bar element of the given task.
      List<String> getTaskIds()
      Get all task ids of tasks present in the gantt diagram.
      boolean isOverlayActive()
      Whether the overlay preventing any interaction with the diagram is active.
      void openTaskPage​(String id)
      Double click a task, which opens the task page in a new tab.
      • Methods inherited from class org.xwiki.test.ui.po.ViewPage

        clickBreadcrumbLink, clickWantedLink, clickWantedLink, contentContainsElement, editSection, exists, getBreadcrumb, getBreadcrumbContent, getContent, getPageBackgroundColor, getTitleColor, getTitleFontFamily, getTranslateButton, hasBreadcrumbContent, hasBreadcrumbContent, hasTranslateButton, isInlinePage, openCommentsDocExtraPane, openHistoryDocExtraPane, openInformationDocExtraPane, scrollToTop, useShortcutForDocExtraPane, useShortcutKeyForCommentPane, useShortcutKeyForHistoryPane, useShortcutKeyForInformationPane, waitForDocExtraPaneActive, waitUntilContent
      • Methods inherited from class org.xwiki.test.ui.po.BasePage

        canDelete, clickAdminActionsSubMenuEntry, clickEditSubMenuEntry, clickLocale, clickMoreActionsSubMenuEntry, copy, createInlinePage, createPage, delete, deletePage, edit, editClass, editInline, editObjects, editRights, editWiki, editWYSIWYG, getCurrentUser, getDocumentTitle, getEditURL, getErrorContent, getHTMLMetaDataValue, getLocales, getMetaDataValue, getPageTitle, getPageURL, hasLeftPanel, hasLoginLink, hasNotificationsMenu, hasRenderingError, hideDrawer, isAuthenticated, isDrawerVisible, isForbidden, isNewDocument, isNotificationsMenuOpen, login, logout, register, reloadPage, rename, sendKeys, showDrawer, toggleActionMenu, toggleDrawer, toggleNotificationsMenu, useShortcutKeyForClassEditing, useShortcutKeyForEditing, useShortcutKeyForInlineEditing, useShortcutKeyForObjectEditing, useShortcutKeyForPageDeletion, useShortcutKeyForPageRenaming, useShortcutKeyForRightsEditing, useShortcutKeyForSourceViewer, useShortcutKeyForWikiEditing, useShortcutKeyForWysiwygEditing, viewChildren, watchDocument, watchSpace, watchWiki
      • Methods inherited from class org.xwiki.test.ui.po.BaseElement

        getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
    • Field Detail

      • viewModes

        public static final List<String> viewModes
    • Constructor Detail

      • TaskManagerGanttMacro

        public TaskManagerGanttMacro​(org.openqa.selenium.WebElement ganttElement)
    • Method Detail

      • changeViewMode

        public void changeViewMode​(String viewMode)
        Changes the time scale of the gantt diagram ('Month', 'Day', 'Quarter Day', etc.).
        Parameters:
        viewMode - the value of the desired view mode.
      • isOverlayActive

        public boolean isOverlayActive()
        Whether the overlay preventing any interaction with the diagram is active.
        Returns:
        true if the overlay is active.
      • getTaskBar

        public org.openqa.selenium.WebElement getTaskBar​(String id)
                                                  throws org.openqa.selenium.NoSuchElementException
        Get the gantt bar element of the given task.
        Parameters:
        id - the id of the bar task element, given as a full page reference ("xwiki:Space.TaskPage")
        Returns:
        the gantt bar element if it exists.
        Throws:
        org.openqa.selenium.NoSuchElementException
      • getTaskIds

        public List<String> getTaskIds()
        Get all task ids of tasks present in the gantt diagram.
        Returns:
        a list of ids of all tasks in the gantt diagram. The task ids are page references in the 'xwiki:Space.Page' format.
      • openTaskPage

        public void openTaskPage​(String id)
        Double click a task, which opens the task page in a new tab.
        Parameters:
        id - the id of the bar task element, given as a full page reference ("xwiki:Space.TaskPage")
      • dragTaskStart

        public void dragTaskStart​(String id,
                                  int offset)
        Drag the task start date by the specified amount of pixels.
        Parameters:
        id - the task id to drag
        offset - amount of pixels to move. Negative values move to the left, positive to the right. Note that the date will not be changed if the amount to move is less than the snapping interval defined in the gantt's js (also depends on the current view mode).
      • dragTaskEnd

        public void dragTaskEnd​(String id,
                                int offset)
        Drag the task end date by the specified amount of pixels.
        Parameters:
        id - the task id to drag
        offset - amount of pixels to move. Negative values move to the left, positive to the right. Note that the date will not be changed if the amount to move is less than the snapping interval defined in the gantt's js (also depends on the current view mode).
      • dragProgress

        public boolean dragProgress​(String id,
                                    int offset)
        Drag the task progress by the specified amount of pixels.
        Parameters:
        id - the task id to drag
        offset - amount of pixels to move. Negative values move to the left, positive to the right.
        Returns:
        false if the bar doesn't have a progress handle (either 0 or 100 progress), true if the progress was changed.
      • dragTask

        public void dragTask​(String id,
                             int offset)
        Drag the task by the specified amount of pixels.
        Parameters:
        id - the task id to drag
        offset - amount of pixels to move. Negative values move to the left, positive to the right. Note that the date will not be changed if the amount to move is less than the snapping interval defined in the gantt's js (also depends on the current view mode).