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

Commit

Permalink
[JENKINS-37753] REGRESSION: Steps showing up as incomplete when they …
Browse files Browse the repository at this point in the history
…are in fact complete (#43)

* [JENKINS-37753] Implement AT test. WARNING not test due to problems with the update center mirror

* [JENKINS-37753] Fix test and add test for the log entry
  • Loading branch information
scherler committed Sep 23, 2016
1 parent ece4cf9 commit a5c04bb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
18 changes: 14 additions & 4 deletions src/main/js/page_objects/blueocean/bluePipelineRunDetail.js
Expand Up @@ -33,6 +33,7 @@ module.exports = {
tests: 'div.new-failure-block div.result-item',
authors: 'a.authors',
circleSuccess: 'svg circle.success',
runningResult: 'span.result-item-icon.running',
firstResult: {
selector: '//div[contains(@class, "result-item") and position()=1]',
locateStrategy: 'xpath',
Expand Down Expand Up @@ -134,9 +135,9 @@ module.exports.commands = [{
self.waitForElementVisible('@logHeader');
self.getText('@logHeader', function (response) {
sanityCheck(self, response);
console.log(response)
const urlProject = (response.value);
self.assert.equal(urlProject.indexOf(expected) > -1, true);
//console.log(response, expected)
const title = (response.value);
self.assert.equal(title.indexOf(expected) > -1, true);
});
return self;
},
Expand Down Expand Up @@ -215,7 +216,7 @@ module.exports.commands = [{
// the progressBar should be present
self.waitForElementVisible('@progressBar');
// when we are loading the code element should not be present
this.expect.element('@code').to.not.be.present.before(1000);
self.expect.element('@code').to.not.be.present.before(1000);
return self;

},
Expand Down Expand Up @@ -385,6 +386,15 @@ module.exports.commands = [{
// to make component chain-able we will return self - part 2
});
return self;
},

/**
* We are validating that there are no running nodes visible anymore
* @returns {Object} self - nightwatch page object
*/
validateNotRunningResults: function () {
this.expect.element('@runningResult').to.not.be.present.before(1000);
return this;
}

}];
20 changes: 19 additions & 1 deletion src/test/js/log-karaoke/parallelStages.js
Expand Up @@ -52,7 +52,25 @@ module.exports = {
* */
'Step 04': function (browser) {
browser.waitForJobRunEnded(jobName, function () {
// Here will test for JENKINS-37753
/*
* Here we will test for JENKINS-37753 -> IF groovy changes this might to be adopted
*/
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 1);
// we should be on the last stage of the pipeline by now
blueRunDetailPage.validateNotRunningResults();
// navigate to the first stage in the pipeline
blueRunDetailPage.forNode(5);
blueRunDetailPage.validateNotRunningResults();
// navigate to the first stage in the parallel step in the pipeline
blueRunDetailPage.forNode(10);
blueRunDetailPage.validateNotRunningResults();
// sample taken at random for logs to see whether they are truncated
blueRunDetailPage.clickFirstResultItem('Running shell script');
blueRunDetailPage.clickFirstResultItem('secondBranch www.stern.de');
// navigate to the second stage in the parallel step in the pipeline
blueRunDetailPage.forNode(11);
blueRunDetailPage.validateNotRunningResults();

});
}
};
4 changes: 2 additions & 2 deletions src/test/resources/test_scripts/parallel-stages.groovy
Expand Up @@ -6,11 +6,11 @@ node {

parallel firstBranch: {
sh 'echo `date` Stage 2 - firstBranch www.spiegel.de'
sh 'ping -c 3 -i 1 www.spiegel.de'
sh 'ping -c 3 -i 3 www.spiegel.de'

}, secondBranch: {
sh 'echo `date` Stage 2 - secondBranch www.stern.de'
sh 'ping -c 5 -i 1 www.stern.de'
sh 'ping -c 5 -i 2 www.stern.de'
}

stage "ho"
Expand Down

0 comments on commit a5c04bb

Please sign in to comment.