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

[FIX JENKINS-39809_404_pages_appear_only_in_pipelinePage_children] #71

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[JENKINS-39809_404_pages_appear_only_in_pipelinePage_children] Add no…
…tFound page. Better description of test case. Add 404 tests for differrent urls.
  • Loading branch information
scherler committed Nov 24, 2016
commit 3355b5ed7f07f415c52e9a85083564af58ad81d8
28 changes: 28 additions & 0 deletions src/main/js/page_objects/blueocean/blueNotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @module blueNotFound
* @memberof page_objects
* @description Represents the default 404 page in blueocean
*
* @example
* browser.page.blueNotFound().xxx();
* */
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 () {
this.waitForElementVisible('@fullscreenDiv');
this.waitForElementVisible('@title');
this.waitForElementVisible('@message');
this.waitForElementVisible('@link');
},

}];
39 changes: 30 additions & 9 deletions src/test/js/smoke.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/** @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");
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 +21,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 +41,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 @@ -48,7 +52,7 @@ module.exports = {
* @param browser
*/
'Step 04': function (browser) {
var pipelinePage = browser.page.jobUtils().forJob('my-pipeline');
const pipelinePage = browser.page.jobUtils().forJob('my-pipeline');
pipelinePage.build(function() {
// Reload the job page and check that there was a build done.
pipelinePage = browser.page.jobUtils().forJob('my-pipeline');
Expand All @@ -61,7 +65,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 +79,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 +91,27 @@ 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) {
// test different levels for 404
var urls = ['/blue/gibtEsNicht', '/blue/organizations/gibtEsNicht', '/blue/organizations/gibtEsNicht/gibtEsNicht/detail/gibtEsNicht/'];
async.mapSeries(urls, function (url, callback) {
console.log('trying url', url);
// navigate to the url
browser.url(url, function(result) {
console.log(result)
browser.page.blueNotFound().assertBasicLayoutOkay();
});
});
}

};