Class BasePage

    • Constructor Summary

      Constructors 
      Constructor Description
      BasePage​(java.lang.String pagePath)  
      BasePage​(java.net.URI base, java.lang.String pagePath)
      Register the page's path.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEditedPath()  
      java.lang.String getPath()  
      java.lang.String getUrl()  
      boolean isOpen()
      Check if the URL of the page is the same (context path insensitive).
      <T extends BasePage>
      T
      open()
      Open this page in the browser.
      <T extends BasePage>
      T
      open​(java.lang.String pagePath)
      Open page with the provided path in the current window.
      BasePage openInNewWindow​(java.lang.String pagePath)
      Open page with the provided path in a new window.
      void refresh()
      Reload the current page in the browser.
      void waitForMessage​(java.lang.String message)  
      void waitMasked()
      Wait that the foundation UI mask exist.
      void waitReady()
      Wait that the page is ready (according to coral).
      void waitUnmasked()
      Wait that the foundation UI mask doesn't exist.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasePage

        public BasePage​(java.net.URI base,
                        java.lang.String pagePath)
        Register the page's path.
        Parameters:
        base - baseURI to work with.
        pagePath - absolute path. URI without the first forward slash.
      • BasePage

        public BasePage​(java.lang.String pagePath)
        Parameters:
        pagePath - relative path from current opened site.
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Returns:
        path for this page.
      • getEditedPath

        public java.lang.String getEditedPath()
        Returns:
        the currently edited path, extracted from the .foundation-content-path element data attribute.
      • getUrl

        public java.lang.String getUrl()
        Returns:
        fully qualified url for the current path.
      • open

        public <T extends BasePage> T open​(@Nonnull
                                           java.lang.String pagePath)
        Open page with the provided path in the current window.
        Type Parameters:
        T - concrete implementation type
        Parameters:
        pagePath - The path to open without trailing
        Returns:
        this object
      • open

        public <T extends BasePage> T open()
        Open this page in the browser.
        Type Parameters:
        T - concrete implementation type
        Returns:
        this object.
      • openInNewWindow

        public BasePage openInNewWindow​(java.lang.String pagePath)
        Open page with the provided path in a new window.
        Parameters:
        pagePath - The path to open without trailing /
        Returns:
        this object.
      • refresh

        public void refresh()
        Reload the current page in the browser.
      • waitReady

        public void waitReady()
        Wait that the page is ready (according to coral).
      • waitMasked

        public void waitMasked()
        Wait that the foundation UI mask exist.
      • waitUnmasked

        public void waitUnmasked()
        Wait that the foundation UI mask doesn't exist.
      • isOpen

        public boolean isOpen()
        Check if the URL of the page is the same (context path insensitive). This is limited but we don't have a more programmatically solution in place.
        Returns:
        true if sites is open.
      • waitForMessage

        public void waitForMessage​(java.lang.String message)
        Parameters:
        message - a message that is expected to be displayed for a short time (toast).