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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bug/JENKINS-39992-d…
Browse files Browse the repository at this point in the history
…upe-rows
  • Loading branch information
imeredith committed Nov 28, 2016
2 parents e9c41a2 + 66c7ed6 commit a93c9a3
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 8 deletions.
28 changes: 28 additions & 0 deletions src/main/js/page_objects/blueocean/blueNotFound.js
@@ -0,0 +1,28 @@
/** @module blueNotFound
* @memberof page_objects
* @description Represents the default 404 page in blueocean
*
* @example
* browser.page.blueNotFound().assertBasicLayoutOkay();
* */
module.exports = {
elements: {
fullscreenDiv: '.fullscreen.not-found',
title: '.fullscreen.not-found .message-box h3',
message: '.fullscreen.not-found .message-box .message',
link: '.fullscreen.not-found .message-box .actions a',
}
};
module.exports.commands = [{
/**
* Different test on general elements that should be visible on the page
* @returns {Object} self - nightwatch page object
*/
assertBasicLayoutOkay: function (callback) {
this.waitForElementVisible('@fullscreenDiv');
this.waitForElementVisible('@title');
this.waitForElementVisible('@message');
this.waitForElementVisible('@link', callback);
},

}];
26 changes: 26 additions & 0 deletions src/test/js/freestyle/branchPRTabs.js
@@ -0,0 +1,26 @@
/** @module freestyle
* @memberof karaoke
* @description TEST: Branch and PR tabs show the correct display.
*/
module.exports = {
/** Create freestyle Job "hijo"*/
'Step 01': function (browser) {
const freestyleCreate = browser.page.freestyleCreate().navigate();
freestyleCreate.createFreestyle('nonmultibranch_freestyle', 'freestyle.sh');
},
'Step 02': function (browser) {
const blueActivityPage = browser.page.bluePipelineActivity().forJob('nonmultibranch_freestyle', 'jenkins');

blueActivityPage.clickTab('branches');

blueActivityPage.assert.containsText('.empty-state-content', 'Branches are unsupported');
},

'Step 03': function (browser) {
const blueActivityPage = browser.page.bluePipelineActivity().forJob('nonmultibranch_freestyle', 'jenkins');

blueActivityPage.clickTab('pr');

blueActivityPage.assert.containsText('.empty-state-content', 'Pull Requests are unsupported');
}
};
9 changes: 9 additions & 0 deletions src/test/js/freestyle/index.js
@@ -0,0 +1,9 @@
/** @module freestyle
* @memberof testcases
* @description We are testing different REGRESSIONS that had appeared, so they do not appear again.
*
* @see {@link module:freestyle.activityTabs}
*/
module.exports = {

};
1 change: 1 addition & 0 deletions src/test/js/notMultibranch/freestyleRunning.js
Expand Up @@ -27,6 +27,7 @@ module.exports = {
browser.elements('css selector', '#hijo-1', function(res) {
browser.assert.equal(1, res.value.length);
})

},

};
41 changes: 33 additions & 8 deletions src/test/js/smoke.js
@@ -1,14 +1,20 @@
/** @module smoke
* @memberof testcases
* @description TEST: basic tests around the pipeline.
* @description TEST: basic tests around the pipeline. This includes creating and running a pipeline job, validating
* the activity view for empty and populated state. Further we validate the detail page with very basic matchers.
* We then try to press the "run" button on the activities tab and validate the Toast.
* To wrap up we are trying different urls which should result in 404 pages.
*/
const async = require("async");
const pageHelper = require("../../main/js/util/pageHelper");
const createCallbackWrapper = pageHelper.createCallbackWrapper;
module.exports = {
/**
* Create Pipeline Job
* @param browser
*/
'Step 01': function (browser) {
var pipelinesCreate = browser.page.pipelineCreate().navigate();
const pipelinesCreate = browser.page.pipelineCreate().navigate();
pipelinesCreate.createPipeline('my-pipeline', 'three-stages.groovy');
},

Expand All @@ -17,8 +23,8 @@ module.exports = {
* @param browser
*/
'Step 02': function (browser) {
var bluePipelineActivity = browser.page.bluePipelineActivity();
var bluePipelinesPage = browser.page.bluePipelines();
const bluePipelineActivity = browser.page.bluePipelineActivity();
const bluePipelinesPage = browser.page.bluePipelines();

// make sure the open blue ocean button works. In this case,
// it should bring the browser to an empty pipeline activity
Expand All @@ -37,7 +43,7 @@ module.exports = {
* @param browser
*/
'Step 03': function (browser) {
var blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');
const blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');

blueActivityPage.assertBasicLayoutOkay();
blueActivityPage.waitForElementVisible('@emptyStateShoes');
Expand All @@ -61,7 +67,7 @@ module.exports = {
* @param browser
*/
'Step 05': function (browser) {
var blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');
const blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');

blueActivityPage.assertBasicLayoutOkay();
blueActivityPage.expect.element('@emptyStateShoes').to.not.be.present.before(1000);
Expand All @@ -75,7 +81,7 @@ module.exports = {
* @param browser
*/
'Step 06': function (browser) {
var blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun('my-pipeline', 'jenkins', 1);
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun('my-pipeline', 'jenkins', 1);

blueRunDetailPage.assertBasicLayoutOkay();
},
Expand All @@ -87,10 +93,29 @@ module.exports = {
* @param browser
*/
'Step 07': function (browser) {
var blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');
const blueActivityPage = browser.page.bluePipelineActivity().forJob('my-pipeline', 'jenkins');
blueActivityPage.clickRunButtonAndOpenDetail();
// Check the run itself
browser.page.bluePipelineRunDetail().assertBasicLayoutOkay();
},

/**
* Trying out different urls that should result in the same 404 page
* @param browser
*/
'Step 08': function (browser) {
// FIXME: we need to test runs that not yet exist
// add the following as soon we have fixed them
// '/blue/organizations/gibtEsNicht', '/blue/organizations/jenkins/my-pipeline/detail/my-pipeline/20/pipeline'
// test different levels for 404
var urls = ['/blue/gibtEsNicht', '/blue/organizations/jenkins/gibtEsNicht/activity/', '/blue/organizations/gibtEsNicht/gibtEsNicht/detail/gibtEsNicht/'];
async.mapSeries(urls, function (url, callback) {
console.log('trying url', browser.launchUrl, url);
// navigate to the url
browser.url(browser.launchUrl + url, function(result) {
browser.page.blueNotFound().assertBasicLayoutOkay(createCallbackWrapper(callback));
});
});
}

};

0 comments on commit a93c9a3

Please sign in to comment.