diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index f56b6f9de806..27d57abffa06 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -94,7 +94,7 @@ import { bdd.it('should show the correct hit count', function () { var expectedHitCount = '14,004'; - return common.tryForTime(20 * 1000, function tryingForTime() { + return common.try(function tryingForTime() { return discoverPage.getHitCount() .then(function compareData(hitCount) { expect(hitCount).to.be(expectedHitCount); @@ -243,7 +243,7 @@ import { function verifyChartData(expectedBarChartData) { - return common.tryForTime(20 * 1000, function tryingForTime() { + 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 diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index 753b3212bf7d..2fe40577106f 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -51,7 +51,7 @@ import { var expectedHitCount = '445'; return discoverPage.query('php') .then(function () { - return common.tryForTime(20 * 1000, function tryingForTime() { + return common.try(function tryingForTime() { return discoverPage.getHitCount() .then(function compareData(hitCount) { expect(hitCount).to.be(expectedHitCount); @@ -76,7 +76,7 @@ import { var expectedHitCount = '11,156'; return discoverPage.query('_type:apache') .then(function () { - return common.tryForTime(20 * 1000, function tryingForTime() { + return common.try(function tryingForTime() { return discoverPage.getHitCount() .then(function compareData(hitCount) { expect(hitCount).to.be(expectedHitCount); @@ -229,7 +229,7 @@ import { return common.sleep(2000); }) .then(function () { - return common.tryForTime(20 * 1000, function tryingForTime() { + return common.try(function tryingForTime() { return discoverPage.getDocTableIndex(1) .then(function (rowData) { expect(rowData).to.be(ExpectedDoc); diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 8c21f0254b06..b9f73003f042 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -102,7 +102,7 @@ import { bdd, common, discoverPage, headerPage, settingsPage, scenarioManager } var re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); return discoverPage.clickShortenUrl() .then(function () { - return common.tryForTime(20 * 1000, function tryingForTime() { + return common.try(function tryingForTime() { return discoverPage.getShortenedUrl() .then(function (actualUrl) { expect(actualUrl).to.match(re); diff --git a/test/functional/apps/settings/_index_pattern_create_delete.js b/test/functional/apps/settings/_index_pattern_create_delete.js index ac966c19ca68..3c18fd37222f 100644 --- a/test/functional/apps/settings/_index_pattern_create_delete.js +++ b/test/functional/apps/settings/_index_pattern_create_delete.js @@ -32,7 +32,7 @@ import { }); bdd.it('should have index pattern in url', function url() { - return common.tryForTime(5000, function () { + return common.try(function tryingForTime() { return remote.getCurrentUrl() .then(function (currentUrl) { expect(currentUrl).to.contain('logstash-*'); @@ -80,7 +80,7 @@ import { }); bdd.it('should return to index pattern creation page', function returnToPage() { - return common.tryForTime(5000, function () { + return common.try(function tryingForTime() { return settingsPage.getCreateButton(); }) .catch(common.handleError(this)); @@ -88,7 +88,7 @@ import { bdd.it('should remove index pattern from url', function indexNotInUrl() { // give the url time to settle - return common.tryForTime(5000, function () { + return common.try(function tryingForTime() { return remote.getCurrentUrl() .then(function (currentUrl) { common.debug('currentUrl = ' + currentUrl); diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 6e470e6869a9..5c2a6d6bc865 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -123,7 +123,7 @@ import { 683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29 ]; - return common.tryForTime(5000, function () { + return common.try(function tryingForTime() { return visualizePage.getXAxisLabels() .then(function compareLabels(labels) { common.debug('X-Axis labels = ' + labels); diff --git a/test/functional/apps/visualize/_metric_chart.js b/test/functional/apps/visualize/_metric_chart.js index d056078d1be5..3260bb113332 100644 --- a/test/functional/apps/visualize/_metric_chart.js +++ b/test/functional/apps/visualize/_metric_chart.js @@ -65,7 +65,7 @@ import { var expectedCount = ['14,004', 'Count']; // initial metric of "Count" is selected by default - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(expectedCount).to.eql(metricValue.split('\n')); @@ -88,7 +88,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(avgMachineRam).to.eql(metricValue.split('\n')); @@ -110,7 +110,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(sumPhpMemory).to.eql(metricValue.split('\n')); @@ -133,7 +133,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { // only comparing the text label! @@ -156,7 +156,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(minTimestamp).to.eql(metricValue.split('\n')); @@ -178,7 +178,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(maxRelatedContentArticleModifiedTime).to.eql(metricValue.split('\n')); @@ -204,7 +204,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(standardDeviationBytes).to.eql(metricValue.split('\n')); @@ -226,7 +226,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(uniqueCountClientip).to.eql(metricValue.split('\n')); @@ -264,7 +264,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(percentileMachineRam).to.eql(metricValue.split('\n')); @@ -290,7 +290,7 @@ import { return visualizePage.clickGo(); }) .then(function () { - return common.tryForTime(2000, function () { + return common.try(function tryingForTime() { return visualizePage.getMetric() .then(function (metricValue) { expect(percentileRankBytes).to.eql(metricValue.split('\n')); diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index 75340b90c833..76d8fc5ed951 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -61,7 +61,7 @@ import { }) .then(function () { common.debug('Click field geo.coordinates'); - return common.tryForTime(1000, function () { + return common.try(function tryingForTime() { return visualizePage.selectField('geo.coordinates'); }); }) diff --git a/test/support/pages/visualize_page.js b/test/support/pages/visualize_page.js index 69256693b421..4e47f2d79497 100644 --- a/test/support/pages/visualize_page.js +++ b/test/support/pages/visualize_page.js @@ -227,7 +227,7 @@ export default (function () { selectField: function selectField(fieldValue) { var self = this; - return common.try(function tryThis() { + return common.try(function tryingForTime() { return self.remote .setFindTimeout(defaultFindTimeout) // the css below should be more selective @@ -316,7 +316,7 @@ export default (function () { // verify that green message at the top of the page. // it's only there for about 5 seconds .then(function () { - return common.try(function tryThis() { + return common.try(function tryingForTime() { return self.remote .setFindTimeout(defaultFindTimeout) .findByCssSelector('kbn-truncated.toast-message.ng-isolate-scope') @@ -346,7 +346,7 @@ export default (function () { var self = this; common.debug('clickVisualizationByLinkText(' + vizName + ')'); - return common.try(function tryThis() { + return common.try(function tryingForTime() { return self.remote .setFindTimeout(defaultFindTimeout) .findByLinkText(vizName) @@ -664,7 +664,7 @@ export default (function () { waitForToastMessageGone: function waitForToastMessageGone() { var self = this; - return common.try(function tryThis() { + return common.try(function tryingForTime() { return self.remote .setFindTimeout(100) .findAllByCssSelector('kbn-truncated.toast-message.ng-isolate-scope')