Class BasePage
- java.lang.Object
-
- com.adobe.cq.testing.selenium.pageobject.granite.BasePage
-
- Direct Known Subclasses:
EditorPage,LoginPage,PropertiesPage,ShellPage
public class BasePage extends java.lang.ObjectBase page class for inheritance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEditedPath()java.lang.StringgetPath()java.lang.StringgetUrl()booleanisOpen()Check if the URL of the page is the same (context path insensitive).<T extends BasePage>
Topen()Open this page in the browser.<T extends BasePage>
Topen(java.lang.String pagePath)Open page with the provided path in the current window.BasePageopenInNewWindow(java.lang.String pagePath)Open page with the provided path in a new window.voidrefresh()Reload the current page in the browser.voidwaitForMessage(java.lang.String message)voidwaitMasked()Wait that the foundation UI mask exist.voidwaitReady()Wait that the page is ready (according to coral).voidwaitUnmasked()Wait that the foundation UI mask doesn't exist.
-
-
-
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).
-
-