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.
Browse files
Browse the repository at this point in the history
Bug/jenkins 43217 run details modal madness (#133)
* [JENKINS-43217] rewrite waitForLocationChange -> waitForLocationContains so it doesn't require the URL to actually change, as it could be brittle due to timing issues; rework "closeModal" page object command to just wait for the RunDetails-content element to go away; refactor the "runDetailsDeepLink" test to "runDetailsFallbackNavigation" and adjust to new API * [JENKINS-43217] add a test case that ensures that navigating within run details and closing redirects back to the right URL * [JENKINS-43217] make the steps more discrete * [JENKINS-43217] better description for last step
- Loading branch information
1 parent
c76bc7c
commit 0354987
Showing
2 changed files
with
61 additions
and
2 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
60 changes: 60 additions & 0 deletions
60
src/test/js/runDetailsModal/runDetailsBackwardsNavigation.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,60 @@ | ||
const path = require("path"); | ||
const jobName = 'runDetailsBackwardNavigation'; | ||
const pathToRepo = path.resolve('./target/' + jobName); | ||
const soureRep = './src/test/resources/multibranch_2'; | ||
const git = require("../../../main/js/api/git"); | ||
|
||
var activity, branches, runDetails; | ||
|
||
/** | ||
* @module runDetailsBackwardNavigation | ||
* @memberof runDetailsModal | ||
* @description | ||
* | ||
* Tests: test whether navigating within run details and closing it returns to the correct page. | ||
* | ||
* REGRESSION covered: JENKINS-43217 | ||
* | ||
* @see {@link https://issues.jenkins-ci.org/browse/JENKINS-43217|JENKINS-43217} | ||
* Closing pipeline results "modal" after clicking on a stage sets the url incorrectly to the previous URL, not activity | ||
*/ | ||
module.exports = { | ||
before: function(browser, done) { | ||
// we creating a git repo in target based on the src repo (see above) | ||
git.createRepo(soureRep, pathToRepo) | ||
.then(function () { | ||
git.createBranch('feature/1', pathToRepo) | ||
.then(done); | ||
}); | ||
}, | ||
'Step 01 - Create Multibranch Job': function (browser) { | ||
var multibranchCreate = browser.page.multibranchCreate().navigate(); | ||
multibranchCreate.createBranch(jobName, pathToRepo); | ||
}, | ||
'Step 02 - navigate to Activity tab via URL': function (browser) { | ||
activity = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins'); | ||
activity.waitForElementVisible('.Header-pageTabs .branches'); | ||
}, | ||
'Step 03 - click to Branches tab': function(browser) { | ||
activity.click('.Header-pageTabs .branches'); | ||
branches = browser.page.bluePipelineBranch(); | ||
branches.waitForElementVisible('tr[id^="master"]'); | ||
}, | ||
'Step 04 - click to Run Details': function(browser) { | ||
branches.click('tr[id^="master"]'); | ||
runDetails = browser.page.bluePipelineRunDetail(); | ||
runDetails.waitForElementVisible('.RunDetailsHeader'); | ||
}, | ||
'Step 05 - click around Run Details tabs': function() { | ||
runDetails.clickTab('changes'); | ||
runDetails.waitForLocationContains('/changes'); | ||
runDetails.clickTab('artifacts'); | ||
runDetails.waitForLocationContains('/artifacts'); | ||
runDetails.clickTab('tests'); | ||
runDetails.waitForLocationContains('/tests'); | ||
}, | ||
'Step 06 - close modal and confirm returned to Branches tab': function () { | ||
runDetails.closeModal(); | ||
runDetails.waitForLocationContains('/branches'); | ||
} | ||
}; |