class Page extends Object
The Page type is the basis of the Page Object pattern in Geb.
This implementation is a generic model of every page. Subclasses add methods and content definitions that model specific pages.
This class (or subclasses) should not be instantiated directly.
The following classes are also mixed in to this class:
See the chapter in the Geb manual on pages for more information on writing subclasses.
Type | Name and description |
---|---|
Navigator |
$() |
Navigator |
$(int index) |
Navigator |
$(Range<Integer> range) |
Navigator |
$(String selector) |
Navigator |
$(String selector, int index) |
Navigator |
$(String selector, Range<Integer> range) |
Navigator |
$(Map<String, Object> attributes) |
Navigator |
$(Map<String, Object> attributes, int index) |
Navigator |
$(Map<String, Object> attributes, Range<Integer> range) |
Navigator |
$(Map<String, Object> attributes, String selector) |
Navigator |
$(Map<String, Object> attributes, String selector, int index) |
Navigator |
$(Map<String, Object> attributes, String selector, Range<Integer> range) |
Navigator |
$(Map<String, Object> attributes, By bySelector) |
Navigator |
$(Map<String, Object> attributes, By bySelector, int index) |
Navigator |
$(Map<String, Object> attributes, By bySelector, Range<Integer> range) |
Navigator |
$(By bySelector) |
Navigator |
$(By bySelector, int index) |
Navigator |
$(By bySelector, Range<Integer> range) |
Navigator |
$(Navigator[] navigators) |
Navigator |
$(WebElement[] elements) |
String |
convertToPath(Object[] args) Converts the arguments to a path to be appended to this page's url. |
Navigator |
find() |
Navigator |
find(int index) |
Navigator |
find(Range<Integer> range) |
Navigator |
find(String selector) |
Navigator |
find(String selector, int index) |
Navigator |
find(String selector, Range<Integer> range) |
Navigator |
find(Map<String, Object> attributes) |
Navigator |
find(Map<String, Object> attributes, int index) |
Navigator |
find(Map<String, Object> attributes, Range<Integer> range) |
Navigator |
find(Map<String, Object> attributes, String selector) |
Navigator |
find(Map<String, Object> attributes, String selector, int index) |
Navigator |
find(Map<String, Object> attributes, String selector, Range<Integer> range) |
Navigator |
find(Map<String, Object> attributes, By bySelector) |
Navigator |
find(Map<String, Object> attributes, By bySelector, int index) |
Navigator |
find(Map<String, Object> attributes, By bySelector, Range<Integer> range) |
Navigator |
find(By bySelector) |
Navigator |
find(By bySelector, int index) |
Navigator |
find(By bySelector, Range<Integer> range) |
AtVerificationResult |
getAtVerificationResult(boolean honourGlobalAtCheckWaiting = true) Executes this page's "at checker" and captures the result wrapping up any AssertionError that might have been thrown. |
Browser |
getBrowser() The browser that the page is connected to. |
WebDriver |
getDriver() The driver of the browser that the page is connected to. |
JavascriptInterface |
getJs() Provides access to the browser object's JavaScript interface. |
protected Wait |
getPageLevelAtCheckWaiting() |
String |
getPageUrl() Returns the constant part of the url to this page. |
String |
getPageUrl(String path) Returns the url to this page, with path appended to it. |
String |
getTitle() Returns the title of the current browser window. |
Page |
init(Browser browser) Initialises this page instance, connecting it to the browser. |
T |
module(Class<T> moduleClass) |
T |
module(T module) |
void |
onLoad(Page previousPage) Lifecycle method called when the page is connected to the browser. |
void |
onUnload(Page nextPage) Lifecycle method called when this page is being replaced as the browser's page instance. |
void |
to(Map params, Object[] args) Sends the browser to this page's url. |
String |
toString() Returns the name of this class. |
GebException |
uninitializedException() |
boolean |
verifyAt() Checks if the browser is not at an unexpected page and then executes this page's "at checker". |
boolean |
verifyAtSafely(boolean honourGlobalAtCheckWaiting = true) Executes this page's "at checker", suppressing any AssertionError that is thrown and returning false. |
T |
waitFor(Map params = [:], String waitPreset, Closure<T> block) |
T |
waitFor(Map params = [:], Closure<T> block) |
T |
waitFor(Map params = [:], Double timeout, Closure<T> block) |
T |
waitFor(Map params = [:], Double timeout, Double interval, Closure<T> block) |
The "at checker" for this page.
Subclasses should define a closure here that verifies that the browser is at this page.
This implementation does not have an at checker (i.e. this property is null
)
The wait time configuration for 'at' checking specific to this page.
Subclasses can specify atCheckWaiting value, value specified in page takes priority over the global atCheckWaiting setting.
Possible values for the atCheckWaiting option are consistent with the ones for wait option of content definitions.
This implementation does not have any value for atCheckWaiting (i.e. this property is null
).
Defines the url for this page to be used when navigating directly to this page.
Subclasses can specify either an absolute url, or one relative to the browser's base url.
This implementation returns an empty string.
Converts the arguments to a path to be appended to this page's url.
This is called by the to(java.util.Map, java.lang.Object) method and can be used for accessing variants of the page.
This implementation returns the string value of each argument, separated by "/"
Executes this page's "at checker" and captures the result wrapping up any AssertionError that might have been thrown.
The browser that the page is connected to.
The driver of the browser that the page is connected to.
Provides access to the browser object's JavaScript interface.
Returns the constant part of the url to this page.
This implementation returns the static url property of the class.
Returns the url to this page, with path appended to it.
Returns the title of the current browser window.
Initialises this page instance, connecting it to the browser.
This method is called internally, and should not be called by users of Geb.
Lifecycle method called when the page is connected to the browser.
This implementation does nothing.
previousPage
- The page that was active before this oneLifecycle method called when this page is being replaced as the browser's page instance.
This implementation does nothing.
nextPage
- The page that will be active after this oneSends the browser to this page's url.
params
- request parameters to be appended to the urlargs
- "things" that can be used to generate an extra path to append to this page's urlReturns the name of this class.
Checks if the browser is not at an unexpected page and then executes this page's "at checker".
Executes this page's "at checker", suppressing any AssertionError that is thrown and returning false.
Groovy API Documentation for Geb 0.13.0 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org