Class BasePage

    • Field Detail

      • logo

        protected org.openqa.selenium.WebElement logo
        Used to scroll the page to the top before accessing the floating menu.
    • Constructor Detail

      • BasePage

        public BasePage()
        Note: when reusing instances of BasePage, the constructor is not doing the work anymore and the BaseElement.waitUntilPageIsReady() method needs to be executed manually, when needed.

        Note2: Never call the constructor before navigating to the page you need to test first.

    • Method Detail

      • getPageTitle

        public String getPageTitle()
      • getPageURL

        public String getPageURL()
      • getMetaDataValue

        public String getMetaDataValue​(String metaName)
        Parameters:
        metaName - the name of the XWiki document metadata
        Returns:
        the value of the specified XWiki document metadata for the current XWiki document
        See Also:
        getHTMLMetaDataValue(String)
      • getHTMLMetaDataValue

        public String getHTMLMetaDataValue​(String metaName)
        Parameters:
        metaName - the name of the HTML meta field
        Returns:
        the value of the requested HTML meta field with from the current page
        Since:
        7.2RC1
      • isAuthenticated

        public boolean isAuthenticated()
        Returns:
        true if we are currently logged in, false otherwise
      • isNewDocument

        public boolean isNewDocument()
        Determine if the current page is a new document.
        Returns:
        true if the document is new, false otherwise
      • clickEditSubMenuEntry

        protected void clickEditSubMenuEntry​(String id)
        Perform a click on a "edit menu" sub-menu entry.
        Parameters:
        id - The id of the entry to follow
      • edit

        public void edit()
        Performs a click on the "edit" button.
      • getEditURL

        public String getEditURL()
        Gets a string representation of the URL for editing the page.
      • editWiki

        public WikiEditPage editWiki()
        Performs a click on the "edit wiki" entry of the content menu.
      • editWYSIWYG

        public WYSIWYGEditPage editWYSIWYG()
        Performs a click on the "edit wysiwyg" entry of the content menu.
      • editInline

        public <T extends InlinePage> T editInline()
        Performs a click on the "edit inline" entry of the content menu.
      • createInlinePage

        protected <T extends InlinePage> T createInlinePage()
        Can be overridden to return extended InlinePage.
      • editRights

        public RightsEditPage editRights()
        Performs a click on the "edit acces rights" entry of the content menu.
      • editObjects

        public ObjectEditPage editObjects()
        Performs a click on the "edit objects" entry of the content menu.
      • editClass

        public ClassEditPage editClass()
        Performs a click on the "edit class" entry of the content menu.
      • sendKeys

        public void sendKeys​(CharSequence... keys)
        Since:
        3.2M3
      • reloadPage

        public BasePage reloadPage()
        Refresh the page and wait for the javascript to be also loaded.
        Since:
        14.1
      • toggleDrawer

        public void toggleDrawer()
        Since:
        7.2M3
      • showDrawer

        public boolean showDrawer()
        Returns:
        true if the drawer used to be hidden
        Since:
        8.4.5, 9.0RC1
      • hideDrawer

        public boolean hideDrawer()
        Returns:
        true if the drawer used to be displayed
        Since:
        8.4.5, 9.0RC1
      • isDrawerVisible

        public boolean isDrawerVisible()
        Since:
        8.4.5, 9.0RC1
      • toggleActionMenu

        public void toggleActionMenu()
        Since:
        7.2M3
      • clickMoreActionsSubMenuEntry

        public void clickMoreActionsSubMenuEntry​(String id)
        Since:
        7.0RC1
      • copy

        public CopyPage copy()
        Since:
        4.5M1
      • deletePage

        public DeletePageConfirmationPage deletePage()
        Specific delete action when the delete action is performed on a page.
        Returns:
        a specialized confirmation page for page deletion
        Since:
        12.8RC1
      • canDelete

        public boolean canDelete()
        Since:
        4.5M1
      • watchDocument

        public void watchDocument()
        Since:
        4.5M1
      • hasLoginLink

        public boolean hasLoginLink()
        Since:
        4.5M1
      • login

        public LoginPage login()
        Since:
        4.5M1
      • getCurrentUser

        public String getCurrentUser()
        Since:
        4.5M1
      • getLocales

        public List<Locale> getLocales()
        Since:
        9.0RC1
      • clickLocale

        public ViewPage clickLocale​(Locale locale)
        Since:
        9.0RC1
      • logout

        public void logout()
        Since:
        4.5M1
      • getDocumentTitle

        public String getDocumentTitle()
        Since:
        4.5M1
      • watchSpace

        public void watchSpace()
        Since:
        4.5M1
      • watchWiki

        public void watchWiki()
        Since:
        6.0M1
      • viewChildren

        public ChildrenViewer viewChildren()
        Opens the viewer that lists the children of the current page.
        Returns:
        the viewer that lists the child pages
        Since:
        7.3RC1
      • hasNotificationsMenu

        public boolean hasNotificationsMenu()
        Says if the notifications menu is present (it is displayed only if it has some content).
        Returns:
        either or not the notifications menu is present
        Since:
        7.4M1
      • toggleNotificationsMenu

        public void toggleNotificationsMenu()
        Open/Close the notifications menu.
        Since:
        7.4M1
      • isNotificationsMenuOpen

        public boolean isNotificationsMenuOpen()
        Returns:
        true if the notifications menu is open
        Since:
        7.4M1
      • getErrorContent

        public String getErrorContent()
        Returns:
        the text of uncaught errors
        Since:
        8.0M1
      • hasLeftPanel

        public boolean hasLeftPanel​(String panelTitle)
        Parameters:
        panelTitle - the panel displayed title
        Returns:
        true if the panel is visible in the left panels or false otherwise
        Since:
        10.6RC1
      • isForbidden

        public boolean isForbidden()
      • useShortcutKeyForEditing

        public EditPage useShortcutKeyForEditing()
        Use keyboard shortcuts to go to edit page.
        Returns:
        a new EditPage
        Since:
        11.9RC1
      • useShortcutKeyForWikiEditing

        public WikiEditPage useShortcutKeyForWikiEditing()
        Use keyboard shortcuts to go to wiki edit page.
        Returns:
        a new WikiEditPage
        Since:
        11.9RC1
      • useShortcutKeyForWysiwygEditing

        public WYSIWYGEditPage useShortcutKeyForWysiwygEditing()
        Use keyboard shortcuts to go to WYSIWYG edit page.
        Returns:
        a new WYSIWYGEditPage
        Since:
        11.9RC1
      • useShortcutKeyForInlineEditing

        public InlinePage useShortcutKeyForInlineEditing()
        Use keyboard shortcuts to go to Inline Form edit page.
        Returns:
        a new InlinePage
        Since:
        11.9RC1
      • useShortcutKeyForRightsEditing

        public BasePage useShortcutKeyForRightsEditing()
        Use keyboard shortcuts to go to rights edit page.
        Returns:
        a new BasePage: it can be actually either a RightsEditPage or an AdministrationPage depending if the page is terminal or not.
        Since:
        11.9RC1
      • useShortcutKeyForObjectEditing

        public ObjectEditPage useShortcutKeyForObjectEditing()
        Use keyboard shortcuts to go to object edit page.
        Returns:
        a new ObjectEditPage
        Since:
        11.9RC1
      • useShortcutKeyForClassEditing

        public ClassEditPage useShortcutKeyForClassEditing()
        Use keyboard shortcuts to go to class edit page.
        Returns:
        a new ClassEditPage
        Since:
        11.9RC1
      • useShortcutKeyForPageDeletion

        public ConfirmationPage useShortcutKeyForPageDeletion()
        Use keyboard shortcuts to go to delete page.
        Returns:
        a new ConfirmationPage
        Since:
        11.9RC1
      • useShortcutKeyForPageRenaming

        public RenamePage useShortcutKeyForPageRenaming()
        Use keyboard shortcuts to go to rename page.
        Returns:
        a new RenamePage
        Since:
        11.9RC1
      • useShortcutKeyForSourceViewer

        public ViewPage useShortcutKeyForSourceViewer()
        Use keyboard shortcuts to go to the source view of a page.
        Returns:
        a new ViewPage
        Since:
        11.9RC1
      • hasRenderingError

        public boolean hasRenderingError()
        Returns:
        true if there's a rendering error on the page (i.e. an element with the class xwikirenderingerror)
        Since:
        13.3RC1