Module: jobUtils

Represents the "new Item" page of classic jenkins.

Example

const freestylePage = browser.page.jobUtils().forJob('hijo');

Methods


<inner> build( [onBuildComplete])

Try to build the job, invoke callback when build is complete

Parameters:
Name Type Argument Description
onBuildComplete function <optional>

callback to be invoke when finished

See:
  • module:custom_commands.waitForJobRunEnded
Returns:

self - nightwatch page object

Type
Object
Example
freestylePage.build(function() {
    // Reload the job page and check that there was a build done.
    freestylePage = browser.page.jobUtils().forJob('my-pipeline');
    freestylePage.waitForElementVisible('@builds');
});

<inner> buildQueued()

Build and wait until job is in the queue.

Returns:

self - nightwatch page object

Type
Object
Example
freestylePage.buildQueued();

<inner> buildStarted( [onBuildStarted])

Try to build the job, invoke callback when build is started

Parameters:
Name Type Argument Description
onBuildStarted function <optional>

callback to be invoke when finished

See:
  • module:custom_commands.waitForJobRunStarted
Returns:

self - nightwatch page object

Type
Object
Example
freestylePage.buildStarted(function () {
    // Reload the job page and check that there was a build done.
    freestylePage
        .forRun(1)
        .waitForElementVisible('@executer');
})

<inner> forJob(jobName [, suffix])

Returns the config page of a certain job

Parameters:
Name Type Argument Description
jobName String

name of the job to configure

suffix String <optional>

we may need to add a suffix to the final url

Returns:

self - nightwatch page object

Type
Object
Example
const freestylePage = browser.page.jobUtils().forJob('hijo');

<inner> forRun(runId)

Returns the config page of a certain run

Parameters:
Name Type Description
runId

the id of a specific run

Returns:

self - nightwatch page object

Type
Object
Example
freestylePage.forRun('1');

<inner> forUrl(url, jobName)

Navigate to a certain url

Parameters:
Name Type Description
url String

the url to navigate to

jobName String

name of the job to configure

Returns:

self - nightwatch page object

Type
Object
Example
freestylePage.forUrl(someUrl);

<inner> indexingStarted( [onIndexingStarted])

Multibranch projects are needed to be indexed. This helper will click on the indexing selector and call the callback when the run has started

Parameters:
Name Type Argument Description
onIndexingStarted function <optional>

callback to be invoke when finished

See:
  • module:custom_commands.onIndexingStarted
Returns:

self - nightwatch page object

Type
Object
Example
masterJob.indexingStarted(); // start a new build by starting indexing