Package org.jenkinsci.test.acceptance.po
Class ConfigurablePageObject
- java.lang.Object
-
- org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
-
- org.jenkinsci.test.acceptance.po.PageObject
-
- org.jenkinsci.test.acceptance.po.ConfigurablePageObject
-
- All Implemented Interfaces:
CapybaraPortingLayer
- Direct Known Subclasses:
ContainerPageObject
,CredentialsPage
,DomainPage
,JenkinsConfig
public abstract class ConfigurablePageObject extends PageObject
PageObject
that can be configured and saved.There are 2 uses of this: -
ContainerPageObject
, PO that has /configure page associated - PO that is itself a config page, such as /configureSecurity- Author:
- ogondza.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
CapybaraPortingLayerImpl.Finder<R>, CapybaraPortingLayerImpl.Resolver
-
-
Field Summary
-
Fields inherited from class org.jenkinsci.test.acceptance.po.PageObject
jsonParser, url
-
Fields inherited from class org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
driver, injector, LABEL_TO_INPUT_XPATH, time
-
Fields inherited from interface org.jenkinsci.test.acceptance.po.CapybaraPortingLayer
by
-
-
Constructor Summary
Constructors Modifier Constructor Description ConfigurablePageObject(com.google.inject.Injector injector, URL url)
protected
ConfigurablePageObject(PageObject context, URL url)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
apply()
void
configure()
Open configuration page if not yet opened.void
configure(groovy.lang.Closure body)
Edits this configurable page object using the specified closure.void
configure(Runnable body)
Edits this configurable page object using the specified configuration lambda.<T> T
configure(Callable<T> body)
Edits this configurable page object using the specified callable.void
ensureConfigPage()
Makes sure that the browser is currently opening the configuration page.abstract URL
getConfigUrl()
String
getFormName()
String
getSubmitButtonText()
void
save()
-
Methods inherited from class org.jenkinsci.test.acceptance.po.PageObject
control, control, createPageArea, createRandomName, getContext, getJenkins, open, toString, url, url, visit
-
Methods inherited from class org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
all, blur, check, check, check, choose, clickButton, clickLink, confirmAlert, elasticSleep, executeScript, fillIn, find, findCaption, findCaption, findIfNotVisible, getCurrentUrl, getCurrentUrlWithFragment, getElement, getPageContent, getPageSource, getPageSource, getPath, handleAlert, isStale, last, lastIfNotVisible, newInstance, resource, runThenConfirmAlert, runThenConfirmAlert, runThenHandleAlert, runThenHandleAlert, sleep, visit, waitFor, waitFor, waitFor, waitFor, waitFor, waitForCond, waitForCond
-
-
-
-
Constructor Detail
-
ConfigurablePageObject
protected ConfigurablePageObject(PageObject context, URL url)
-
ConfigurablePageObject
public ConfigurablePageObject(com.google.inject.Injector injector, URL url)
-
-
Method Detail
-
configure
public void configure(Runnable body)
Edits this configurable page object using the specified configuration lambda. Opens the configuration view, runs the specified body and saves the changes.- Parameters:
body
- the additional configuration options for this page object
-
configure
public void configure(groovy.lang.Closure body)
Edits this configurable page object using the specified closure. Opens the configuration view, runs the specified body and saves the changes.- Parameters:
body
- the additional configuration options for this page object
-
configure
public <T> T configure(Callable<T> body)
Edits this configurable page object using the specified callable. Opens the configuration view, runs the specified body and saves the changes.- Parameters:
body
- the additional configuration options for this page object- Returns:
- return value of the body
-
configure
public void configure()
Open configuration page if not yet opened.- See Also:
getConfigUrl()
-
getFormName
public String getFormName()
-
getSubmitButtonText
public String getSubmitButtonText()
-
ensureConfigPage
public void ensureConfigPage()
Makes sure that the browser is currently opening the configuration page.
-
getConfigUrl
public abstract URL getConfigUrl()
-
save
public void save()
-
apply
public void apply()
-
-