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

Commit

Permalink
[JENKINS-42515] split test into separate steps (seems to help w/ timi…
Browse files Browse the repository at this point in the history
…ng); also add waitForElementVisible for the branch visible
  • Loading branch information
Cliff Meyers committed Mar 31, 2017
1 parent 1eda0ba commit f52f666
Showing 1 changed file with 24 additions and 35 deletions.
59 changes: 24 additions & 35 deletions src/test/js/multibranch/filtering.js
@@ -1,16 +1,16 @@
const jobName = 'withGitFlow';
const jobName = 'filterActivityMB';
const path = require("path");
const pathToRepo = path.resolve('./target/testfilter-project-folder');
const soureRep = './src/test/resources/multibranch_2';
const git = require("../../../main/js/api/git");

var activity;

/** @module filtering
* @memberof multibranch
* @description Check that can filter the activity list
*/
module.exports = {


// ** creating a git repo */
before: function (browser, done) {
// we creating a git repo in target based on the src repo (see above)
Expand All @@ -20,36 +20,25 @@ module.exports = {
.then(done);
});
},

/**
* Make sure we can open the master branch results screen from activity
*/
'open master branch from activity': function (browser) {

var jobName = "filterActivityMB";
var multibranchCreate = browser.page.multibranchCreate().navigate();
multibranchCreate.createBranch(jobName, pathToRepo);

var blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins');

blueActivityPage.waitForElementVisible('input.autocomplete');
blueActivityPage.click('input.autocomplete');
blueActivityPage.waitForElementVisible('.item');

browser.elements('css selector', 'tbody tr', function(res) {
browser.assert.equal(2, res.value.length, 'Correct number of runs filtered down');
})


blueActivityPage.click('.item');

browser.elements('css selector', 'tbody tr', function(res) {
browser.assert.equal(1, res.value.length, 'Correct number of runs filtered down');
})


'Step 1 - create multibranch job': function(browser) {
var multibranchCreate = browser.page.multibranchCreate().navigate();
multibranchCreate.createBranch(jobName, pathToRepo);
},



}
'Step 2 - view all runs on Activity tab': function (browser) {
activity = browser.page.bluePipelineActivity().forJob(jobName, 'jenkins');
activity.waitForElementVisible('@activityTable');
browser.elements('css selector', 'tbody tr', function(res) {
browser.assert.equal(res.value.length, 2, 'Correct number of runs shown initially');
});
},
'Step 3 - filter to branch with no runs': function(browser) {
activity.waitForElementVisible('input.autocomplete');
activity.click('input.autocomplete');
activity.waitForElementVisible('.item[title=master]');
activity.click('.item[title=master]');
activity.waitForElementVisible('input.autocomplete[value=master');
browser.elements('css selector', 'tbody tr', function(res) {
browser.assert.equal(res.value.length, 1, 'Correct number of runs filtered down');
});
}
};

0 comments on commit f52f666

Please sign in to comment.