Interface CapybaraPortingLayer
-
- All Known Subinterfaces:
BuildStep
,PageArea
,PostBuildStep
,Step
- All Known Implementing Classes:
AbstractCredentialsTest
,AbstractDashboardViewPortlet
,AbstractJUnitTest
,AbstractListViewColumn
,AbstractPipelineTest
,AbstractStep
,Action
,ActiveDirectorySecurityRealm
,AggregateDownstreamTestResults
,AntBuildStep
,AntInstallation
,Artifact
,ArtifactArchiver
,ArtifactManagement
,ArtifactManagement.Factory
,ArtifactoryGlobalConfig
,ArtifactoryGlobalConfig.Server
,ArtifactoryGradleConfiguratior
,ArtifactoryPublisher
,AuditTrailGlobalConfiguration
,AuditTrailLogger
,AuthorizationStrategy
,Axis
,BaseStandardCredentials
,BatchCommandBuildStep
,BranchSource
,BreadCrumbs
,Build
,BuildAccessControl
,BuildDescriptionSetter
,BuildExecutorStatus
,BuildHistory
,BuildParameters
,BuildStatisticsPortlet
,BuildTimeout
,BuildTrigger
,BuildTriggerConfig
,BuildWithParameters
,BuildWrapper
,CapybaraPortingLayerImpl
,Changes
,Cloud
,CoberturaAction
,CoberturaPublisher
,CodeMirror
,ColumnsArea
,CommandSlaveLauncher
,CompressingArtifactManager
,ComputerConnector
,ComputerLauncher
,ConfigFileProvider
,ConfigurablePageObject
,ContainerPageObject
,Control
,CopyArchivedArtifactsBuildStep
,CopyArtifactBuildStep
,Credential
,CredentialsBinding
,CredentialsPage
,CustomConfig
,DashboardPortlets
,DashboardView
,DeployPublisher
,DiskUsage
,DiskUsageGlobalConfig
,DockerBuildStep
,DockerCommand
,DockerCommand.CreateContainer
,DockerCommand.CreateImage
,DockerCommand.RemoveContainers
,DockerCommand.StartContainers
,Domain
,DomainPage
,DumbSlave
,EmailExtPublisher
,EnvInjectAction
,EnvInjectConfig
,EnvInjectConfig.Environment
,EnvInjectConfig.Property
,EnvInjectStep
,ExternalGlobalConfig
,ExternalNodeConfig
,FileBuildParameters
,FileCredentials
,Fingerprint
,Folder
,FreeStyleJob
,FreeStyleMultiBranchJob
,GerritTriggerJob
,GerritTriggerNewServer
,GerritTriggerServer
,GitblitScm
,GitBranchSource
,GithubBranchSource
,GitLabBranchSource
,GitLabOrganizationFolder
,GitLabPersonalAccessTokenCredential
,GitLabScm
,GitLabServerConfig
,GitScm
,GitScm.AdvancedCheckout
,GitScm.AdvancedClone
,GitScm.Behaviour
,GitScm.CalculateChangelog
,GitScm.CheckoutToLocalBranch
,GitScm.CheckoutToLocalDir
,GitScm.CleanAfterCheckout
,GitScm.CleanBeforeCheckout
,GitScm.CommitAuthorInChangelog
,GitScm.CreateTagForBuild
,GitScm.CustomNameAndMail
,GitScm.CustomSCMName
,GitScm.ForcePollingUsingWorkspace
,GitScm.GitLfsPull
,GitScm.MergeBeforeBuild
,GitScm.NoBuildOnCommit
,GitScm.PollingIgnoresMessage
,GitScm.PollingIgnoresPath
,GitScm.PollingIgnoresUser
,GitScm.PruneStableRemoteBranches
,GitScm.RecursiveSubmodules
,GitScm.SparseCheckoutPaths
,GitScm.StrategyToChooseBuild
,GitScm.WipeAndForceClone
,GlobalConfig
,GlobalDockerConfig
,GlobalPluginConfiguration
,GlobalSecurityConfig
,GlobalToolConfig
,GradleInstallation
,GradleStep
,GroovyInstallation
,GroovyPostBuildStep
,GroovyStep
,HtmlPublisher
,HtmlPublisher.Report
,HtmlReport
,JabberGlobalConfig
,JabberGlobalConfig.AdvancedConfig
,JabberGlobalConfig.EnabledConfig
,JabberGlobalConfig.MUCConfig
,JabberPublisher
,JabberPublisher.Publishers
,JacocoPublisher
,JacocoResultPage
,JavadocPublisher
,JcascManage
,JdkInstallation
,Jenkins
,JenkinsConfig
,JenkinsDatabaseSecurityRealm
,JenkinsDatabaseSecurityRealm.Signup
,JenkinsLogger
,JGitInstallation
,JiraGlobalConfig
,JiraUpdater
,Job
,JobConfigHistory
,JobConfigHistory.Change
,JobDslBuildStep
,JobFiltersArea
,JobsGridPortlet
,JobsMixIn
,JUnitPublisher
,LabelAxis
,LabelExpressionAxis
,LabelParameter
,LastConsoleColumn
,LatestBuildsPortlet
,LdapGroupMembershipStrategy
,LdapSecurityRealm
,LdapSecurityRealm_Pre1_10
,ListView
,LocalSlaveController
,LoggedInAuthorizationStrategy
,Login
,Logout
,LogParserGlobalConfig
,LogParserOutputPage
,LogParserPublisher
,Mailer
,MailerGlobalConfig
,MainArea
,MainPanel
,ManagedCredentials
,ManagedCredentialsBinding
,MatrixAuthorizationStrategy
,MatrixBuild
,MatrixConfiguration
,MatrixProject
,MatrixReloadedAction
,MatrixRow
,MatrixRun
,MavenBuild
,MavenBuildStep
,MavenInstallation
,MavenModule
,MavenModuleBuild
,MavenModuleSet
,MavenProjectConfig
,MavenSettingsConfig
,MixIn
,MockSecurityRealm
,MSBuildInstallation
,MSBuildStep
,MSTestRunnerBuildStep
,NestedView
,Node
,NodeParameter
,OnlineStatusNotification
,PageAreaImpl
,PageObject
,Parameter
,ParameterizedTrigger
,ParseUserAttributeLdapGroupMembershipStrategy
,PasswordParameter
,PendingScript
,PendingSignature
,PhabricatorScm
,Plugin
,PluginManager
,PostBuildScript
,PriorityConfig
,PriorityConfig.Group
,ProjectBasedMatrixAuthorizationStrategy
,ProjectDefaultBuildAccessControl
,ProjectDescriptionSetter
,ProjectMatrixProperty
,ProjectStatusStdJobList
,ProvidedFile
,Rvm
,Scm
,ScmPolling
,Script
,ScriptApproval
,Scriptler
,SearchForGroupsLdapGroupMembershipStrategy
,SecretFileCredentialsBinding
,SecretStringCredentialsBinding
,SecurityDisabler
,SecurityRealm
,ServerCredentialMapping
,ServletSecurityRealm
,ShellBuildStep
,Slave
,SlaveController
,SlavesMixIn
,SshCredentialDialog
,SshPrivateKeyCredential
,SshPrivateKeyCredential.Direct
,SshSlaveConnector
,SshSlaveLauncher
,StageView
,StringCredentials
,StringParameter
,SubversionScm
,SubversionSvmAdvanced
,SvnRepositoryBrowser
,SvnRepositoryBrowserWebSvn
,SystemGroovyStep
,TestStatisticsChartPortlet
,TextAxis
,TextFinderPublisher
,TextParameter
,TimerTrigger
,TimstamperGlobalConfig
,ToolInstallation
,TopLevelItem
,Trigger
,TriggerCallBuildStep
,TriggerConfig
,UnstableJobsPortlet
,UpdateCenter
,UpstreamJobTrigger
,User
,UserPwdCredential
,View
,ViewgitScm
,ViewsMixIn
,WizardCreateAdminUser
,WizardCustomizeJenkins
,WizardLogin
,WorkflowGithubSharedLibrary
,WorkflowJob
,WorkflowMultiBranchJob
,WorkflowSharedLibrary
,WorkflowSharedLibraryGlobalConfig
,Workspace
,WsCleanup
,WsCleanup.PostBuild
,WsCleanup.PreBuild
,XUnitPublisher
,XUnitPublisher.Tool
,XvncGlobalJobConfig
,XvncJobConfig
public interface CapybaraPortingLayer
Interface for assisting porting from Capybara.- Author:
- christian.fritz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description List<org.openqa.selenium.WebElement>
all(org.openqa.selenium.By selector)
Finds all the elements that match the selector.void
blur(org.openqa.selenium.WebElement e)
Sends a blur event to the provided elementvoid
check(String locator)
Checks the specified checkbox.void
check(org.openqa.selenium.WebElement e)
Checks the checkbox.void
check(org.openqa.selenium.WebElement e, boolean state)
Sets the state of the checkbox to the specified value.org.openqa.selenium.WebElement
choose(String locator)
Select radio button by its name, id, or label text.void
clickButton(String text)
void
clickLink(String locator)
void
confirmAlert(int timeout)
Deprecated.UserunThenConfirmAlert(Runnable, int)
and provide the runnable that triggers the alert.Object
executeScript(String javaScript, Object... args)
Executes JavaScript.void
fillIn(String formFieldName, Object value)
org.openqa.selenium.WebElement
find(org.openqa.selenium.By selector)
Returns the first visible element that matches the selector.org.openqa.selenium.WebElement
findIfNotVisible(org.openqa.selenium.By selector)
Returns the first element that matches the selector even if not visible.org.openqa.selenium.WebElement
getElement(org.openqa.selenium.By selector)
Works likefind(org.openqa.selenium.By)
but instead of throwing an exception, this method returns null.String
getPageSource()
Get all text of the page including markup.org.openqa.selenium.WebElement
last(org.openqa.selenium.By selector)
Picks up the last visible element that matches given selector.org.openqa.selenium.WebElement
lastIfNotVisible(org.openqa.selenium.By selector)
Picks up the last visible element that matches given selector.void
runThenConfirmAlert(Runnable runnable, int timeout)
Do something that triggers an alert then giving it some time to appearWait<CapybaraPortingLayer>
waitFor()
org.openqa.selenium.WebElement
waitFor(org.openqa.selenium.By selector)
Wait until the element that matches the given selector appears.org.openqa.selenium.WebElement
waitFor(org.openqa.selenium.By selector, int timeoutSec)
Wait until the element that matches the given selector appears.<MatcherT,SubjectT extends MatcherT>
voidwaitFor(SubjectT item, org.hamcrest.Matcher<MatcherT> matcher, int timeoutSec)
Wait until a matcher matches.<T> Wait<T>
waitFor(T subject)
<T> T
waitForCond(Callable<T> block)
Deprecated.<T> T
waitForCond(Callable<T> block, int timeoutSec)
Deprecated.
-
-
-
Field Detail
-
by
static final ByFactory by
-
-
Method Detail
-
clickButton
void clickButton(String text)
-
choose
org.openqa.selenium.WebElement choose(String locator)
Select radio button by its name, id, or label text.
-
waitFor
<T> Wait<T> waitFor(T subject)
-
waitFor
Wait<CapybaraPortingLayer> waitFor()
-
waitFor
org.openqa.selenium.WebElement waitFor(org.openqa.selenium.By selector, int timeoutSec)
Wait until the element that matches the given selector appears.
-
waitFor
org.openqa.selenium.WebElement waitFor(org.openqa.selenium.By selector)
Wait until the element that matches the given selector appears.
-
waitForCond
@Deprecated <T> T waitForCond(Callable<T> block, int timeoutSec)
Deprecated.Repeated evaluate the given predicate until it returns true.If it times out, an exception will be thrown.
- Parameters:
timeoutSec
- 0 if left to the default value
-
waitForCond
@Deprecated <T> T waitForCond(Callable<T> block)
Deprecated.
-
waitFor
<MatcherT,SubjectT extends MatcherT> void waitFor(SubjectT item, org.hamcrest.Matcher<MatcherT> matcher, int timeoutSec)
Wait until a matcher matches.
-
find
org.openqa.selenium.WebElement find(org.openqa.selenium.By selector)
Returns the first visible element that matches the selector.- Throws:
org.openqa.selenium.NoSuchElementException
- if the element is not found.- See Also:
if you don't want to see an exception
-
findIfNotVisible
org.openqa.selenium.WebElement findIfNotVisible(org.openqa.selenium.By selector)
Returns the first element that matches the selector even if not visible.- Throws:
org.openqa.selenium.NoSuchElementException
- if the element is not found.- See Also:
if you don't want to see an exception
-
getElement
org.openqa.selenium.WebElement getElement(org.openqa.selenium.By selector)
Works likefind(org.openqa.selenium.By)
but instead of throwing an exception, this method returns null.
-
check
void check(org.openqa.selenium.WebElement e)
Checks the checkbox.
-
check
void check(org.openqa.selenium.WebElement e, boolean state)
Sets the state of the checkbox to the specified value.
-
blur
void blur(org.openqa.selenium.WebElement e)
Sends a blur event to the provided element
-
all
List<org.openqa.selenium.WebElement> all(org.openqa.selenium.By selector)
Finds all the elements that match the selector.Note that this method inherits the same restriction of the
WebDriver.findElements(org.openqa.selenium.By)
, in that its execution is not synchronized with the JavaScript execution of the browser.For example, if you click something that's expected to populate additional DOM elements, and then call
all()
to find them, then all() can execute before those additional DOM elements are populated, thereby failing to find the elements you are looking for.In contrast,
find(org.openqa.selenium.By)
do not have this problem, because it waits until the element that matches the criteria appears.So if you are using this method, think carefully. Perhaps you can use
find(org.openqa.selenium.By)
to achieve what you are looking for (by making the query more specific), or perhaps you can combine this withwaitForCond(java.util.concurrent.Callable)
so that if you don't find the elements you are looking for in the list, you'll retry.
-
last
org.openqa.selenium.WebElement last(org.openqa.selenium.By selector)
Picks up the last visible element that matches given selector.
-
lastIfNotVisible
org.openqa.selenium.WebElement lastIfNotVisible(org.openqa.selenium.By selector)
Picks up the last visible element that matches given selector.
-
clickLink
void clickLink(String locator)
- Parameters:
locator
- Text, ID, or link.
-
check
void check(String locator)
Checks the specified checkbox.
-
confirmAlert
@Deprecated void confirmAlert(int timeout)
Deprecated.UserunThenConfirmAlert(Runnable, int)
and provide the runnable that triggers the alert.Confirms an alert giving it some time to appear- Parameters:
timeout
- Maximum time to wait for the alert to appear, in seconds
-
runThenConfirmAlert
void runThenConfirmAlert(Runnable runnable, int timeout)
Do something that triggers an alert then giving it some time to appear- Parameters:
runnable
- Something that will trigger the alerttimeout
- Maximum time to wait for the alert to appear, in seconds
-
getPageSource
String getPageSource()
Get all text of the page including markup.
-
-