Class JobDslBuildStep
- java.lang.Object
-
- org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
-
- org.jenkinsci.test.acceptance.po.PageAreaImpl
-
- org.jenkinsci.test.acceptance.po.AbstractStep
-
- org.jenkinsci.test.acceptance.plugins.job_dsl.JobDslBuildStep
-
- All Implemented Interfaces:
BuildStep
,CapybaraPortingLayer
,Control.Owner
,PageArea
,Step
public class JobDslBuildStep extends AbstractStep implements BuildStep
Encapsulates the PageArea of the Job DSL plugin.- Author:
- Maximilian Oeckler
-
-
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.AbstractStep
parent
-
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 Constructor Description JobDslBuildStep(Job parent, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickLookOnFilesystem()
Click the radiobutton lookOnFilesystem.void
clickUseScriptText()
Click the radiobutton useScriptText.String[]
getAdditionalClasspath()
Get the additional classpath entries for the Job DSL scripts.JobDslLookupStrategy
getLookupStrategy()
Determines the context to use for relative job names.JobDslRemovedConfigFilesAction
getRemovedConfigFilesAction()
Determines what to do when a previously generated config file is not referenced anymore.JobDslRemovedJobAction
getRemovedJobAction()
Determines what to do when a previously generated job is not referenced anymore.JobDslRemovedViewAction
getRemovedViewAction()
Determines what to do when a previously generated view is not referenced anymore.String
getScript()
Get the DSL script.String[]
getScriptTargetsOnFilesystem()
Get the DSL scripts, that are located in the workspace.boolean
isFailOnMissingPlugin()
Determines if the build will be marked as failed when a plugin must be installed or updated to support all features used in the DSL scripts.boolean
isIgnoreExisting()
Determines if previously generated jobs or views will be ignored.boolean
isIgnoreMissingFiles()
Determines if missing DSL scripts will be ignored.boolean
isIgnoreMissingFilesShown()
Determines whether checkbox ignoreMissingFiles exists on the current page.boolean
isLookOnFilesystem()
Determines whether to look on filesystem for DSL scripts.boolean
isUnstableOnDeprecation()
Determines if the build will be marked as unstable when using deprecated features.boolean
isUseSandbox()
Determines if the DSL scripts run in a sandbox with limited abilities.boolean
isUseScriptText()
Determines if the provided DSL script should be used.void
setAdditionalClasspath(String... classpaths)
Newline separated list of additional classpath entries for the Job DSL scripts.void
setFailOnMissingPlugin(boolean fail)
Decides if the build will be marked as failed when a plugin must be installed or updated to support all features used in the DSL scripts.void
setIgnoreExisting(boolean ignore)
Decides if previously generated jobs or views will be ignored.void
setIgnoreMissingFiles(boolean ignore)
Decides if missing DSL scripts will be ignored.void
setLookupStrategy(JobDslLookupStrategy strategy)
Set the context to use for relative job names.void
setRemovedConfigFilesAction(JobDslRemovedConfigFilesAction action)
Set what to do when a previously generated config file is not referenced anymore.void
setRemovedJobAction(JobDslRemovedJobAction action)
Set what to do when a previously generated job is not referenced anymore.void
setRemovedViewAction(JobDslRemovedViewAction action)
Set what to do when a previously generated view is not referenced anymore.void
setScript(String dslScript)
Set the DSL script.void
setScriptTargetsOnFilesystem(String... targets)
Add a newline separated list of DSL scripts.void
setUnstableOnDeprecation(boolean unstable)
Decides if the build will be marked as unstable when using deprecated features.void
setUseSandbox(boolean use)
Decides if the DSL scripts run in a sandbox with limited abilities.-
Methods inherited from class org.jenkinsci.test.acceptance.po.PageAreaImpl
control, control, createPageArea, getPage, getPath, getPath, getPath, path, self
-
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, isHiddenOrStale, isStale, last, lastIfNotVisible, newInstance, resource, runThenConfirmAlert, runThenConfirmAlert, runThenHandleAlert, runThenHandleAlert, runThenHandleDialog, 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
-
-
-
-
Method Detail
-
setScript
public void setScript(String dslScript)
Set the DSL script.- Parameters:
dslScript
- DSL Script, which is groovy code.
-
getScript
public String getScript()
Get the DSL script.- Returns:
- the DSL script.
-
setScriptTargetsOnFilesystem
public void setScriptTargetsOnFilesystem(String... targets)
Add a newline separated list of DSL scripts.- Parameters:
targets
- The DSL scripts, located in the Workspace.
-
getScriptTargetsOnFilesystem
public String[] getScriptTargetsOnFilesystem()
Get the DSL scripts, that are located in the workspace.- Returns:
- an array of DSL scripts.
-
clickUseScriptText
public void clickUseScriptText()
Click the radiobutton useScriptText.
-
isUseScriptText
public boolean isUseScriptText()
Determines if the provided DSL script should be used.- Returns:
- TRUE if radiobutton useScriptText is selected
-
clickLookOnFilesystem
public void clickLookOnFilesystem()
Click the radiobutton lookOnFilesystem.
-
isLookOnFilesystem
public boolean isLookOnFilesystem()
Determines whether to look on filesystem for DSL scripts.- Returns:
- TRUE if radiobutton lookOnFilesystem is selected
-
setIgnoreMissingFiles
public void setIgnoreMissingFiles(boolean ignore)
Decides if missing DSL scripts will be ignored.- Parameters:
ignore
- build not fail if true
-
isIgnoreMissingFiles
public boolean isIgnoreMissingFiles()
Determines if missing DSL scripts will be ignored.- Returns:
- TRUE if checkbox ignoreMissingFiles is selected
-
isIgnoreMissingFilesShown
public boolean isIgnoreMissingFilesShown()
Determines whether checkbox ignoreMissingFiles exists on the current page.- Returns:
- TRUE if it exists
-
setUseSandbox
public void setUseSandbox(boolean use)
Decides if the DSL scripts run in a sandbox with limited abilities.- Parameters:
use
- Run DSL scripts in a sandbox if true
-
isUseSandbox
public boolean isUseSandbox()
Determines if the DSL scripts run in a sandbox with limited abilities.- Returns:
- TRUE if checkbox sandbox is selected
-
setIgnoreExisting
public void setIgnoreExisting(boolean ignore)
Decides if previously generated jobs or views will be ignored.- Parameters:
ignore
- leave previous jobs and views as is if true
-
isIgnoreExisting
public boolean isIgnoreExisting()
Determines if previously generated jobs or views will be ignored.- Returns:
- TRUE if checkbox ignoreExisting is selected
-
setRemovedJobAction
public void setRemovedJobAction(JobDslRemovedJobAction action)
Set what to do when a previously generated job is not referenced anymore.- Parameters:
action
- The action to select. An Element of the typeJobDslRemovedJobAction
.
-
getRemovedJobAction
public JobDslRemovedJobAction getRemovedJobAction()
Determines what to do when a previously generated job is not referenced anymore.- Returns:
- The selected action for removed jobs. An Element of the type
JobDslRemovedJobAction
.
-
setRemovedViewAction
public void setRemovedViewAction(JobDslRemovedViewAction action)
Set what to do when a previously generated view is not referenced anymore.- Parameters:
action
- The action to select. An element of the typeJobDslRemovedViewAction
.
-
getRemovedViewAction
public JobDslRemovedViewAction getRemovedViewAction()
Determines what to do when a previously generated view is not referenced anymore.- Returns:
- The selected action for removed views. An element of the type
JobDslRemovedViewAction
.
-
setRemovedConfigFilesAction
public void setRemovedConfigFilesAction(JobDslRemovedConfigFilesAction action)
Set what to do when a previously generated config file is not referenced anymore.- Parameters:
action
- The action to select. An element of the typeJobDslRemovedConfigFilesAction
.
-
getRemovedConfigFilesAction
public JobDslRemovedConfigFilesAction getRemovedConfigFilesAction()
Determines what to do when a previously generated config file is not referenced anymore.- Returns:
- The selected action for removed config files. An element of the type
JobDslRemovedConfigFilesAction
.
-
setLookupStrategy
public void setLookupStrategy(JobDslLookupStrategy strategy)
Set the context to use for relative job names.- Parameters:
strategy
- The strategy to select. An element of the typeJobDslLookupStrategy
.
-
getLookupStrategy
public JobDslLookupStrategy getLookupStrategy()
Determines the context to use for relative job names.- Returns:
- The selected strategy for lookup. An element of the type
JobDslLookupStrategy
.
-
setAdditionalClasspath
public void setAdditionalClasspath(String... classpaths)
Newline separated list of additional classpath entries for the Job DSL scripts. All entries must be relative to the workspace root.- Parameters:
classpaths
- The additional classpaths.
-
getAdditionalClasspath
public String[] getAdditionalClasspath()
Get the additional classpath entries for the Job DSL scripts.- Returns:
- an array of additional classpaths.
-
setFailOnMissingPlugin
public void setFailOnMissingPlugin(boolean fail)
Decides if the build will be marked as failed when a plugin must be installed or updated to support all features used in the DSL scripts.- Parameters:
fail
- mark build as failed if true
-
isFailOnMissingPlugin
public boolean isFailOnMissingPlugin()
Determines if the build will be marked as failed when a plugin must be installed or updated to support all features used in the DSL scripts.- Returns:
- TRUE if checkbox failOnMissingPlugin is selected
-
setUnstableOnDeprecation
public void setUnstableOnDeprecation(boolean unstable)
Decides if the build will be marked as unstable when using deprecated features.- Parameters:
unstable
- mark build as unstable if true
-
isUnstableOnDeprecation
public boolean isUnstableOnDeprecation()
Determines if the build will be marked as unstable when using deprecated features.- Returns:
- TRUE if checkbox unstableOnDeprecation is selected
-
-