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

Commit

Permalink
Merge branch 'master' into feature/JENKINS-38597-create-from-git-ath
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/js/util/url.js
  • Loading branch information
Cliff Meyers committed Feb 9, 2017
2 parents 79ad6ae + 5505c9b commit 5282bc1
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 79 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Expand Up @@ -141,10 +141,11 @@ node ('docker') {
// ./start-selenium.sh (above) and ./stop-selenium.sh (below).
stage 'run'
sh "./run.sh -a=./blueocean-plugin/blueocean/ --no-selenium"
sendhipchat(repoUrl, branchName, buildNumber, null)
} catch (err) {
currentBuild.result = "FAILURE"
} finally {
sendhipchat(repoUrl, branchName, buildNumber, null)
step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/**/*.xml'])
}
}
} // configFileProvider
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Expand Up @@ -9,9 +9,9 @@ const jsdoc = require('gulp-jsdoc3');
const config = require('./jsdocConfig.json');

if (process.argv.length === 4 && process.argv[2] === '--test') {
gulp.task('default', shell.task('nightwatch --suiteRetries 2 ' + process.argv[3].toString()));
gulp.task('default', shell.task('nightwatch --retries 5 --suiteRetries 2 ' + process.argv[3].toString()));
} else {
gulp.task('default', shell.task('nightwatch --suiteRetries 2'));
gulp.task('default', shell.task('nightwatch --retries 5 --suiteRetries 2'));
}

