|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectgeb.Page
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.
Property Summary | |
---|---|
static def |
at
The "at checker" for this page. |
static def |
url
Defines the url for this page to be used when navigating directly to this page. |
Method Summary | |
---|---|
String
|
convertToPath(Object[] args)
Converts the arguments to a path to be appended to this page's url. |
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. |
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. |
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 simple name of this class. |
boolean
|
verifyAt()
Executes this page's "at checker". |
boolean
|
verifyAtSafely()
Executes this page's "at checker", suppressing any AssertionError that is thrown and returning false. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Property Detail |
---|
static def at
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)
static def url
Subclasses can specify either an absolute url, or one relative to the browser's base url.
This implementation returns an empty string.
Method Detail |
---|
String convertToPath(Object[] args)
This is called by the to(Map,Object[]) method and can be used for accessing variants of the page.
This implementation returns the string value of each argument, separated by "/"
Browser getBrowser()
WebDriver getDriver()
JavascriptInterface getJs()
String getPageUrl()
This implementation returns the static url property of the class.
String getPageUrl(String path)
String getTitle()
Page init(Browser browser)
This method is called internally, and should not be called by users of Geb.
void onLoad(Page previousPage)
This implementation does nothing.
previousPage
- The page that was active before this one
void onUnload(Page nextPage)
This implementation does nothing.
nextPage
- The page that will be active after this one
void to(Map params, Object[] args)
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 url
String toString()
boolean verifyAt()
boolean verifyAtSafely()
Groovy API Documentation for geb-core 0.6.2 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org