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
TopLevelItems, 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
FieldsModifier and TypeFieldDescriptionfinal ControlThe controller that starts/stops Jenkinsprotected List<PostBuildStep>Fields inherited from class org.jenkinsci.test.acceptance.po.TopLevelItem
nameFields inherited from class org.jenkinsci.test.acceptance.po.PageObject
jsonParser, urlFields inherited from class org.jenkinsci.test.acceptance.po.CapybaraPortingLayerImpl
driver, injector, LABEL_TO_INPUT_XPATH, timeFields inherited from interface org.jenkinsci.test.acceptance.po.CapybaraPortingLayer
by -
Constructor Summary
Constructors -
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) voidvoid"Copy" any file from the System into the Workspace using a zipFIle.voidcopyResource(String resourcePath) "Copies" a resource (can be a single file or a directory) to the jobs workspace by utilizing a shell step.voidcopyResource(Resource resource) voidcopyResource(Resource resource, String fileName) Adds a shell step that copies a resource inside the test project into a file on the build machine.protected StringcopyResourceBatch(Resource resource, String fileName) protected StringcopyResourceShell(Resource resource, String fileName) voiddelete()Deletes the current job.voiddisable()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()voidscheduleBuild(Map<String, ?> params) voidsetLabelExpression(String label) shouldBeTiedToLabel(String label) voidshouldHaveBuiltOnOneOfNNodes(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, toStringMethods inherited from class org.jenkinsci.test.acceptance.po.ContainerPageObject
action, action, getConfigUrl, getJson, getJson, getJsonApiUrl, getNavigationLinksMethods inherited from class org.jenkinsci.test.acceptance.po.ConfigurablePageObject
apply, configure, configure, configure, configure, ensureConfigPage, getFormName, saveMethods inherited from class org.jenkinsci.test.acceptance.po.PageObject
control, control, createPageArea, createRandomName, ensureOpen, getContext, getJenkins, open, url, url, visitMethods 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, runThenHandleInputDialog, runThenHandleUserPrompt, 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:
getParametersin 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:
deletein classTopLevelItem
-
disabled
public static org.hamcrest.Matcher<org.openqa.selenium.WebDriver> disabled()
-