This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-36660] Extending multibranch AT implementing creation of job
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/js/page_objects/classic_jenkins/multibranchCreate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Pipeline create (new item) page object (http://nightwatchjs.org/guide#page-objects) | ||
const suffix = 'newJob'; | ||
|
||
module.exports = { | ||
url: function () { | ||
return this.api.launchUrl + '/view/All/' + suffix; | ||
}, | ||
elements: { | ||
nameInput: '#name', | ||
multibranchType: 'li.org_jenkinsci_plugins_workflow_multibranch_WorkflowMultiBranchProject', | ||
submit: '#ok-button', | ||
save: 'span.yui-button[name="Submit"]', | ||
button: { | ||
selector: '//button[@path="/hetero-list-add[sources]"]', | ||
locateStrategy: 'xpath', | ||
}, | ||
scriptHook: { | ||
selector: '//input[@path="/sources/source/remote"]', | ||
locateStrategy: 'xpath', | ||
}, | ||
gitA: { | ||
selector: '//a[text()="Git"]', | ||
locateStrategy: 'xpath', | ||
} | ||
} | ||
}; | ||
|
||
// Nightwatch commands. | ||
// http://nightwatchjs.org/guide#writing-commands | ||
module.exports.commands = [{ | ||
|
||
createBranch: function (browser, folderName, path) { | ||
var self = this; | ||
|
||
self.waitForJobDeleted(folderName); | ||
|
||
self.setValue('@nameInput', folderName); | ||
|
||
self.waitForElementPresent('@multibranchType'); | ||
self.click('@multibranchType'); | ||
self.waitForElementPresent('@submit'); | ||
self.click('@submit'); | ||
self.waitForElementPresent('@button'); | ||
self.click('@button'); | ||
self.waitForElementPresent('@gitA'); | ||
self.click('@gitA'); | ||
self.waitForElementPresent('@scriptHook'); | ||
self.setValue('@scriptHook', path); | ||
|
||
self.waitForElementPresent('@save') | ||
.click('@save'); | ||
|
||
}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters