Package org.jenkinsci.test.acceptance.po
Class Job
- All Implemented Interfaces:
CapybaraPortingLayer
- Direct Known Subclasses:
FreeStyleJob
,FreeStyleMultiBranchJob
,MatrixConfiguration
,MatrixProject
,MavenModule
,MavenModuleSet
,WorkflowJob
Job Page object superclass.
As with other
TopLevelItem
s, use Describable
annotation to register an implementation.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
CapybaraPortingLayerImpl.Finder<R>, CapybaraPortingLayerImpl.Resolver
-
Field Summary
Modifier and TypeFieldDescriptionfinal Control
The controller that starts/stops Jenkinsprotected List<PostBuildStep>
Fields inherited from class org.jenkinsci.test.acceptance.po.TopLevelItem
name
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
-
Method Summary
Modifier and TypeMethodDescriptionaddBatchStep
(String batch) <T extends BuildStep>
TaddBuildStep
(Class<T> type) <T extends BuildWrapper>
TaddBuildWrapper
(Class<T> type) <T extends Parameter>
TaddParameter
(Class<T> type) <T extends BuildStep>
TaddPreBuildStep
(Class<T> type) <T extends PostBuildStep>
TaddPublisher
(Class<T> publisherClass) Adds the specified publisher to this job.<T extends PostBuildStep>
TaddPublisher
(Class<T> type, Consumer<T> configuration) Adds the specified publisher to this job.addShellStep
(String shell) addShellStep
(Resource res) <T extends Trigger>
TaddTrigger
(Class<T> type) build
(int buildNumber) void
void
"Copy" any file from the System into the Workspace using a zipFIle.void
copyResource
(String resourcePath) "Copies" a resource (can be a single file or a directory) to the jobs workspace by utilizing a shell step.void
copyResource
(Resource resource) void
copyResource
(Resource resource, String fileName) Adds a shell step that copies a resource inside the test project into a file on the build machine.protected String
copyResourceBatch
(Resource resource) protected String
copyResourceShell
(Resource resource, String fileName) void
delete()
Deletes the current job.void
disable()
static org.hamcrest.Matcher<org.openqa.selenium.WebDriver>
disabled()
<T extends PostBuildStep>
voideditPublisher
(Class<T> type, Consumer<T> configuration) Edits this job using the specified configuration lambda.int
<T extends PostBuildStep>
TgetPublisher
(Class<T> type) Getter for a specific publisher previously added to the job.pollScm()
void
scheduleBuild
(Map<String, ?> params) void
setLabelExpression
(String label) shouldBeTiedToLabel
(String label) void
shouldHaveBuiltOnOneOfNNodes
(List<Node> nodes) Verify that the job contains some builds on exact one of the given list of nodes.startBuild
(Map<String, ?> params) void
<T extends Scm>
TMethods inherited from class org.jenkinsci.test.acceptance.po.TopLevelItem
as, description, equals, getDescription, getDisplayName, hashCode, renameTo, setDescription, setDescription, toString
Methods inherited from class org.jenkinsci.test.acceptance.po.ContainerPageObject
action, action, getConfigUrl, getJson, getJson, getJsonApiUrl, getNavigationLinks
Methods inherited from class org.jenkinsci.test.acceptance.po.ConfigurablePageObject
apply, configure, configure, configure, configure, ensureConfigPage, getFormName, getSubmitButtonText, save
Methods inherited from class org.jenkinsci.test.acceptance.po.PageObject
control, control, createPageArea, createRandomName, getContext, getJenkins, open, 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, isHiddenOrStale, isStale, last, lastIfNotVisible, newInstance, resource, runThenConfirmAlert, runThenConfirmAlert, runThenHandleAlert, runThenHandleAlert, runThenHandleDialog, sleep, visit, waitFor, waitFor, waitFor, waitFor, waitFor, waitForCond, waitForCond
-
Field Details
-
controller
The controller that starts/stops Jenkins -
publishers
-
concurrentBuild
-
-
Constructor Details
-
Job
-
Job
-
-
Method Details
-
getParameters
- Overrides:
getParameters
in classTopLevelItem
-
useScm
-
addPreBuildStep
-
addBuildStep
-
removeFirstBuildStep
public void removeFirstBuildStep() -
addPublisher
Adds the specified publisher to this job. Publishers are stored in a list member to provide later access for modification.- Type Parameters:
T
- the type of the publisher- Parameters:
publisherClass
- the publisher to configure- See Also:
-
addPublisher
Adds the specified publisher to this job. Publishers are stored in a list member to provide later access for modification. After the publisher has been added the publisher is configured with the specified configuration lambda. Afterwards, the job configuration page still is visible and not saved.- Type Parameters:
T
- the type of the publisher- Parameters:
type
- the publisher to configureconfiguration
- the additional configuration options for this job- See Also:
-
editPublisher
Edits this job using the specified configuration lambda. Opens the job configuration view, selects the specified publisher page object, runs the specified configuration lambda, and saves the changes. Afterwards, the job configuration page still is visible and not saved.- Type Parameters:
T
- the type of the publisher- Parameters:
type
- the publisher to configureconfiguration
- the additional configuration options for this job
-
getPublisher
Getter for a specific publisher previously added to the job. If a publisher of a class is requested which has not been added previously this will result in aNoSuchElementException
. -
addShellStep
-
addShellStep
-
addBatchStep
-
addBuildWrapper
-
addTrigger
-
copyResource
Adds a shell step that copies a resource inside the test project into a file on the build machine.Because there's no direct file system access to Jenkins master, we do this by packing file content in base64 and put it as a heredoc in the shell script.
-
copyResourceShell
-
copyResourceBatch
-
copyResource
-
copyFile
"Copy" any file from the System into the Workspace using a zipFIle.Differentiates when the file is being run on Windows or Unix based machines.
-
copyDir
-
copyResource
"Copies" a resource (can be a single file or a directory) to the jobs workspace by utilizing a shell step.- Parameters:
resourcePath
- the resource to copy
-
getBuildUrl
-
startBuild
-
startBuild
-
scheduleBuild
-
scheduleBuild
-
build
-
getLastBuild
-
addParameter
-
disable
public void disable() -
getNextBuildNumber
public int getNextBuildNumber() -
getWorkspace
-
useCustomWorkspace
-
setLabelExpression
-
shouldBeTiedToLabel
-
shouldHaveBuiltOnOneOfNNodes
Verify that the job contains some builds on exact one of the given list of nodes. To test whether the the job has built on the master, the jenkins instance has to be passed in the parameter. -
pollScm
-
delete
public void delete()Deletes the current job.- Specified by:
delete
in classTopLevelItem
-
disabled
public static org.hamcrest.Matcher<org.openqa.selenium.WebDriver> disabled()
-