Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
[JENKINS-40662] add a test case for when user is deep-linked to run d…
Browse files Browse the repository at this point in the history
…etails in the URL form of :org/:pipeline/:branch/:runId and the modal doesn't close properly
  • Loading branch information
Cliff Meyers committed Jan 3, 2017
1 parent e703781 commit a7765b9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/main/js/page_objects/blueocean/bluePipelineRunDetail.js
Expand Up @@ -143,21 +143,20 @@ module.exports.commands = [{
},
/**
* Close the modal view
* @param {String} [urlFragment] expected URL fragment to test for after close.
* @returns {Object} self - nightwatch page object
*/
closeModal: function () {
closeModal: function (urlFragment) {
const self = this;
const browser = self.api;
self.waitForElementVisible('@closeButton');
self.click('@closeButton');
browser.url(function (response) {
sanityCheck(self, response);
// FIXME JENKINS-36619 -> somehow the close in AT is not working as it should
// I debugged a bit and found out that the "previous" location is the same as
// current, this is the reason, why no url change is triggered. The question remains
// why that is happening
// this.pause(10000)
});

if (urlFragment) {
self.waitForLocationChange();
browser.assert.urlContains(urlFragment);
}

return self;
},
/**
Expand Down
38 changes: 38 additions & 0 deletions src/test/js/edgeCases/runDetailsDeepLink.js
@@ -0,0 +1,38 @@
/**
* @module runDetailsDeepLink
* @memberof edgeCases
* @description
*
* Tests: test whether navigating to Run Details without specifying a tab allows the close button to work correctly.
*
* REGRESSION covered:
*
* @see {@link https://issues.jenkins-ci.org/browse/JENKINS-40662|JENKINS-40662} Deep-linking to Run Details
* screen with no tab specified causes problem when closing modal
*/
const jobName = 'runDetailsDeepLink';
module.exports = {
/** Create Pipeline Job "runDetailsDeepLink" */
'Step 01': function (browser) {
const pipelinesCreate = browser.page.pipelineCreate().navigate();
pipelinesCreate.createPipeline(jobName, 'initialStage.groovy');
},
/** Build Pipeline Job*/
'Step 02': function (browser) {
const pipelinePage = browser.page.jobUtils().forJob(jobName);
pipelinePage.buildStarted(function () {
// Reload the job page and check that there was a build done.
pipelinePage
.waitForElementVisible('div#pipeline-box')
.forRun(1)
.waitForElementVisible('@executer');
});
},
/** Check Job Blue Ocean Pipeline Activity Page has run */
'Step 03': function (browser) {
const blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins');
blueActivityPage.waitForRunRunningVisible(jobName + '-1');
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 1);
blueRunDetailPage.closeModal('/activity');
},
};

0 comments on commit a7765b9

Please sign in to comment.