gulp.task('doc', function (cb) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/js/custom_commands/waitForJobRunUnpaused.js
Expand Up @@ -19,7 +19,7 @@ util.inherits(Cmd, events.EventEmitter);
const waitForJobRunUnpaused = function (jobName, onBuildUnpaused) {
var self = this;

console.log('Waiting for job "' + jobName + '" run to pause.');
console.log('Waiting for job "' + jobName + '" run to unpause.');
sseClient.onJobRunUnpaused(jobName, function(event) {
console.log('Job "' + jobName + '" unpaused.');
try {
Expand All @@ -35,4 +35,4 @@ const waitForJobRunUnpaused = function (jobName, onBuildUnpaused) {
};
Cmd.prototype.command = waitForJobRunUnpaused;

module.exports = Cmd;
module.exports = Cmd;
8 changes: 4 additions & 4 deletions src/main/js/page_objects/blueocean/bluePipelineActivity.js
Expand Up @@ -12,7 +12,7 @@ const sanityCheck = pageHelper.sanityCheck;

module.exports = {
elements: {
pipelinesNav: '.global-header nav a[href="/blue/pipelines"]',
pipelinesNav: '.Header-topNav nav a[href="/blue/pipelines"]',
emptyStateShoes: '.empty-state .empty-state-icon.shoes',
activityTable: '.activity-table',
activityTableEntries: 'table.activity-table tbody tr',
Expand Down Expand Up @@ -46,7 +46,7 @@ module.exports.commands = [{
assertBasicLayoutOkay: function(jobName) {
const baseHref = url.viewPipeline('jenkins', (jobName?jobName:this.jobName));
this.waitForElementVisible('@pipelinesNav');
this.waitForElementVisible('nav.page-tabs a');
this.waitForElementVisible('.Header-topNav a');
this.waitForElementVisible('.Site-footer');
// Test the end of the active url and make sure it's on the
// expected activity page.
Expand Down Expand Up @@ -127,14 +127,14 @@ module.exports.commands = [{
assertStageGraphShows: function() {
//check results look kosher:
this.waitForElementVisible('.progress-spinner.running');
this.waitForElementVisible('.header.running')
this.waitForElementVisible('.BasicHeader--running')

this.waitForElementVisible('.pipeline-node-selected');
this.waitForElementVisible('.download-log-button');
this.waitForElementVisible('.pipeline-selection-highlight');
this.waitForElementVisible('.pipeline-connector');
this.waitForElementVisible('.pipeline-node-hittarget');
this.waitForElementVisible('.success');
this.waitForElementVisible('.BasicHeader--success');

},

Expand Down
11 changes: 6 additions & 5 deletions src/main/js/page_objects/blueocean/bluePipelineRunDetail.js
Expand Up @@ -23,8 +23,8 @@ module.exports = {
followAlongOff: '.step-scroll-area.follow-along-off',
emptystate: 'div.empty-state',
emptystateQueued: 'div.empty-state span.waiting',
detailTitle: 'section.table',
closeButton: 'a.closeButton',
detailTitle: '.ResultPageHeader-main',
closeButton: '.ResultPageHeader-close',
activityTable: '.activity-table',
highlightedGraph: 'g.pipeline-selection-highlight',
logConsole: 'div.logConsole',
Expand Down Expand Up @@ -123,7 +123,7 @@ module.exports.commands = [{
assertTitle: function (expected) {
const self = this;
self.waitForElementVisible('@detailTitle');
self.getText('@detailTitle', function (response) {
self.getText('@detailTitle', function (response) {
sanityCheck(self, response);
const urlProject = (response.value);
self.assert.equal(urlProject.indexOf(expected) > -1, true);
Expand Down Expand Up @@ -386,9 +386,10 @@ module.exports.commands = [{
).singleNodeValue;
// return the scrollHeight to determine whether we moved to the bottom on karaoke
return cmElem.scrollHeight;
}, ['//div[@class="content"]'], function (result) {
// sanity checks
}, ['//div[@class="FullScreen-contents"]'], function (result) {
// sanity checks
sanityCheck(self, result);

// the scrollHeight has to be higher 0 to indicate that we have scrolled
browser.assert.equal(result.value > 0, true);
// to make component chain-able we will return self - part 2
Expand Down
4 changes: 2 additions & 2 deletions src/main/js/page_objects/blueocean/bluePipelines.js
Expand Up @@ -14,8 +14,8 @@ module.exports = {
return this.api.launchUrl + pipelinesUrl;
},
elements: {
pipelinesNav: '.global-header nav a[href="'+pipelinesUrl+'"]',
newPipelineButton: '.page-title a[href="/view/All/newJob"]',
pipelinesNav: '.Header-topNav nav a[href="'+pipelinesUrl+'"]',
newPipelineButton: '.btn-new-pipeline',
pipelinesTable: '.pipelines-table',
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/main/js/util/url.js
Expand Up @@ -73,7 +73,7 @@ module.exports = {
* @returns {string}
*/
tabSelector: function(tabName) {
return 'nav.page-tabs a.' + tabName;
return 'nav a.' + tabName;
},
/**
* click a certain tab and validate that url has changed
Expand All @@ -100,4 +100,4 @@ module.exports = {
createPipeline: function() {
return '/blue/create-pipeline/';
},
};
};
2 changes: 1 addition & 1 deletion src/test/js/artifacts/artifacts.js
Expand Up @@ -27,7 +27,7 @@ module.exports = {
'Step 03': function (browser) {
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 1);

blueRunDetailPage.waitForElementVisible('div.header.success');
blueRunDetailPage.waitForElementVisible('section.BasicHeader--success');

blueRunDetailPage.clickTab('artifacts');

Expand Down
6 changes: 3 additions & 3 deletions src/test/js/edgeCases/runDetailsDeepLink.js
Expand Up @@ -15,7 +15,7 @@ module.exports = {
/** Create Pipeline Job "runDetailsDeepLink" */
'Step 01': function (browser) {
const pipelinesCreate = browser.page.pipelineCreate().navigate();
pipelinesCreate.createPipeline(jobName, 'initialStage.groovy');
pipelinesCreate.createPipeline(jobName, 'fastStages.groovy');
},
/** Build Pipeline Job*/
'Step 02': function (browser) {
Expand All @@ -31,9 +31,9 @@ module.exports = {
/** 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');
blueActivityPage.waitForRunSuccessVisible(jobName + '-1');
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 1);
blueRunDetailPage.waitForJobRunEnded(jobName);
blueRunDetailPage.waitForElementVisible('.BasicHeader--success');
blueRunDetailPage.closeModal('/activity');
},
};
46 changes: 24 additions & 22 deletions src/test/js/failing.js
Expand Up @@ -36,31 +36,33 @@ module.exports = {
// now testing JENKINS-37666
'Step 03': function (browser) {
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(JOB, 'jenkins', 1);

blueRunDetailPage.waitForElementVisible('.BasicHeader--failure');
// we want to analyse the result after the job has finished
browser.waitForJobRunEnded(JOB, function() {
// the failure should collapse
blueRunDetailPage.clickFirstResultItemFailure(false);
// test whether the expand works
blueRunDetailPage.clickFirstResultItem();
// now click again so the result collapse again
blueRunDetailPage.clickFirstResultItem(false);
// now click the node again and see whether only one code is visible
blueRunDetailPage.clickFirstResultItem();
// we now need to get all visible code blocks, but there should be no more then one
browser.elements('css selector', 'pre', function (codeCollection) {
this.assert.equal(typeof codeCollection, "object");
this.assert.equal(codeCollection.status, 0);
// JENKINS-36700 in fail all code should be closed besides one
// however if the browser is too quick there can still be two open
this.assert.equal(codeCollection.value.length <= 2, true);
});
// as it has failed, should get a replay button
blueRunDetailPage.waitForElementVisible('.replay-button');

// the failure should collapse
blueRunDetailPage.clickFirstResultItemFailure(false);
// test whether the expand works
blueRunDetailPage.clickFirstResultItem();
// now click again so the result collapse again
blueRunDetailPage.clickFirstResultItem(false);
// now click the node again and see whether only one code is visible
blueRunDetailPage.clickFirstResultItem();
// we now need to get all visible code blocks, but there should be no more then one
browser.elements('css selector', 'pre', function (codeCollection) {
this.assert.equal(typeof codeCollection, "object");
this.assert.equal(codeCollection.status, 0);
// JENKINS-36700 in fail all code should be closed besides one
// however if the browser is too quick there can still be two open
this.assert.equal(codeCollection.value.length <= 2, true);
});

// as it has failed, should get a replay button
blueRunDetailPage.waitForElementVisible('.replay-button');



});


},

Expand Down
39 changes: 20 additions & 19 deletions src/test/js/failingStages.js
Expand Up @@ -36,27 +36,28 @@ module.exports = {
// now testing JENKINS-37666
'Step 03': function (browser) {
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(JOB, 'jenkins', 1);
blueRunDetailPage.waitForElementVisible('.BasicHeader--failure');
// we want to analyse the result after the job has finished
browser.waitForJobRunEnded(JOB, function() {
// the failure should collapse
blueRunDetailPage.clickFirstResultItemFailure(false);
// test whether the expand works
blueRunDetailPage.clickFirstResultItem();
// now click again so the result collapse again
blueRunDetailPage.clickFirstResultItem(false);
// now click the node again and see whether only one code is visible
blueRunDetailPage.clickFirstResultItem();
// we now need to get all visible code blocks, but there should be no more then one
browser.elements('css selector', 'pre', function (codeCollection) {
this.assert.equal(typeof codeCollection, "object");
this.assert.equal(codeCollection.status, 0);
// JENKINS-36700 in fail all code should be closed besides one
// however if the browser is too quick there can still be two open
this.assert.equal(codeCollection.value.length <= 2, true);
});

// the failure should collapse
blueRunDetailPage.clickFirstResultItemFailure(false);
// test whether the expand works
blueRunDetailPage.clickFirstResultItem();
// now click again so the result collapse again
blueRunDetailPage.clickFirstResultItem(false);
// now click the node again and see whether only one code is visible
blueRunDetailPage.clickFirstResultItem();
// we now need to get all visible code blocks, but there should be no more then one
browser.elements('css selector', 'pre', function (codeCollection) {
this.assert.equal(typeof codeCollection, "object");
this.assert.equal(codeCollection.status, 0);
// JENKINS-36700 in fail all code should be closed besides one
// however if the browser is too quick there can still be two open
this.assert.equal(codeCollection.value.length <= 2, true);
});


});


},

Expand Down Expand Up @@ -86,7 +87,7 @@ module.exports = {

//check that we see a stage graph:
blueRunDetailPage.waitForElementVisible('.progress-spinner.running');
blueRunDetailPage.waitForElementVisible('.header.running')
blueRunDetailPage.waitForElementVisible('.BasicHeader--running')
blueRunDetailPage.waitForElementVisible('.pipeline-node-selected');
blueRunDetailPage.waitForElementVisible('.download-log-button');
blueRunDetailPage.waitForElementVisible('.pipeline-selection-highlight');
Expand Down
13 changes: 6 additions & 7 deletions src/test/js/log-karaoke/input.js
Expand Up @@ -25,9 +25,9 @@ module.exports = {
'Step 03': function (browser) {
const blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins');
// Check the run is turning to pause
blueActivityPage.waitForJobRunPaused(jobName, function () {
blueActivityPage.waitForRunPausedVisible(jobName + '-1');
});
blueActivityPage.waitForElementVisible('.circle-bg.paused');
blueActivityPage.waitForRunPausedVisible(jobName + '-1');

},
/** Check Job Blue Ocean Pipeline Activity Page has run - then go to the detail page and validate the input form
* */
Expand All @@ -38,9 +38,8 @@ module.exports = {
// submit the form
blueRunDetailPage.click('@inputStepSubmit');
// Check the run is turning to unpaused
blueRunDetailPage.waitForJobRunUnpaused(jobName, function () {
// wait for job to finish
blueRunDetailPage.waitForJobRunEnded(jobName);
});

blueRunDetailPage.waitForElementNotPresent('.circle-bg.paused');
blueRunDetailPage.waitForElementVisible('.BasicHeader--success');
}
};
2 changes: 1 addition & 1 deletion src/test/js/log-karaoke/noStages.js
Expand Up @@ -86,7 +86,7 @@ module.exports = {
browser.elements('css selector', 'div.result-item.success', function (collection) {
const count = collection.value.length;
// wait for the success update via sse event
this.waitForElementVisible('div.header.success')
this.waitForElementVisible('.BasicHeader--success');
blueRunDetailPage.fullLogButtonNotPresent();
this
.elements('css selector', 'div.result-item.success', function (collection2) {
Expand Down
1 change: 1 addition & 0 deletions src/test/js/multibranch/multibranchOpening.js
Expand Up @@ -93,6 +93,7 @@ module.exports = {


var blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins');
blueActivityPage.waitForElementVisible('.branches');
blueActivityPage.click(".branches");

blueActivityPage.waitForElementVisible('tr[id^="feature"]');
Expand Down
8 changes: 8 additions & 0 deletions src/test/js/multibranch/testResults.js
Expand Up @@ -27,9 +27,17 @@ module.exports = {
},

'Open acitivty page wait for first run to finish': (browser) => {


const blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName);
blueActivityPage.waitForElementVisible(".branches");
blueActivityPage.click(".branches");

blueActivityPage.waitForElementVisible(".activity");
blueActivityPage.click(".activity");
// validate that we have 3 activities from the previous tests
blueActivityPage.assertActivitiesToBeEqual(1);


blueActivityPage.waitForRunUnstableVisible(`${jobName}-1`)
},
Expand Down
9 changes: 9 additions & 0 deletions src/test/resources/test_scripts/fastStages.groovy
@@ -0,0 +1,9 @@
node {

stage ('Build1') {
sh 'ping -c 1 localhost'
}
stage ('Build2') {
sh 'ping -c 1 localhost'
}
}
2 changes: 1 addition & 1 deletion src/test/resources/test_scripts/freestylePing.sh
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
ping -c 10 spiegel.de
ping -c 10 localhost
8 changes: 4 additions & 4 deletions src/test/resources/test_scripts/initialStage.groovy
@@ -1,9 +1,9 @@
node {
sh 'ping -c 5 www.spiegel.de'
sh 'ping -c 5 www.spiegel.de || true'
stage ('Build1') {
sh 'ping -c 5 www.spiegel.de'
sh 'ping -c 5 www.spiegel.de || true'
}
stage ('Build2') {
sh 'ping -c 5 www.spiegel.de'
sh 'ping -c 5 www.spiegel.de || true'
}
}
}
6 changes: 3 additions & 3 deletions src/test/resources/test_scripts/parallel-stages.groovy
Expand Up @@ -6,13 +6,13 @@ node {

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

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

stage "ho"
sh "echo done"
}
}

0 comments on commit 5282bc1

Please sign in to comment.