Class PageAreaImpl
- java.lang.Object
-
- org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
-
- org.jenkinsci.test.acceptance.po.PageAreaImpl
-
- All Implemented Interfaces:
CapybaraPortingLayer
,Control.Owner
,PageArea
- Direct Known Subclasses:
AbstractDashboardViewPortlet
,AbstractListViewColumn
,AbstractStep
,ArtifactManagement
,ArtifactManagement.Factory
,ArtifactoryGlobalConfig
,ArtifactoryGlobalConfig.Server
,ArtifactoryGradleConfiguratior
,AuditTrailGlobalConfiguration
,AuthorizationStrategy
,Axis
,BranchSource
,BreadCrumbs
,BuildAccessControl
,BuildExecutorStatus
,BuildParameters
,BuildTimeout
,BuildTriggerConfig
,BuildWrapper
,Cloud
,CodeMirror
,ColumnsArea
,ComputerConnector
,ComputerLauncher
,Credential
,CredentialsBinding
,DashboardPortlets
,DiskUsageGlobalConfig
,DockerCommand
,Domain
,EnvInjectConfig
,ExternalGlobalConfig
,ExternalNodeConfig
,GitScm.Behaviour
,GlobalConfig
,GlobalDockerConfig
,GlobalPluginConfiguration
,HtmlPublisher.Report
,JabberGlobalConfig
,JabberGlobalConfig.AdvancedConfig
,JabberGlobalConfig.EnabledConfig
,JabberGlobalConfig.MUCConfig
,JabberPublisher.Publishers
,JiraGlobalConfig
,JobFiltersArea
,LdapGroupMembershipStrategy
,LogParserGlobalConfig
,MailerGlobalConfig
,MainArea
,MainPanel
,MatrixRow
,MavenProjectConfig
,OnlineStatusNotification
,Parameter
,PriorityConfig.Group
,ProjectMatrixProperty
,ProjectStatusStdJobList
,Scm
,ScmPolling
,SecurityRealm
,ServerCredentialMapping
,SshCredentialDialog
,SshPrivateKeyCredential.Direct
,StageView
,TimstamperGlobalConfig
,ToolInstallation
,Trigger
,TriggerConfig
,WorkflowSharedLibrary
,WorkflowSharedLibraryGlobalConfig
,WsCleanup
,XUnitPublisher.Tool
,XvncGlobalJobConfig
,XvncJobConfig
public abstract class PageAreaImpl extends CapybaraPortingLayerImpl implements PageArea
Special kind of page object that maps to a portion of a page with multiple INPUT controls.Typically we use this to map a set of controls in the configuration page, which is generated by composing various config.jelly files from different extension points.
- Author:
- Oliver Gondza
-
-
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.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 protected
PageAreaImpl(PageArea area, String path)
protected
PageAreaImpl(PageObject context, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Control
control(String... relativePaths)
Create a control object that wraps access to the specific INPUT element in this page area.Control
control(org.openqa.selenium.By selector)
String
createPageArea(String name, Runnable action)
Capture path attribute of newly created form chunk upon invoking action.PageObject
getPage()
String
getPath()
String
getPath(String rel)
String
getPath(String rel, int index)
org.openqa.selenium.By
path(String rel)
Returns the "path" selector that finds an element by following the form-element-path plugin.org.openqa.selenium.WebElement
self()
ReturnsWebElement
that corresponds to the element that sits at the root of the area this object represents.-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jenkinsci.test.acceptance.po.CapybaraPortingLayer
all, blur, check, check, check, choose, clickButton, clickLink, confirmAlert, executeScript, fillIn, find, findIfNotVisible, getElement, getPageSource, last, lastIfNotVisible, runThenConfirmAlert, waitFor, waitFor, waitFor, waitFor, waitFor, waitForCond, waitForCond
-
-
-
-
Constructor Detail
-
PageAreaImpl
protected PageAreaImpl(PageObject context, String path)
- Parameters:
context
- Parent page object area is scoped to.path
- Absolute path to the area.
-
-
Method Detail
-
self
public org.openqa.selenium.WebElement self()
Description copied from interface:PageArea
ReturnsWebElement
that corresponds to the element that sits at the root of the area this object represents.
-
getPage
public PageObject getPage()
-
path
public org.openqa.selenium.By path(String rel)
Returns the "path" selector that finds an element by following the form-element-path plugin.- Specified by:
path
in interfaceControl.Owner
- Specified by:
path
in interfacePageArea
-
control
public Control control(String... relativePaths)
Create a control object that wraps access to the specific INPUT element in this page area.The
Control
object itself can be created early as the actual element resolution happens lazily. This meansPageArea
implementations can put these in their fields.Several paths can be provided to find the first matching element. Useful when element path changed between versions.
-
control
public Control control(org.openqa.selenium.By selector)
-
createPageArea
@NonNull public String createPageArea(String name, Runnable action) throws org.openqa.selenium.TimeoutException
Description copied from interface:PageArea
Capture path attribute of newly created form chunk upon invoking action.Consider "Add" button in page area with path "/foo" that is supposed to create new page area with path "/foo/bar" or "/foo/bar[n]". There are several problems with the straightforward approach: - Created area may or may not be the first one of its kind so figuring the "path" is nontrivial. - The area may can take a while to render so waiting is needed. - Even after the markup appears, it can take a while for "path" attribute is added.
This method properly wait until the new path is known. To be used as:
String barPath = fooArea.createPageArea("bar", () -> control("add-button").click()); new FooBarArea(fooArea, barPath);
- Specified by:
createPageArea
in interfacePageArea
- Parameters:
name
- Name of the surrounding div which will the next segment in path. Given the area is "/builder" and we are about to construct /builder/shell[3], the relative prefix is "shell".action
- An action that triggers the page area creation. Clicking the button, etc.- Returns:
- The surrounding path of the area, exception thrown when not able to find out.
- Throws:
org.openqa.selenium.TimeoutException
-
-