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.
Feature/jenkins 38597 create from git ath (#114)
* [JENKINS-38597] first draft of simple test for Git Creation flow * [JENKINS-38597] add selectors to page object * [JENKINS-38597] cleanup * [JENKINS-38597] make more resilient to timing issues by waiting for success, rather than running
- Loading branch information
1 parent
5505c9b
commit 3469b9c
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
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,29 @@ | ||
/** | ||
* @module blueCreate | ||
* @memberof page_objects | ||
* @description Represents the "create pipeline" page | ||
* | ||
* @example | ||
* var blueCreatePage = browser.page.bluePipelineCreate().navigate(); | ||
* */ | ||
const url = require('../../util/url'); | ||
|
||
module.exports = { | ||
url: function() { | ||
return this.api.launchUrl + url.createPipeline(); | ||
}, | ||
elements: { | ||
gitCreationButton: '.scm-provider-list .git-creation', | ||
repositoryUrlText: '.text-repository-url input', | ||
newCredentialTypeSystemSSh: '.credentials-type-picker .RadioButtonGroup-item:nth-child(3)', | ||
createButton: '.git-step-connect .button-create-pipeline', | ||
openPipelineButton: '.git-step-completed .button-open-pipeline', | ||
} | ||
}; | ||
|
||
module.exports.commands = [{ | ||
assertCompleted: function() { | ||
this.waitForElementVisible('.git-step-completed'); | ||
this.waitForElementVisible('@openPipelineButton'); | ||
} | ||
}]; |
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
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,42 @@ | ||
/** | ||
* @module localRepo | ||
* @memberof git | ||
* @description | ||
* | ||
* Tests: test that creating a pipeline from a local Git repo works | ||
*/ | ||
const git = require("../../../../main/js/api/git"); | ||
const path = require("path"); | ||
|
||
const jobName = 'test-project-folder'; | ||
const pathToRepo = path.resolve('./target/' + jobName); | ||
const sourceRep = './src/test/resources/multibranch_2'; | ||
|
||
|
||
module.exports = { | ||
before: function(browser, done) { | ||
browser.waitForJobDeleted(jobName, function () { | ||
git.createRepo(sourceRep, pathToRepo) | ||
.then(function () { | ||
git.createBranch('feature/alpha', pathToRepo) | ||
.then(done); | ||
}); | ||
}); | ||
}, | ||
|
||
'Step 01 - Create Pipeline': function (browser) { | ||
const create = browser.page.bluePipelineCreate().navigate(); | ||
create.waitForElementVisible('.scm-provider-list'); | ||
create.click('@gitCreationButton'); | ||
create.waitForElementVisible('.git-step-connect'); | ||
create.setValue('@repositoryUrlText', pathToRepo); | ||
create.click('@newCredentialTypeSystemSSh'); | ||
create.click('@createButton'); | ||
create.assertCompleted(); | ||
}, | ||
'Step 02 - Check Activity Tab': function (browser) { | ||
const activity = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins'); | ||
activity.assertBasicLayoutOkay(); | ||
activity.waitForRunSuccessVisible(jobName + '-1'); | ||
} | ||
}; |