Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"auto-release-sinon": "1.0.3",
"babel-eslint": "4.1.8",
"chokidar": "1.4.3",
"chromedriver": "2.21.2",
"elasticdump": "2.1.1",
"eslint": "1.10.3",
"eslint-plugin-mocha": "1.1.0",
Expand All @@ -173,7 +174,7 @@
"html-entities": "1.1.3",
"husky": "0.8.1",
"image-diff": "1.6.0",
"intern": "3.0.1",
"intern": "3.1.1",
"istanbul-instrumenter-loader": "0.1.3",
"karma": "0.13.9",
"karma-chrome-launcher": "0.2.0",
Expand Down
20 changes: 0 additions & 20 deletions tasks/config/downloadSelenium.js

This file was deleted.

1 change: 1 addition & 0 deletions tasks/config/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = function (grunt) {
options: {
runType: 'runner',
config: 'test/intern',
bail: true,
reporters: ['Console']
},
dev: {},
Expand Down
27 changes: 12 additions & 15 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = function (grunt) {
let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana';
let buildScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana';
let uiConfig = require(root('test/server_config'));
let chromedriver = require('chromedriver');

const stdDevArgs = [
'--env.name=development',
Expand Down Expand Up @@ -113,35 +114,31 @@ module.exports = function (grunt) {
]
},

seleniumServer: {
chromeDriver: {
options: {
wait: false,
ready: /Selenium Server is up and running/,
quiet: true,
ready: /Starting ChromeDriver/,
quiet: false,
failOnError: false
},
cmd: 'java',
cmd: chromedriver.path,
args: [
'-jar',
'<%= downloadSelenium.options.selenium.path %>',
'-port',
uiConfig.servers.webdriver.port,
`--port=${uiConfig.servers.webdriver.port}`,
'--url-base=wd/hub',
]
},

devSeleniumServer: {
devChromeDriver: {
options: {
wait: false,
ready: /Selenium Server is up and running/,
ready: /Starting ChromeDriver/,
quiet: false,
failOnError: false
},
cmd: 'java',
cmd: chromedriver.path,
args: [
'-jar',
'<%= downloadSelenium.options.selenium.path %>',
'-port',
uiConfig.servers.webdriver.port,
`--port=${uiConfig.servers.webdriver.port}`,
'--url-base=wd/hub',
]
},

Expand Down
61 changes: 0 additions & 61 deletions tasks/download_selenium.js

This file was deleted.

8 changes: 3 additions & 5 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@ module.exports = function (grunt) {
grunt.registerTask('test:ui', [
'esvm:ui',
'run:testUIServer',
'downloadSelenium',
'run:seleniumServer',
'run:chromeDriver',
'intern:dev',
'esvm_shutdown:ui',
'stop:seleniumServer',
'stop:chromeDriver',
'stop:testUIServer'
]);

grunt.registerTask('test:ui:server', [
'esvm:ui',
'run:testUIServer',
'downloadSelenium',
'run:devSeleniumServer:keepalive'
'run:devChromeDriver:keepalive'
]);

grunt.registerTask('test:ui:runner', [
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ bdd.describe('dashboard tab', function describeIndexTests() {
// .then(function () {
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
return headerPage.setAbsoluteRange(fromTime, toTime)
.then(function sleep() {
return common.sleep(4000);
.then(function () {
return headerPage.getSpinnerDone();
})
.then(function takeScreenshot() {
common.debug('Take screenshot');
Expand Down
74 changes: 44 additions & 30 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ bdd.describe('discover app', function describeIndexTests() {
.then(function () {
common.debug('setAbsoluteRange');
return headerPage.setAbsoluteRange(fromTime, toTime);
})
.then(function () {
return headerPage.getSpinnerDone();
});
});

Expand Down Expand Up @@ -74,13 +77,18 @@ bdd.describe('discover app', function describeIndexTests() {
bdd.it('load query should show query name', function () {
return discoverPage.loadSavedSearch(queryName1)
.then(function () {
return common.sleep(3000);
return headerPage.getSpinnerDone();
})
.then(function () {
return discoverPage.getCurrentQueryName();
return common.try(function () {
return discoverPage.getCurrentQueryName()
.then(function (actualQueryNameString) {
expect(actualQueryNameString).to.be(queryName1);
});
});
})
.then(function (actualQueryNameString) {
expect(actualQueryNameString).to.be(queryName1);
.then(function () {
return headerPage.getSpinnerDone();
});
});

Expand All @@ -101,7 +109,7 @@ bdd.describe('discover app', function describeIndexTests() {
'61.862', '15.487', '2.362', '2.800', '15.312', '61.862', '123.2',
'118.562', '63.524', '17.587', '2.537'
];
return common.sleep(4000)
return headerPage.getSpinnerDone()
.then(function () {
return verifyChartData(expectedBarChartData);
});
Expand Down Expand Up @@ -140,7 +148,7 @@ bdd.describe('discover app', function describeIndexTests() {
];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(4000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -154,7 +162,7 @@ bdd.describe('discover app', function describeIndexTests() {
];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(4000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -166,7 +174,7 @@ bdd.describe('discover app', function describeIndexTests() {
var expectedBarChartData = [ '66.598', '129.458'];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(2000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -179,6 +187,9 @@ bdd.describe('discover app', function describeIndexTests() {
'133.196', '129.192', '129.724'
];
return this.remote.goBack()
.then(function () {
return headerPage.getSpinnerDone();
})
.then(function () {
return common.try(function tryingForTime() {
return discoverPage.getChartInterval()
Expand All @@ -197,7 +208,7 @@ bdd.describe('discover app', function describeIndexTests() {
var expectedBarChartData = [ '122.535'];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(2000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -209,7 +220,7 @@ bdd.describe('discover app', function describeIndexTests() {
var expectedBarChartData = [ '122.535'];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(2000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -226,7 +237,7 @@ bdd.describe('discover app', function describeIndexTests() {
];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(4000);
return headerPage.getSpinnerDone();
})
.then(function () {
return verifyChartData(expectedBarChartData);
Expand All @@ -249,26 +260,29 @@ bdd.describe('discover app', function describeIndexTests() {

function verifyChartData(expectedBarChartData) {
return common.try(function tryingForTime() {
return discoverPage.getBarChartData()
.then(function compareData(paths) {
// the largest bars are over 100 pixels high so this is less than 1% tolerance
var barHeightTolerance = 1;
var stringResults = '';
var hasFailure = false;
for (var y = 0; y < expectedBarChartData.length; y++) {
stringResults += y + ': expected = ' + expectedBarChartData[y] + ', actual = ' + paths[y] +
', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance) + '\n';
if ((Math.abs(expectedBarChartData[y] - paths[y]) > barHeightTolerance)) {
hasFailure = true;
return headerPage.getSpinnerDone()
.then(function () {
return discoverPage.getBarChartData()
.then(function compareData(paths) {
// the largest bars are over 100 pixels high so this is less than 1% tolerance
var barHeightTolerance = 1;
var stringResults = '';
var hasFailure = false;
for (var y = 0; y < expectedBarChartData.length; y++) {
stringResults += y + ': expected = ' + expectedBarChartData[y] + ', actual = ' + paths[y] +
', Pass = ' + (Math.abs(expectedBarChartData[y] - paths[y]) < barHeightTolerance) + '\n';
if ((Math.abs(expectedBarChartData[y] - paths[y]) > barHeightTolerance)) {
hasFailure = true;
};
};
};
if (hasFailure) {
common.log(stringResults);
common.log(paths);
}
for (var x = 0; x < expectedBarChartData.length; x++) {
expect(Math.abs(expectedBarChartData[x] - paths[x]) < barHeightTolerance).to.be.ok();
}
if (hasFailure) {
common.log(stringResults);
common.log(paths);
}
for (var x = 0; x < expectedBarChartData.length; x++) {
expect(Math.abs(expectedBarChartData[x] - paths[x]) < barHeightTolerance).to.be.ok();
}
});
});
});

Expand Down
11 changes: 7 additions & 4 deletions test/functional/apps/discover/_field_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ bdd.describe('discover app', function describeIndexTests() {
bdd.it('search php should show the correct hit count', function () {
var expectedHitCount = '445';
return discoverPage.query('php')
.then(function () {
return headerPage.getSpinnerDone();
})
.then(function () {
return common.try(function tryingForTime() {
return discoverPage.getHitCount()
Expand All @@ -68,6 +71,9 @@ bdd.describe('discover app', function describeIndexTests() {
bdd.it('search _type:apache should show the correct hit count', function () {
var expectedHitCount = '11,156';
return discoverPage.query('_type:apache')
.then(function () {
return headerPage.getSpinnerDone();
})
.then(function () {
return common.try(function tryingForTime() {
return discoverPage.getHitCount()
Expand Down Expand Up @@ -213,10 +219,7 @@ bdd.describe('discover app', function describeIndexTests() {
+ ' 14:26:41.000';
return discoverPage.clickDocSortDown()
.then(function () {
// we don't technically need this sleep here because the tryForTime will retry and the
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
// case and it can be avoided with just a few seconds sleep.
return common.sleep(2000);
return headerPage.getSpinnerDone();
})
.then(function () {
return common.try(function tryingForTime() {
Expand Down
4 changes: 1 addition & 3 deletions test/functional/apps/discover/_shared_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ bdd.describe('shared links', function describeIndexTests() {
return headerPage.setAbsoluteRange(fromTime, toTime);
})
.then(function () {
//After hiding the time picker, we need to wait for
//the refresh button to hide before clicking the share button
return common.sleep(1000);
return headerPage.getSpinnerDone();
});
});

Expand Down
Loading