diff --git a/.eslintrc b/.eslintrc index 1904222b3cfa9..76c42539c061c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,6 @@ extends: '@elastic/kibana' rules: no-unused-vars: off - no-var: off prefer-const: off no-extra-semi: off quotes: off diff --git a/src/core_plugins/kibana/public/management/sections/indices/add_data_steps/pipeline_setup/lib/keys_deep.js b/src/core_plugins/kibana/public/management/sections/indices/add_data_steps/pipeline_setup/lib/keys_deep.js index 6485f55344d81..5b5976583f132 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/add_data_steps/pipeline_setup/lib/keys_deep.js +++ b/src/core_plugins/kibana/public/management/sections/indices/add_data_steps/pipeline_setup/lib/keys_deep.js @@ -5,7 +5,7 @@ export default function keysDeep(object, base) { let delimitedBase = base ? base + '.' : ''; _.forEach(object, (value, key) => { - var fullKey = delimitedBase + key; + let fullKey = delimitedBase + key; if (_.isPlainObject(value)) { result = result.concat(keysDeep(value, fullKey)); } else { diff --git a/src/core_plugins/kibana/public/management/sections/indices/filebeat/directives/filebeat_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/filebeat/directives/filebeat_wizard.js index a454cd8d88349..fa2967f8cebc3 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/filebeat/directives/filebeat_wizard.js +++ b/src/core_plugins/kibana/public/management/sections/indices/filebeat/directives/filebeat_wizard.js @@ -20,11 +20,11 @@ modules.get('apps/management') const ingest = Private(IngestProvider); const $state = this.state = new AppState(); - var notify = new Notifier({ + let notify = new Notifier({ location: 'Add Data' }); - var totalSteps = 4; + let totalSteps = 4; this.stepResults = {}; this.setCurrentStep = (step) => { diff --git a/src/core_plugins/kibana/public/management/sections/indices/upload/directives/upload_wizard.js b/src/core_plugins/kibana/public/management/sections/indices/upload/directives/upload_wizard.js index ec455e8eb2dff..92c79fe01d152 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/upload/directives/upload_wizard.js +++ b/src/core_plugins/kibana/public/management/sections/indices/upload/directives/upload_wizard.js @@ -19,11 +19,11 @@ modules.get('apps/management') const ingest = Private(IngestProvider); const $state = this.state = new AppState(); - var notify = new Notifier({ + let notify = new Notifier({ location: 'Add Data' }); - var totalSteps = 3; + let totalSteps = 3; this.stepResults = {}; this.setCurrentStep = (step) => { diff --git a/src/core_plugins/table_vis/public/table_vis_controller.js b/src/core_plugins/table_vis/public/table_vis_controller.js index 1d7af7d3c1b7e..15e1cc40ed0b1 100644 --- a/src/core_plugins/table_vis/public/table_vis_controller.js +++ b/src/core_plugins/table_vis/public/table_vis_controller.js @@ -11,7 +11,7 @@ const module = uiModules.get('kibana/table_vis', ['kibana']); module.controller('KbnTableVisController', function ($scope, Private) { const tabifyAggResponse = Private(AggResponseTabifyTabifyProvider); - var uiStateSort = ($scope.uiState) ? $scope.uiState.get('vis.params.sort') : {}; + let uiStateSort = ($scope.uiState) ? $scope.uiState.get('vis.params.sort') : {}; assign($scope.vis.params.sort, uiStateSort); $scope.sort = $scope.vis.params.sort; diff --git a/src/fixtures/mock_ui_state.js b/src/fixtures/mock_ui_state.js index 50d913ae337e8..5f5b90e38eb3d 100644 --- a/src/fixtures/mock_ui_state.js +++ b/src/fixtures/mock_ui_state.js @@ -10,4 +10,4 @@ export default { }, on: _.noop, off: _.noop -} +}; diff --git a/src/ui/public/directives/__tests__/paginated_selectable_list.js b/src/ui/public/directives/__tests__/paginated_selectable_list.js index eb18304b478ff..a066d470b4497 100644 --- a/src/ui/public/directives/__tests__/paginated_selectable_list.js +++ b/src/ui/public/directives/__tests__/paginated_selectable_list.js @@ -21,9 +21,9 @@ let stringList = [ let lists = [objectList, stringList, []]; -var $scope; -var $element; -var $isolatedScope; +let $scope; +let $element; +let $isolatedScope; lists.forEach(function (list) { let isArrayOfObjects = list.every((item) => { diff --git a/src/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js b/src/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js index 36614f1e9b7e9..bdb9759052e0d 100644 --- a/src/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js +++ b/src/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js @@ -303,7 +303,7 @@ describe('KbnTopNavController', function () { expect(controller.menuItems).to.have.length(4); // check that the items were added - var matches = controller.menuItems.reduce((acc, item) => { + let matches = controller.menuItems.reduce((acc, item) => { if (item.key === 'green' || item.key === 'red') { acc[item.key] = item; } @@ -324,7 +324,7 @@ describe('KbnTopNavController', function () { expect(controller.menuItems).to.have.length(3); // check that the items were added - var match = controller.menuItems.filter((item) => { + let match = controller.menuItems.filter((item) => { return item.key === 'green'; }); expect(match[0]).to.have.property('run'); diff --git a/src/ui/public/paginated_table/__tests__/index.js b/src/ui/public/paginated_table/__tests__/index.js index 34eea5692ab8c..945118d794a70 100644 --- a/src/ui/public/paginated_table/__tests__/index.js +++ b/src/ui/public/paginated_table/__tests__/index.js @@ -165,7 +165,7 @@ describe('paginated table', function () { paginatedTable.sortColumn(1); $scope.$digest(); - var tableRows = $el.find('tbody tr'); + let tableRows = $el.find('tbody tr'); expect(tableRows.eq(2).find('td').eq(1).text()).to.be('cccc'); expect(tableRows.eq(1).find('td').eq(1).text()).to.be('bbbb'); expect(tableRows.eq(0).find('td').eq(1).text()).to.be('aaaa'); @@ -175,7 +175,7 @@ describe('paginated table', function () { paginatedTable.sortColumn(1, 'desc'); $scope.$digest(); - var tableRows = $el.find('tbody tr'); + let tableRows = $el.find('tbody tr'); expect(tableRows.eq(0).find('td').eq(1).text()).to.be('zzzz'); expect(tableRows.eq(1).find('td').eq(1).text()).to.be('cccc'); expect(tableRows.eq(2).find('td').eq(1).text()).to.be('bbbb'); diff --git a/src/ui/public/pattern_checker/pattern_checker.js b/src/ui/public/pattern_checker/pattern_checker.js index 5ac8834d8a8e8..134bfce760f61 100644 --- a/src/ui/public/pattern_checker/pattern_checker.js +++ b/src/ui/public/pattern_checker/pattern_checker.js @@ -17,7 +17,7 @@ module.directive('patternChecker', function () { controller: function (Notifier, $scope, $timeout, $http) { let validationTimeout; - var notify = new Notifier({ + let notify = new Notifier({ location: 'Add Data' }); diff --git a/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js b/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js index ce07621a41d93..2ec53d8c8e990 100644 --- a/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js +++ b/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js @@ -173,9 +173,9 @@ describe('Vislib Split Function Test Suite', function () { }); describe('chart title split function', function () { - var visEl; - var newEl; - var fixture; + let visEl; + let newEl; + let fixture; beforeEach(ngMock.inject(function () { visEl = el.append('div').attr('class', 'vis-wrapper'); diff --git a/tasks/build/babel_options.js b/tasks/build/babel_options.js index 586e3cedd0e3a..9c8db68e28310 100644 --- a/tasks/build/babel_options.js +++ b/tasks/build/babel_options.js @@ -1,9 +1,9 @@ module.exports = function (grunt) { - var srcFile = 'build/kibana/src/optimize/babel_options.js'; - var buildFile = 'build/kibana/src/optimize/babel_options.build.js'; - var rename = require('fs').renameSync; - var unlink = require('fs').unlinkSync; + let srcFile = 'build/kibana/src/optimize/babel_options.js'; + let buildFile = 'build/kibana/src/optimize/babel_options.build.js'; + let rename = require('fs').renameSync; + let unlink = require('fs').unlinkSync; grunt.registerTask('_build:babelOptions', function () { unlink(srcFile); diff --git a/tasks/build/download_node_builds.js b/tasks/build/download_node_builds.js index cb74b55cec446..e74e2e8db3551 100644 --- a/tasks/build/download_node_builds.js +++ b/tasks/build/download_node_builds.js @@ -65,8 +65,8 @@ module.exports = function (grunt) { activeDownloads.push(platform); - var bytes = parseInt(resp.headers['content-length'], 10) || 'unknown number of'; - var mb = ((bytes / 1024) / 1024).toFixed(2); + let bytes = parseInt(resp.headers['content-length'], 10) || 'unknown number of'; + let mb = ((bytes / 1024) / 1024).toFixed(2); grunt.log.ok(`downloading ${platform.name} - ${mb} mb`); }; diff --git a/tasks/build/install_npm_deps.js b/tasks/build/install_npm_deps.js index e7198706f5c58..efebb5e5ac34b 100644 --- a/tasks/build/install_npm_deps.js +++ b/tasks/build/install_npm_deps.js @@ -1,6 +1,6 @@ module.exports = function (grunt) { - var { exec } = require('child_process'); - var { resolve } = require('path'); + let { exec } = require('child_process'); + let { resolve } = require('path'); grunt.registerTask('_build:installNpmDeps', function () { grunt.file.mkdir('build/kibana/node_modules'); diff --git a/tasks/build/shasums.js b/tasks/build/shasums.js index cb0b405c2ad2c..f6bc6a6ba8100 100644 --- a/tasks/build/shasums.js +++ b/tasks/build/shasums.js @@ -1,12 +1,12 @@ -var { promisify } = require('bluebird'); -var readdir = promisify(require('fs').readdir); -var exec = promisify(require('child_process').exec); -var platform = require('os').platform(); -var cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum '; +let { promisify } = require('bluebird'); +let readdir = promisify(require('fs').readdir); +let exec = promisify(require('child_process').exec); +let platform = require('os').platform(); +let cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum '; module.exports = function (grunt) { grunt.registerTask('_build:shasums', function () { - var targetDir = grunt.config.get('target'); + let targetDir = grunt.config.get('target'); // for when shasums is run but archives and ospackages was not grunt.file.mkdir(targetDir); diff --git a/tasks/config/eslint.js b/tasks/config/eslint.js index d302a59299387..7314928335a45 100644 --- a/tasks/config/eslint.js +++ b/tasks/config/eslint.js @@ -1,4 +1,4 @@ -var resolve = require('path').resolve; +let resolve = require('path').resolve; module.exports = function (grunt) { return { diff --git a/tasks/config/esvm.js b/tasks/config/esvm.js index 91ebfb7b40b0e..52600ae78c941 100644 --- a/tasks/config/esvm.js +++ b/tasks/config/esvm.js @@ -1,8 +1,8 @@ module.exports = function (grunt) { - var resolve = require('path').resolve; - var directory = resolve(__dirname, '../../esvm'); - var dataDir = resolve(directory, 'data_dir'); - var serverConfig = require('../../test/server_config'); + let resolve = require('path').resolve; + let directory = resolve(__dirname, '../../esvm'); + let dataDir = resolve(directory, 'data_dir'); + let serverConfig = require('../../test/server_config'); return { options: { diff --git a/tasks/config/intern.js b/tasks/config/intern.js index 75d9567b364c1..8fc678855251e 100644 --- a/tasks/config/intern.js +++ b/tasks/config/intern.js @@ -1,4 +1,4 @@ -var path = require('path'); +let path = require('path'); module.exports = function (grunt) { diff --git a/tasks/config/s3.js b/tasks/config/s3.js index 19a1491412e2c..c9c1ff0e1a68b 100644 --- a/tasks/config/s3.js +++ b/tasks/config/s3.js @@ -1,5 +1,5 @@ module.exports = function (grunt) { - var { config } = grunt; + let { config } = grunt; return { release: { diff --git a/tasks/lint_staged_files.js b/tasks/lint_staged_files.js index e7c2f95752d13..07d13efca4889 100644 --- a/tasks/lint_staged_files.js +++ b/tasks/lint_staged_files.js @@ -8,7 +8,7 @@ export default function (grunt) { grunt.task.requires('collectFilesToCommit'); // match these patterns - var patterns = grunt.config.get('eslint.source.files.src'); + let patterns = grunt.config.get('eslint.source.files.src'); if (!patterns) grunt.fail.warn('eslint file pattern is not defined'); const files = grunt.config diff --git a/tasks/release_packages.js b/tasks/release_packages.js index 23701a91589fa..87accb94fd524 100644 --- a/tasks/release_packages.js +++ b/tasks/release_packages.js @@ -59,7 +59,7 @@ export default (grunt) => { grunt.fail.fatal('Aborting publish'); } - var rl = readline.createInterface({ + let rl = readline.createInterface({ input: process.stdin, output: process.stdout }); diff --git a/tasks/sterilize.js b/tasks/sterilize.js index 11b827e5bbe62..7e194d440e9df 100644 --- a/tasks/sterilize.js +++ b/tasks/sterilize.js @@ -26,7 +26,7 @@ export default function (grunt) { rl.on('close', this.async()); rl.question(`\n${danger} Do you really want to delete all of the above files?, [N/y] `, function (resp) { - var yes = resp.toLowerCase().trim()[0] === 'y'; + let yes = resp.toLowerCase().trim()[0] === 'y'; rl.close(); if (yes) { diff --git a/tasks/utils/install_or_update_repo.js b/tasks/utils/install_or_update_repo.js index 588d43b63fd8f..f803cf33d5801 100644 --- a/tasks/utils/install_or_update_repo.js +++ b/tasks/utils/install_or_update_repo.js @@ -1,12 +1,12 @@ -var Promise = require('bluebird'); -var spawn = require('./spawn'); -var grunt = require('grunt'); +let Promise = require('bluebird'); +let spawn = require('./spawn'); +let grunt = require('grunt'); module.exports = function (repo, dir) { // store the previous and new hash from the repo // to know if there was an update from fetch - var prevHash; - var newHash; + let prevHash; + let newHash; return Promise.resolve() .then(function () { diff --git a/tasks/utils/update_version.js b/tasks/utils/update_version.js index 5180069ae2b96..e38436ab08cf2 100644 --- a/tasks/utils/update_version.js +++ b/tasks/utils/update_version.js @@ -1,8 +1,8 @@ -var _ = require('lodash'); +let _ = require('lodash'); module.exports = updateVersion; -var versions = [ +let versions = [ 'major', 'minor', 'patch', @@ -44,7 +44,7 @@ var versions = [ function updateVersion(version, expr) { expr = String(expr).split('='); - var change = { + let change = { name: expr[0], val: expr[1] || null }; @@ -58,7 +58,7 @@ function updateVersion(version, expr) { } // parse the current version - var parts = _.chain(version.split('.')) + let parts = _.chain(version.split('.')) // ensure that their are three pieces, either x.x.x or x.x.x-y .tap(function (versionNumbers) { @@ -70,7 +70,7 @@ function updateVersion(version, expr) { // describe all of the version parts with a name, parse // the numbers, and extract tag from patch .transform(function (parts, v, i) { - var name = versions[i]; + let name = versions[i]; if (name !== 'patch') { parts[name] = _.parseInt(v); @@ -86,7 +86,7 @@ function updateVersion(version, expr) { // sanity check .tap(function (parts) { - var valid = true; + let valid = true; valid = valid && _.isNumber(parts.major); valid = valid && _.isNumber(parts.minor); valid = valid && _.isNumber(parts.patch); @@ -121,7 +121,7 @@ function updateVersion(version, expr) { } // properties that are zero-d by the previous update - var emptyUpdates = versions.slice(versions.indexOf(change.name) + 1); + let emptyUpdates = versions.slice(versions.indexOf(change.name) + 1); while (emptyUpdates.length) { parts[emptyUpdates.shift()] = ''; } diff --git a/test/fixtures/__tests__/scenario_manager.js b/test/fixtures/__tests__/scenario_manager.js index 144f6c1cfaa80..fd271a388d6f8 100644 --- a/test/fixtures/__tests__/scenario_manager.js +++ b/test/fixtures/__tests__/scenario_manager.js @@ -1,18 +1,18 @@ -var expect = require('expect.js'); -var sinon = require('sinon'); -var Promise = require('bluebird'); +let expect = require('expect.js'); +let sinon = require('sinon'); +let Promise = require('bluebird'); -var ScenarioManager = require('../scenario_manager'); +let ScenarioManager = require('../scenario_manager'); describe('scenario manager', function () { - var manager = new ScenarioManager('http://localhost:9200'); + let manager = new ScenarioManager('http://localhost:9200'); describe('loading and unloading', function () { this.timeout(60000); - var bulk; - var create; - var indicesDelete; + let bulk; + let create; + let indicesDelete; beforeEach(function () { bulk = sinon.stub(manager.client, 'bulk', Promise.resolve); create = sinon.stub(manager.client.indices, 'create', Promise.resolve); @@ -43,9 +43,9 @@ describe('scenario manager', function () { }); it('should be able to reload a scenario', function () { - var load = sinon.stub(manager, 'load', Promise.resolve); - var unload = sinon.stub(manager, 'unload', Promise.resolve); - var id = 'makelogs'; + let load = sinon.stub(manager, 'load', Promise.resolve); + let unload = sinon.stub(manager, 'unload', Promise.resolve); + let id = 'makelogs'; return manager.reload(id).then(function () { expect(load.calledWith(id)).to.be(true); expect(unload.calledWith(id)).to.be(true); @@ -56,9 +56,9 @@ describe('scenario manager', function () { }); it('should load if the index does not exist', function () { - var load = sinon.stub(manager, 'load', Promise.resolve); - var throwError = sinon.stub(manager.client, 'count', Promise.reject); - var id = 'makelogs'; + let load = sinon.stub(manager, 'load', Promise.resolve); + let throwError = sinon.stub(manager.client, 'count', Promise.reject); + let id = 'makelogs'; return manager.loadIfEmpty(id).then(function () { expect(load.calledWith(id)).to.be(true); @@ -68,13 +68,13 @@ describe('scenario manager', function () { }); it('should load if the index is empty', function () { - var load = sinon.stub(manager, 'load', Promise.resolve); - var returnZero = sinon.stub(manager.client, 'count', function () { + let load = sinon.stub(manager, 'load', Promise.resolve); + let returnZero = sinon.stub(manager.client, 'count', function () { return Promise.resolve({ 'count': 0 }); }); - var id = 'makelogs'; + let id = 'makelogs'; return manager.loadIfEmpty(id).then(function () { expect(load.calledWith(id)).to.be(true); @@ -85,13 +85,13 @@ describe('scenario manager', function () { it('should not load if the index is not empty', function () { - var load = sinon.stub(manager, 'load', Promise.resolve); - var returnOne = sinon.stub(manager.client, 'count', function () { + let load = sinon.stub(manager, 'load', Promise.resolve); + let returnOne = sinon.stub(manager.client, 'count', function () { return Promise.resolve({ 'count': 1 }); }); - var id = 'makelogs'; + let id = 'makelogs'; return manager.loadIfEmpty(id).then(function () { expect(load.called).to.be(false); diff --git a/test/fixtures/config.js b/test/fixtures/config.js index b9acf71b8e1cc..911d6caa74dcd 100644 --- a/test/fixtures/config.js +++ b/test/fixtures/config.js @@ -1,5 +1,5 @@ -var path = require('path'); -var rootDir = path.join(__dirname, 'scenarios'); +let path = require('path'); +let rootDir = path.join(__dirname, 'scenarios'); module.exports = { scenarios: { diff --git a/test/fixtures/scenario_manager.js b/test/fixtures/scenario_manager.js index d4f071358d369..24965de1b2b29 100644 --- a/test/fixtures/scenario_manager.js +++ b/test/fixtures/scenario_manager.js @@ -1,7 +1,7 @@ -var path = require('path'); -var elasticsearch = require('elasticsearch'); -var Promise = require('bluebird'); -var config = require('./config').scenarios; +let path = require('path'); +let elasticsearch = require('elasticsearch'); +let Promise = require('bluebird'); +let config = require('./config').scenarios; function ScenarioManager(server) { if (!server) throw new Error('No server defined'); @@ -23,14 +23,14 @@ function ScenarioManager(server) { * @return {Promise} A promise that is resolved when elasticsearch has a response */ ScenarioManager.prototype.load = function (id) { - var self = this; - var scenario = config[id]; + let self = this; + let scenario = config[id]; if (!scenario) return Promise.reject('No scenario found for ' + id); return Promise.all(scenario.bulk.map(function mapBulk(bulk) { - var loadIndexDefinition; + let loadIndexDefinition; if (bulk.indexDefinition) { - var body = require(path.join(scenario.baseDir, bulk.indexDefinition)); + let body = require(path.join(scenario.baseDir, bulk.indexDefinition)); loadIndexDefinition = self.client.indices.create({ index: bulk.indexName, body: body @@ -41,7 +41,7 @@ ScenarioManager.prototype.load = function (id) { return loadIndexDefinition .then(function bulkRequest() { - var body = require(path.join(scenario.baseDir, bulk.source)); + let body = require(path.join(scenario.baseDir, bulk.source)); return self.client.bulk({ body: body }); @@ -71,10 +71,10 @@ ScenarioManager.prototype.load = function (id) { * @return {Promise} A promise that is resolved when elasticsearch has a response */ ScenarioManager.prototype.unload = function (id) { - var scenario = config[id]; + let scenario = config[id]; if (!scenario) return Promise.reject('No scenario found for ' + id); - var indices = scenario.bulk.map(function mapBulk(bulk) { + let indices = scenario.bulk.map(function mapBulk(bulk) { return bulk.indexName; }); @@ -96,7 +96,7 @@ ScenarioManager.prototype.unload = function (id) { * @return {Promise} A promise that is resolved when elasticsearch has a response */ ScenarioManager.prototype.reload = function (id) { - var self = this; + let self = this; return self.unload(id) .then(function load() { @@ -120,12 +120,12 @@ ScenarioManager.prototype.deleteAll = function () { * @return {Promise} A promise that is resolved when elasticsearch has a response */ ScenarioManager.prototype.loadIfEmpty = function (id) { - var self = this; - var scenario = config[id]; + let self = this; + let scenario = config[id]; if (!scenario) throw new Error('No scenario found for ' + id); return Promise.all(scenario.bulk.map(function mapBulk(bulk) { - var loadIndexDefinition; + let loadIndexDefinition; return self.client.count({ index: bulk.indexName diff --git a/test/functional/apps/console/_console.js b/test/functional/apps/console/_console.js index 32881b4ebf3b8..69259c7cf947b 100644 --- a/test/functional/apps/console/_console.js +++ b/test/functional/apps/console/_console.js @@ -15,7 +15,7 @@ bdd.describe('console app', function describeIndexTests() { }); bdd.it('should show the default request', function () { - var expectedRequest = [ + let expectedRequest = [ 'GET _search', '{', ' "query": {', @@ -39,7 +39,7 @@ bdd.describe('console app', function describeIndexTests() { }); bdd.it('default request response should contain .kibana' , function () { - var expectedResponseContains = '"_index": ".kibana",'; + let expectedResponseContains = '"_index": ".kibana",'; return PageObjects.console.clickPlay() .then(function () { PageObjects.common.saveScreenshot('Console-default-request'); diff --git a/test/functional/apps/dashboard/_dashboard.js b/test/functional/apps/dashboard/_dashboard.js index 2009a7be42717..523b84dafebe6 100644 --- a/test/functional/apps/dashboard/_dashboard.js +++ b/test/functional/apps/dashboard/_dashboard.js @@ -13,7 +13,7 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('dashboard tab', function describeIndexTests() { bdd.before(function () { PageObjects.common.debug('Starting dashboard before method'); - var logstash = scenarioManager.loadIfEmpty('logstashFunctional'); + let logstash = scenarioManager.loadIfEmpty('logstashFunctional'); // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) // and load a set of makelogs data @@ -32,7 +32,7 @@ bdd.describe('dashboard tab', function describeIndexTests() { }); bdd.describe('add visualizations to dashboard', function dashboardTest() { - var visualizations = ['Visualization漢字 AreaChart', + let visualizations = ['Visualization漢字 AreaChart', 'Visualization☺漢字 DataTable', 'Visualization漢字 LineChart', 'Visualization PieChart', @@ -61,8 +61,8 @@ bdd.describe('dashboard tab', function describeIndexTests() { }); bdd.it('set the timepicker time to that which contains our test data', function setTimepicker() { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; // .then(function () { PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"'); @@ -111,7 +111,7 @@ bdd.describe('dashboard tab', function describeIndexTests() { }); bdd.it('should have all the expected initial sizes', function checkVisualizationSizes() { - var visObjects = [ { dataCol: '1', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization漢字 AreaChart' }, + let visObjects = [ { dataCol: '1', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization漢字 AreaChart' }, { dataCol: '4', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization☺漢字 DataTable' }, { dataCol: '7', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization漢字 LineChart' }, { dataCol: '10', dataRow: '1', dataSizeX: '3', dataSizeY: '2', title: 'Visualization PieChart' }, diff --git a/test/functional/apps/discover/_collapse_expand.js b/test/functional/apps/discover/_collapse_expand.js index 1f44f0bd10845..91b9f7253c2be 100644 --- a/test/functional/apps/discover/_collapse_expand.js +++ b/test/functional/apps/discover/_collapse_expand.js @@ -12,8 +12,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('discover tab', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index d81d7aa73a743..9e0fefa43fce6 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -12,8 +12,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('discover app', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) @@ -37,12 +37,12 @@ bdd.describe('discover app', function describeIndexTests() { bdd.describe('query', function () { - var queryName1 = 'Query # 1'; - var fromTimeString = 'September 19th 2015, 06:31:44.000'; - var toTimeString = 'September 23rd 2015, 18:31:44.000'; + let queryName1 = 'Query # 1'; + let fromTimeString = 'September 19th 2015, 06:31:44.000'; + let toTimeString = 'September 23rd 2015, 18:31:44.000'; bdd.it('should show correct time range string by timepicker', function () { - var expectedTimeRangeString = fromTimeString + ' to ' + toTimeString; + let expectedTimeRangeString = fromTimeString + ' to ' + toTimeString; return PageObjects.discover.getTimespanText() .then(function (actualTimeString) { expect(actualTimeString).to.be(expectedTimeRangeString); @@ -50,7 +50,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('save query should show toast message and display query name', function () { - var expectedSavedQueryMessage = 'Discover: Saved Data Source "' + queryName1 + '"'; + let expectedSavedQueryMessage = 'Discover: Saved Data Source "' + queryName1 + '"'; return PageObjects.discover.saveSearch(queryName1) .then(function () { return PageObjects.header.getToastMessage(); @@ -85,7 +85,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show the correct hit count', function () { - var expectedHitCount = '14,004'; + let expectedHitCount = '14,004'; return PageObjects.common.try(function tryingForTime() { return PageObjects.discover.getHitCount() .then(function compareData(hitCount) { @@ -95,7 +95,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show the correct bar chart', function () { - var expectedBarChartData = [ '3.237', + let expectedBarChartData = [ '3.237', '17.674', '64.75', '125.737', '119.962', '65.712', '16.449', '2.712', '3.675', '17.674', '59.762', '119.087', '123.812', '61.862', '15.487', '2.362', '2.800', '15.312', '61.862', '123.2', @@ -108,7 +108,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct time range string in chart', function () { - var expectedTimeRangeString = fromTimeString + ' - ' + toTimeString; + let expectedTimeRangeString = fromTimeString + ' - ' + toTimeString; return PageObjects.discover.getChartTimespan() .then(function (actualTimeString) { expect(actualTimeString).to.be(expectedTimeRangeString); @@ -116,7 +116,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct initial chart interval of 3 hours', function () { - var expectedChartInterval = 'by 3 hours'; + let expectedChartInterval = 'by 3 hours'; return PageObjects.discover.getChartInterval() .then(function (actualInterval) { expect(actualInterval).to.be(expectedChartInterval); @@ -124,8 +124,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Hourly', function () { - var chartInterval = 'Hourly'; - var expectedBarChartData = [ '1.527', '2.290', + let chartInterval = 'Hourly'; + let expectedBarChartData = [ '1.527', '2.290', '5.599', '7.890', '13.236', '30.290', '46.072', '55.490', '86.8', '112', '122.181', '131.6', '132.872', '113.527', '102.581', '81.709', '65.672', '43.781', '24.181', '14', '9.672', '6.109', @@ -148,8 +148,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Daily', function () { - var chartInterval = 'Daily'; - var expectedBarChartData = [ + let chartInterval = 'Daily'; + let expectedBarChartData = [ '133.196', '129.192', '129.724' ]; return PageObjects.discover.setChartInterval(chartInterval) @@ -162,8 +162,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Weekly', function () { - var chartInterval = 'Weekly'; - var expectedBarChartData = [ '66.598', '129.458']; + let chartInterval = 'Weekly'; + let expectedBarChartData = [ '66.598', '129.458']; return PageObjects.discover.setChartInterval(chartInterval) .then(function () { return PageObjects.common.sleep(2000); @@ -174,8 +174,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('browser back button should show previous interval Daily', function () { - var expectedChartInterval = 'Daily'; - var expectedBarChartData = [ + let expectedChartInterval = 'Daily'; + let expectedBarChartData = [ '133.196', '129.192', '129.724' ]; return this.remote.goBack() @@ -193,8 +193,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Monthly', function () { - var chartInterval = 'Monthly'; - var expectedBarChartData = [ '122.535']; + let chartInterval = 'Monthly'; + let expectedBarChartData = [ '122.535']; return PageObjects.discover.setChartInterval(chartInterval) .then(function () { return PageObjects.common.sleep(2000); @@ -205,8 +205,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Yearly', function () { - var chartInterval = 'Yearly'; - var expectedBarChartData = [ '122.535']; + let chartInterval = 'Yearly'; + let expectedBarChartData = [ '122.535']; return PageObjects.discover.setChartInterval(chartInterval) .then(function () { return PageObjects.common.sleep(2000); @@ -217,8 +217,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show correct data for chart interval Auto', function () { - var chartInterval = 'Auto'; - var expectedBarChartData = [ '3.237', + let chartInterval = 'Auto'; + let expectedBarChartData = [ '3.237', '17.674', '64.75', '125.737', '119.962', '65.712', '16.449', '2.712', '3.675', '17.674', '59.762', '119.087', '123.812', '61.862', '15.487', '2.362', '2.800', '15.312', '61.862', '123.2', @@ -234,7 +234,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('should show Auto chart interval of 3 hours', function () { - var expectedChartInterval = 'by 3 hours'; + let expectedChartInterval = 'by 3 hours'; return PageObjects.discover.getChartInterval() .then(function (actualInterval) { expect(actualInterval).to.be(expectedChartInterval); @@ -252,10 +252,10 @@ bdd.describe('discover app', function describeIndexTests() { return PageObjects.discover.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++) { + let barHeightTolerance = 1; + let stringResults = ''; + let hasFailure = false; + for (let 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)) { @@ -266,7 +266,7 @@ bdd.describe('discover app', function describeIndexTests() { PageObjects.common.log(stringResults); PageObjects.common.log(paths); } - for (var x = 0; x < expectedBarChartData.length; x++) { + for (let x = 0; x < expectedBarChartData.length; x++) { expect(Math.abs(expectedBarChartData[x] - paths[x]) < barHeightTolerance).to.be.ok(); } }); @@ -277,8 +277,8 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.describe('query #2, which has an empty time range', function () { - var fromTime = '1999-06-11 09:22:11.000'; - var toTime = '1999-06-12 11:21:04.000'; + let fromTime = '1999-06-11 09:22:11.000'; + let toTime = '1999-06-12 11:21:04.000'; bdd.before(() => { PageObjects.common.debug('setAbsoluteRangeForAnotherQuery'); diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index 5123a54178cc8..35a33bdd331b3 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -12,8 +12,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('discover app', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) @@ -37,12 +37,12 @@ bdd.describe('discover app', function describeIndexTests() { bdd.describe('field data', function () { - var queryName1 = 'Query # 1'; - var fromTimeString = 'September 19th 2015, 06:31:44.000'; - var toTimeString = 'September 23rd 2015, 18:31:44.000'; + let queryName1 = 'Query # 1'; + let fromTimeString = 'September 19th 2015, 06:31:44.000'; + let toTimeString = 'September 23rd 2015, 18:31:44.000'; bdd.it('search php should show the correct hit count', function () { - var expectedHitCount = '445'; + let expectedHitCount = '445'; return PageObjects.discover.query('php') .then(function () { return PageObjects.common.try(function tryingForTime() { @@ -65,7 +65,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('search _type:apache should show the correct hit count', function () { - var expectedHitCount = '11,156'; + let expectedHitCount = '11,156'; return PageObjects.discover.query('_type:apache') .then(function () { return PageObjects.common.try(function tryingForTime() { @@ -78,7 +78,7 @@ bdd.describe('discover app', function describeIndexTests() { }); bdd.it('doc view should show Time and _source columns', function () { - var expectedHeader = 'Time _source'; + let expectedHeader = 'Time _source'; return PageObjects.discover.getDocHeader() .then(function (header) { expect(header).to.be(expectedHeader); @@ -87,7 +87,7 @@ bdd.describe('discover app', function describeIndexTests() { bdd.it('doc view should show oldest time first', function () { // Note: Could just check the timestamp, but might as well check that the whole doc is as expected. - var ExpectedDoc = + let ExpectedDoc = 'September 22nd 2015, 23:50:13.253 index:logstash-2015.09.22 @timestamp:September 22nd 2015, 23:50:13.253' + ' ip:238.171.34.42 extension:jpg response:200 geo.coordinates:{ "lat": 38.66494528, "lon": -88.45299556' + ' } geo.src:FR geo.dest:KH geo.srcdest:FR:KH @tags:success, info utc_time:September 22nd 2015,' @@ -138,7 +138,7 @@ bdd.describe('discover app', function describeIndexTests() { bdd.it('doc view should sort ascending', function () { // Note: Could just check the timestamp, but might as well check that the whole doc is as expected. - var ExpectedDoc = + let ExpectedDoc = 'September 20th 2015, 00:00:00.000 index:logstash-2015.09.20 @timestamp:September 20th 2015, 00:00:00.000' + ' ip:143.84.142.7 extension:jpg response:200 geo.coordinates:{ "lat": 38.68407028, "lon": -120.9871642 }' + ' geo.src:ES geo.dest:US geo.srcdest:ES:US @tags:error, info utc_time:September 20th 2015, 00:00:00.000' @@ -230,8 +230,8 @@ bdd.describe('discover app', function describeIndexTests() { bdd.it('a bad syntax query should show an error message', function () { - var expectedHitCount = '1011,156'; - var expectedError = 'Discover: Failed to parse query [xxx(yyy]'; + let expectedHitCount = '1011,156'; + let expectedError = 'Discover: Failed to parse query [xxx(yyy]'; return PageObjects.discover.query('xxx(yyy') .then(function () { return PageObjects.header.getToastMessage(); diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 6e3fc4e886fbe..1f54f5b722058 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -11,18 +11,18 @@ import { import PageObjects from '../../../support/page_objects'; bdd.describe('shared links', function describeIndexTests() { - var baseUrl; + let baseUrl; // The message changes for Firefox < 41 and Firefox >= 41 // var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.'; // var expectedToastMessage = 'Share search: URL copied to clipboard.'; // Pass either one. - var expectedToastMessage = /Share search: URL (selected\. Press Ctrl\+C to copy\.|copied to clipboard\.)/; + let expectedToastMessage = /Share search: URL (selected\. Press Ctrl\+C to copy\.|copied to clipboard\.)/; bdd.before(function () { baseUrl = PageObjects.common.getHostPort(); - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) @@ -52,7 +52,7 @@ bdd.describe('shared links', function describeIndexTests() { bdd.describe('shared link', function () { bdd.it('should show "Share a link" caption', function () { - var expectedCaption = 'Share a link'; + let expectedCaption = 'Share a link'; return PageObjects.discover.clickShare() .then(function () { PageObjects.common.saveScreenshot('Discover-share-link'); @@ -64,7 +64,7 @@ bdd.describe('shared links', function describeIndexTests() { }); bdd.it('should show the correct formatted URL', function () { - var expectedUrl = baseUrl + let expectedUrl = baseUrl + '/app/kibana?_t=1453775307251#' + '/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time' + ':(from:\'2015-09-19T06:31:44.000Z\',mode:absolute,to:\'2015-09' @@ -95,7 +95,7 @@ bdd.describe('shared links', function describeIndexTests() { // TODO: verify clipboard contents bdd.it('shorten URL button should produce a short URL', function () { - var re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); + let re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$'); return PageObjects.discover.clickShortenUrl() .then(function () { return PageObjects.common.try(function tryingForTime() { diff --git a/test/functional/apps/management/_creation_form_changes.js b/test/functional/apps/management/_creation_form_changes.js index d774268b40524..6920447acf111 100644 --- a/test/functional/apps/management/_creation_form_changes.js +++ b/test/functional/apps/management/_creation_form_changes.js @@ -22,7 +22,7 @@ bdd.describe('user input reactions', function () { }); bdd.it('should hide time-based index pattern when time-based option is unchecked', function () { - var self = this; + let self = this; return PageObjects.settings.getTimeBasedEventsCheckbox() .then(function (selected) { // uncheck the 'time-based events' checkbox @@ -30,14 +30,14 @@ bdd.describe('user input reactions', function () { }) // try to find the checkbox (this shouldn fail) .then(function () { - var waitTime = 10000; + let waitTime = 10000; return PageObjects.settings.getTimeBasedIndexPatternCheckbox(waitTime); }) .then(function () { PageObjects.common.saveScreenshot('Settings-indices-hide-time-based-index-pattern'); // we expect the promise above to fail - var handler = PageObjects.common.createErrorHandler(self); - var msg = 'Found time based index pattern checkbox'; + let handler = PageObjects.common.createErrorHandler(self); + let msg = 'Found time based index pattern checkbox'; handler(msg); }) .catch(function () { diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index fa272902a0a22..bcb08b23308ba 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -48,7 +48,7 @@ bdd.describe('creating and deleting default index', function describeIndexTests( return PageObjects.settings.getTableHeader() .then(function (headers) { PageObjects.common.debug('header.length = ' + headers.length); - var expectedHeaders = [ + let expectedHeaders = [ 'name', 'type', 'format', @@ -60,7 +60,7 @@ bdd.describe('creating and deleting default index', function describeIndexTests( // 6 name type format analyzed indexed controls expect(headers.length).to.be(expectedHeaders.length); - var comparedHeaders = headers.map(function compareHead(header, i) { + let comparedHeaders = headers.map(function compareHead(header, i) { return header.getVisibleText() .then(function (text) { expect(text).to.be(expectedHeaders[i]); @@ -74,7 +74,7 @@ bdd.describe('creating and deleting default index', function describeIndexTests( bdd.describe('index pattern deletion', function indexDelete() { bdd.before(function () { - var expectedAlertText = 'Are you sure you want to remove this index pattern?'; + let expectedAlertText = 'Are you sure you want to remove this index pattern?'; return PageObjects.settings.removeIndexPattern() .then(function (alertText) { PageObjects.common.saveScreenshot('Settings-indices-confirm-remove-index-pattern'); diff --git a/test/functional/apps/management/_index_pattern_popularity.js b/test/functional/apps/management/_index_pattern_popularity.js index 220fa32abd870..6e8b09581b6c7 100644 --- a/test/functional/apps/management/_index_pattern_popularity.js +++ b/test/functional/apps/management/_index_pattern_popularity.js @@ -27,7 +27,7 @@ bdd.describe('index result popularity', function describeIndexTests() { }); bdd.describe('change popularity', function indexPatternCreation() { - var fieldName = 'geo.coordinates'; + let fieldName = 'geo.coordinates'; // set the page size to All again, https://github.com/elastic/kibana/issues/5030 // TODO: remove this after issue #5030 is closed diff --git a/test/functional/apps/management/_index_pattern_results_sort.js b/test/functional/apps/management/_index_pattern_results_sort.js index 9eeba547be3ea..f84dada2e2008 100644 --- a/test/functional/apps/management/_index_pattern_results_sort.js +++ b/test/functional/apps/management/_index_pattern_results_sort.js @@ -16,7 +16,7 @@ bdd.describe('index result field sort', function describeIndexTests() { return esClient.deleteAndUpdateConfigDoc(); }); - var columns = [{ + let columns = [{ heading: 'name', first: '@message', last: 'xss.raw', @@ -77,10 +77,10 @@ bdd.describe('index result field sort', function describeIndexTests() { }); bdd.describe('field list pagination', function () { - var expectedDefaultPageSize = 25; - var expectedFieldCount = 85; - var expectedLastPageCount = 10; - var pages = [1, 2, 3, 4]; + let expectedDefaultPageSize = 25; + let expectedFieldCount = 85; + let expectedLastPageCount = 10; + let pages = [1, 2, 3, 4]; bdd.before(function () { return PageObjects.settings.navigateTo() @@ -110,8 +110,8 @@ bdd.describe('index result field sort', function describeIndexTests() { }); bdd.it('should have the correct number of rows per page', function () { - var pageCount = Math.ceil(expectedFieldCount / expectedDefaultPageSize); - var chain = pages.reduce(function (chain, val) { + let pageCount = Math.ceil(expectedFieldCount / expectedDefaultPageSize); + let chain = pages.reduce(function (chain, val) { return chain.then(function () { return PageObjects.settings.goToPage(val) .then(function () { @@ -122,7 +122,7 @@ bdd.describe('index result field sort', function describeIndexTests() { }) .then(function (pageCount) { PageObjects.common.saveScreenshot('Settings-indices-paged'); - var expectedSize = (val < 4) ? expectedDefaultPageSize : expectedLastPageCount; + let expectedSize = (val < 4) ? expectedDefaultPageSize : expectedLastPageCount; expect(pageCount.length).to.be(expectedSize); }); }); diff --git a/test/functional/apps/management/_initial_state.js b/test/functional/apps/management/_initial_state.js index df889f5247eae..e8d6258b85eec 100644 --- a/test/functional/apps/management/_initial_state.js +++ b/test/functional/apps/management/_initial_state.js @@ -37,7 +37,7 @@ bdd.describe('initial state', function () { }); bdd.it('should contain default index pattern', function () { - var defaultPattern = 'logstash-*'; + let defaultPattern = 'logstash-*'; return PageObjects.settings.getIndexPatternField().getProperty('value') .then(function (pattern) { diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 8176333202185..a6c257eb16ae3 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -10,8 +10,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); return PageObjects.common.navigateToApp('visualize') @@ -60,7 +60,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.describe('area charts', function indexPatternCreation() { - var vizName1 = 'Visualization AreaChart'; + let vizName1 = 'Visualization AreaChart'; bdd.it('should save and load with special characters', function pageHeader() { const vizNamewithSpecialChars = vizName1 + '/?&=%'; @@ -99,12 +99,12 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show correct chart, take screenshot', function pageHeader() { - var chartHeight = 0; - var xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00', + let chartHeight = 0; + let xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00', '2015-09-23 00:00' ]; - var yAxisLabels = ['0','200','400','600','800','1,000','1,200','1,400','1,600']; - var expectedAreaChartData = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, + let yAxisLabels = ['0','200','400','600','800','1,000','1,200','1,400','1,600']; + let expectedAreaChartData = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29 ]; @@ -134,7 +134,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show correct data', function pageHeader() { - var expectedTableData = [ 'September 20th 2015, 00:00:00.000 37', + let expectedTableData = [ 'September 20th 2015, 00:00:00.000 37', 'September 20th 2015, 03:00:00.000 202', 'September 20th 2015, 06:00:00.000 740', 'September 20th 2015, 09:00:00.000 1,437', diff --git a/test/functional/apps/visualize/_chart_types.js b/test/functional/apps/visualize/_chart_types.js index 42191bdb65aab..2f3bee327fb21 100644 --- a/test/functional/apps/visualize/_chart_types.js +++ b/test/functional/apps/visualize/_chart_types.js @@ -17,7 +17,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.describe('chart types', function indexPatternCreation() { bdd.it('should show the correct chart types', function pageHeader() { - var expectedChartTypes = [ + let expectedChartTypes = [ 'Area chart', 'Data table', 'Line chart', 'Markdown widget', 'Metric', 'Pie chart', 'Tile map', 'Vertical bar chart' ]; diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index d49bd7b2cb090..ad241f01b60a8 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -9,8 +9,8 @@ import { import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); @@ -52,7 +52,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.describe('data table', function indexPatternCreation() { - var vizName1 = 'Visualization DataTable'; + let vizName1 = 'Visualization DataTable'; bdd.it('should be able to save and load', function pageHeader() { return PageObjects.visualize.saveVisualization(vizName1) @@ -72,8 +72,8 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show correct data, take screenshot', function pageHeader() { - var chartHeight = 0; - var expectedChartData = [ '0 2,088', '2,000 2,748', '4,000 2,707', '6,000 2,876', + let chartHeight = 0; + let expectedChartData = [ '0 2,088', '2,000 2,748', '4,000 2,707', '6,000 2,876', '8,000 2,863', '10,000 147', '12,000 148', '14,000 129', '16,000 161', '18,000 137' ]; diff --git a/test/functional/apps/visualize/_line_chart.js b/test/functional/apps/visualize/_line_chart.js index e3f11e38aedcc..53fc12f760930 100644 --- a/test/functional/apps/visualize/_line_chart.js +++ b/test/functional/apps/visualize/_line_chart.js @@ -10,8 +10,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); return PageObjects.common.navigateToApp('visualize') @@ -51,10 +51,10 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.describe('line charts', function indexPatternCreation() { - var vizName1 = 'Visualization LineChart'; + let vizName1 = 'Visualization LineChart'; bdd.it('should be able to save and load', function pageHeader() { - var remote = this.remote; + let remote = this.remote; return PageObjects.visualize.saveVisualization(vizName1) .then(function (message) { @@ -75,11 +75,11 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.it('should show correct chart, take screenshot', function pageHeader() { - var remote = this.remote; + let remote = this.remote; // this test only verifies the numerical part of this data // it could also check the legend to verify the extensions - var expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445']; + let expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445']; // sleep a bit before trying to get the chart data return PageObjects.common.sleep(3000) @@ -87,8 +87,8 @@ bdd.describe('visualize app', function describeIndexTests() { return PageObjects.visualize.getLineChartData('fill="#57c17b"') .then(function showData(data) { PageObjects.common.saveScreenshot('Visualize-line-chart'); - var tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% - for (var x = 0; x < data.length; x++) { + let tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% + for (let x = 0; x < data.length; x++) { PageObjects.common.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' + (expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] + ' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x])); @@ -101,8 +101,8 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.it('should show correct data', function pageHeader() { - var remote = this.remote; - var expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445']; + let remote = this.remote; + let expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445']; return PageObjects.visualize.collapseChart() .then(function getDataTableData() { diff --git a/test/functional/apps/visualize/_metric_chart.js b/test/functional/apps/visualize/_metric_chart.js index bdadd31fb8b04..341335b4b5217 100644 --- a/test/functional/apps/visualize/_metric_chart.js +++ b/test/functional/apps/visualize/_metric_chart.js @@ -9,8 +9,8 @@ import { import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); @@ -31,7 +31,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.describe('metric chart', function indexPatternCreation() { bdd.it('should show Count', function pageHeader() { - var expectedCount = ['14,004', 'Count']; + let expectedCount = ['14,004', 'Count']; // initial metric of "Count" is selected by default return PageObjects.common.try(function tryingForTime() { @@ -44,7 +44,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Average', function pageHeader() { - var avgMachineRam = ['13,104,036,080.615', 'Average machine.ram']; + let avgMachineRam = ['13,104,036,080.615', 'Average machine.ram']; return PageObjects.visualize.clickMetricEditor() .then(function () { PageObjects.common.debug('Aggregation = Average'); @@ -68,7 +68,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Sum', function pageHeader() { - var sumPhpMemory = ['85,865,880', 'Sum of phpmemory']; + let sumPhpMemory = ['85,865,880', 'Sum of phpmemory']; PageObjects.common.debug('Aggregation = Sum'); return PageObjects.visualize.selectAggregation('Sum') .then(function selectField() { @@ -89,7 +89,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Median', function pageHeader() { - var medianBytes = ['5,565.263', '50th percentile of bytes']; + let medianBytes = ['5,565.263', '50th percentile of bytes']; // For now, only comparing the text label part of the metric PageObjects.common.debug('Aggregation = Median'); return PageObjects.visualize.selectAggregation('Median') @@ -112,7 +112,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Min', function pageHeader() { - var minTimestamp = ['September 20th 2015, 00:00:00.000', 'Min @timestamp']; + let minTimestamp = ['September 20th 2015, 00:00:00.000', 'Min @timestamp']; PageObjects.common.debug('Aggregation = Min'); return PageObjects.visualize.selectAggregation('Min') .then(function selectField() { @@ -133,7 +133,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Max', function pageHeader() { - var maxRelatedContentArticleModifiedTime = ['April 4th 2015, 00:54:41.000', 'Max relatedContent.article:modified_time']; + let maxRelatedContentArticleModifiedTime = ['April 4th 2015, 00:54:41.000', 'Max relatedContent.article:modified_time']; PageObjects.common.debug('Aggregation = Max'); return PageObjects.visualize.selectAggregation('Max') .then(function selectField() { @@ -154,7 +154,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Standard Deviation', function pageHeader() { - var standardDeviationBytes = [ + let standardDeviationBytes = [ '-1,435.138', 'Lower Standard Deviation of bytes', '12,889.766', 'Upper Standard Deviation of bytes' ]; @@ -178,7 +178,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Unique Count', function pageHeader() { - var uniqueCountClientip = ['1,000', 'Unique count of clientip']; + let uniqueCountClientip = ['1,000', 'Unique count of clientip']; PageObjects.common.debug('Aggregation = Unique Count'); return PageObjects.visualize.selectAggregation('Unique Count') .then(function selectField() { @@ -206,7 +206,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Percentiles', function pageHeader() { - var percentileMachineRam = [ + let percentileMachineRam = [ '2,147,483,648', '1st percentile of machine.ram', '3,221,225,472', '5th percentile of machine.ram', '7,516,192,768', '25th percentile of machine.ram', @@ -236,7 +236,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show Percentile Ranks', function pageHeader() { - var percentileRankBytes = [ '2.036%', 'Percentile rank 99 of "memory"']; + let percentileRankBytes = [ '2.036%', 'Percentile rank 99 of "memory"']; PageObjects.common.debug('Aggregation = Percentile Ranks'); return PageObjects.visualize.selectAggregation('Percentile Ranks') .then(function selectField() { diff --git a/test/functional/apps/visualize/_pie_chart.js b/test/functional/apps/visualize/_pie_chart.js index 4629067fac949..38fd7e1977156 100644 --- a/test/functional/apps/visualize/_pie_chart.js +++ b/test/functional/apps/visualize/_pie_chart.js @@ -10,8 +10,8 @@ import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { bdd.before(function () { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; PageObjects.common.debug('navigateToApp visualize'); return PageObjects.common.navigateToApp('visualize') @@ -59,10 +59,10 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.describe('pie chart', function indexPatternCreation() { - var vizName1 = 'Visualization PieChart'; + let vizName1 = 'Visualization PieChart'; bdd.it('should save and load', function pageHeader() { - var remote = this.remote; + let remote = this.remote; return PageObjects.visualize.saveVisualization(vizName1) .then(function (message) { @@ -85,12 +85,12 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show 10 slices in pie chart, take screenshot', function pageHeader() { - var remote = this.remote; - var expectedPieChartSliceCount = 10; + let remote = this.remote; + let expectedPieChartSliceCount = 10; return PageObjects.visualize.getPieChartData() .then(function (pieData) { - var barHeightTolerance = 1; + let barHeightTolerance = 1; PageObjects.common.debug('pieData.length = ' + pieData.length); PageObjects.common.saveScreenshot('Visualize-pie-chart'); expect(pieData.length).to.be(expectedPieChartSliceCount); @@ -98,8 +98,8 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show correct data', function pageHeader() { - var remote = this.remote; - var expectedTableData = [ '0 55', '40,000 50', '80,000 41', '120,000 43', + let remote = this.remote; + let expectedTableData = [ '0 55', '40,000 50', '80,000 41', '120,000 43', '160,000 44', '200,000 40', '240,000 46', '280,000 39', '320,000 40', '360,000 47' ]; diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index 6381ec32a393a..1e34697c5aa95 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -9,8 +9,8 @@ import { import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; bdd.before(function () { @@ -52,7 +52,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.describe('tile map chart', function indexPatternCreation() { bdd.it('should show correct tile map data on default zoom level', function pageHeader() { - var expectedTableData = [ 'dn 1,429', 'dp 1,418', '9y 1,215', '9z 1,099', 'dr 1,076', + let expectedTableData = [ 'dn 1,429', 'dp 1,418', '9y 1,215', '9z 1,099', 'dr 1,076', 'dj 982', '9v 938', '9q 722', '9w 475', 'cb 457', 'c2 453', '9x 420', 'dq 399', '9r 396', '9t 274', 'c8 271', 'dh 214', 'b6 207', 'bd 206', 'b7 167', 'f0 141', 'be 128', '9m 126', 'bf 85', 'de 73', 'bg 71', '9p 71', 'c1 57', 'c4 50', '9u 48', @@ -75,7 +75,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.it('should zoom out to level 1 from default level 2', function pageHeader() { - var expectedPrecision2Circles = [ { color: '#750000', radius: 48 }, + let expectedPrecision2Circles = [ { color: '#750000', radius: 48 }, { color: '#750000', radius: 48 }, { color: '#750000', radius: 44 }, { color: '#a40000', radius: 42 }, @@ -143,7 +143,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('"Fit data bounds" should zoom to level 3', function pageHeader() { - var expectedPrecision2ZoomCircles = [ { color: '#750000', radius: 192 }, + let expectedPrecision2ZoomCircles = [ { color: '#750000', radius: 192 }, { color: '#750000', radius: 191 }, { color: '#750000', radius: 177 }, { color: '#a40000', radius: 168 }, @@ -206,12 +206,12 @@ bdd.describe('visualize app', function describeIndexTests() { ** changed, then open the saved viz and check that it's back to the original data. */ bdd.it('should save with zoom level and load, take screenshot', function pageHeader() { - var vizName1 = 'Visualization TileMap'; - var expectedTableData = [ 'dr4 127', 'dr7 92', '9q5 91', '9qc 89', 'drk 87', + let vizName1 = 'Visualization TileMap'; + let expectedTableData = [ 'dr4 127', 'dr7 92', '9q5 91', '9qc 89', 'drk 87', 'dps 82', 'dph 82', 'dp3 79', 'dpe 78', 'dp8 77' ]; - var expectedTableDataZoomed = [ 'dr5r 21', 'dps8 20', '9q5b 19', 'b6uc 17', + let expectedTableDataZoomed = [ 'dr5r 21', 'dps8 20', '9q5b 19', 'b6uc 17', '9y63 17', 'c20g 16', 'dqfz 15', 'dr8h 14', 'dp8p 14', 'dp3k 14' ]; diff --git a/test/functional/apps/visualize/_vertical_bar_chart.js b/test/functional/apps/visualize/_vertical_bar_chart.js index b8c8dea03f65a..1161a7d8daa31 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.js +++ b/test/functional/apps/visualize/_vertical_bar_chart.js @@ -9,8 +9,8 @@ import { import PageObjects from '../../../support/page_objects'; bdd.describe('visualize app', function describeIndexTests() { - var fromTime = '2015-09-19 06:31:44.000'; - var toTime = '2015-09-23 18:31:44.000'; + let fromTime = '2015-09-19 06:31:44.000'; + let toTime = '2015-09-23 18:31:44.000'; bdd.before(function () { PageObjects.common.debug('navigateToApp visualize'); @@ -51,7 +51,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.describe('vertical bar chart', function indexPatternCreation() { - var vizName1 = 'Visualization VerticalBarChart'; + let vizName1 = 'Visualization VerticalBarChart'; bdd.it('should save and load', function pageHeader() { return PageObjects.visualize.saveVisualization(vizName1) @@ -74,7 +74,7 @@ bdd.describe('visualize app', function describeIndexTests() { }); bdd.it('should show correct chart, take screenshot', function pageHeader() { - var expectedChartValues = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683, + let expectedChartValues = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29 ]; @@ -96,7 +96,7 @@ bdd.describe('visualize app', function describeIndexTests() { bdd.it('should show correct data', function pageHeader() { // this is only the first page of the tabular data. - var expectedChartData = [ 'September 20th 2015, 00:00:00.000 37', + let expectedChartData = [ 'September 20th 2015, 00:00:00.000 37', 'September 20th 2015, 03:00:00.000 202', 'September 20th 2015, 06:00:00.000 740', 'September 20th 2015, 09:00:00.000 1,437', diff --git a/test/functional/apps/visualize/index.js b/test/functional/apps/visualize/index.js index 9ae80a96a4235..2ad3ec18c6441 100644 --- a/test/functional/apps/visualize/index.js +++ b/test/functional/apps/visualize/index.js @@ -16,11 +16,11 @@ bdd.describe('visualize app', function () { this.timeout = defaultTimeout; bdd.before(function () { - var self = this; + let self = this; remote.setWindowSize(1200,800); PageObjects.common.debug('Starting visualize before method'); - var logstash = scenarioManager.loadIfEmpty('logstashFunctional'); + let logstash = scenarioManager.loadIfEmpty('logstashFunctional'); // delete .kibana index and update configDoc return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'}) .then(function loadkibanaIndexPattern() { diff --git a/test/functional/status_page/index.js b/test/functional/status_page/index.js index afe34c9a947b2..d1f6f0b37c5ae 100644 --- a/test/functional/status_page/index.js +++ b/test/functional/status_page/index.js @@ -4,7 +4,7 @@ import { import PageObjects from '../../support/page_objects'; -var expect = require('expect.js'); +let expect = require('expect.js'); bdd.describe('status page', function () { bdd.before(function () { @@ -12,7 +12,7 @@ bdd.describe('status page', function () { }); bdd.it('should show the kibana plugin as ready', function () { - var self = this; + let self = this; return PageObjects.common.tryForTime(6000, function () { return PageObjects.common.findTestSubject('statusBreakdown') diff --git a/test/mocha_setup.js b/test/mocha_setup.js index ea24360a11832..24acc31cefd35 100644 --- a/test/mocha_setup.js +++ b/test/mocha_setup.js @@ -1,5 +1,5 @@ -var sinon = require('sinon'); -var autoRelease = require('auto-release-sinon'); +let sinon = require('sinon'); +let autoRelease = require('auto-release-sinon'); require('babel/register')(require('../src/optimize/babel_options').node); @@ -13,7 +13,7 @@ require('babel/register')(require('../src/optimize/babel_options').node); // The global "afterEach" variable is also tracked, and once it is assigned by mocha // the variable global is reconfigured to point directly to the new value (from mocha) // and all of the queued invocations are executed. -var queuedAfterEachArgs = []; +let queuedAfterEachArgs = []; Object.defineProperty(global, 'afterEach', { configurable: true, get() { return undefined; }, diff --git a/test/server_config.js b/test/server_config.js index a462a525685b9..ee82cbe035196 100644 --- a/test/server_config.js +++ b/test/server_config.js @@ -1,6 +1,6 @@ -var shield = require('./shield'); +let shield = require('./shield'); -var kibanaURL = '/app/kibana'; +let kibanaURL = '/app/kibana'; module.exports = { servers: { diff --git a/test/support/env_setup.js b/test/support/env_setup.js index 0ced6024f85bb..25683e344da0d 100644 --- a/test/support/env_setup.js +++ b/test/support/env_setup.js @@ -1,4 +1,4 @@ -var defaults = require('lodash').defaults; +let defaults = require('lodash').defaults; const babelOptions = require('../../src/optimize/babel_options'); require('source-map-support').install(); diff --git a/test/support/page_objects/common.js b/test/support/page_objects/common.js index 661ff8f865d35..e7e3731b49a03 100644 --- a/test/support/page_objects/common.js +++ b/test/support/page_objects/common.js @@ -35,7 +35,7 @@ export default class Common { init(remote) { function injectTimestampQuery(func, url) { - var formatted = modifyQueryString(url, function (parsed) { + let formatted = modifyQueryString(url, function (parsed) { parsed.query._t = Date.now(); }); return func.call(this, formatted); @@ -51,7 +51,7 @@ export default class Common { } function modifyQueryString(url, func) { - var parsed = parse(url, true); + let parsed = parse(url, true); if (parsed.query === null) { parsed.query = {}; } @@ -76,8 +76,8 @@ export default class Common { } navigateToApp(appName, testStatusPage) { - var self = this; - var appUrl = getUrl.noAuth(config.servers.kibana, config.apps[appName]); + let self = this; + let appUrl = getUrl.noAuth(config.servers.kibana, config.apps[appName]); self.debug('navigating to ' + appName + ' url: ' + appUrl); function navigateTo(url) { @@ -100,7 +100,7 @@ export default class Common { .then(function (kibanaLoaded) { self.debug('kibanaLoaded = ' + kibanaLoaded); if (!kibanaLoaded) { - var msg = 'Kibana is not loaded, retrying'; + let msg = 'Kibana is not loaded, retrying'; self.debug(msg); throw new Error(msg); } @@ -111,7 +111,7 @@ export default class Common { return self.remote.getCurrentUrl(); }) .then(function (currentUrl) { - var loginPage = new RegExp('login').test(currentUrl); + let loginPage = new RegExp('login').test(currentUrl); if (loginPage) { self.debug('Found loginPage = ' + loginPage + ', username = ' + config.servers.kibana.shield.username); @@ -126,7 +126,7 @@ export default class Common { }) .then(function (currentUrl) { currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//'); - var maxAdditionalLengthOnNavUrl = 230; + let maxAdditionalLengthOnNavUrl = 230; // On several test failures at the end of the TileMap test we try to navigate back to // Visualize so we can create the next Vertical Bar Chart, but we can see from the // logging and the screenshot that it's still on the TileMap page. Why didn't the "get" @@ -137,11 +137,11 @@ export default class Common { // Navigating to Settings when there is a default index pattern has a URL length of 196 // (from debug output). Some other tabs may also be long. But a rather simple configured // visualization is about 1000 chars long. So at least we catch that case. - var navSuccessful = new RegExp(appUrl + '.{0,' + maxAdditionalLengthOnNavUrl + '}$') + let navSuccessful = new RegExp(appUrl + '.{0,' + maxAdditionalLengthOnNavUrl + '}$') .test(currentUrl); if (!navSuccessful) { - var msg = 'App failed to load: ' + appName + + let msg = 'App failed to load: ' + appName + ' in ' + defaultFindTimeout + 'ms' + ' appUrl = ' + appUrl + ' currentUrl = ' + currentUrl; @@ -156,7 +156,7 @@ export default class Common { return navigateTo(appUrl) .then(function (currentUrl) { - var lastUrl = currentUrl; + let lastUrl = currentUrl; return self.try(function () { // give the app time to update the URL return self.sleep(501) @@ -175,7 +175,7 @@ export default class Common { } runScript(fn, timeout) { - var self = this; + let self = this; // by default, give the app 10 seconds to load timeout = timeout || 10000; @@ -183,9 +183,9 @@ export default class Common { return self.remote .setExecuteAsyncTimeout(timeout) .executeAsync(function (done) { - var interval = setInterval(function () { - var ready = (document.readyState === 'complete'); - var hasJQuery = !!window.$; + let interval = setInterval(function () { + let ready = (document.readyState === 'complete'); + let hasJQuery = !!window.$; if (ready && hasJQuery) { console.log('doc ready, jquery loaded'); @@ -199,25 +199,25 @@ export default class Common { } getApp() { - var self = this; + let self = this; return self.remote.setFindTimeout(defaultFindTimeout) .findByCssSelector('.app-wrapper .application') .then(function () { return self.runScript(function () { - var $ = window.$; - var $scope = $('.app-wrapper .application').scope(); + let $ = window.$; + let $scope = $('.app-wrapper .application').scope(); return $scope ? $scope.chrome.getApp() : {}; }); }); } checkForKibanaApp() { - var self = this; + let self = this; return self.getApp() .then(function (app) { - var appId = app.id; + let appId = app.id; self.debug('current application: ' + appId); return appId === 'kibana'; }) @@ -246,7 +246,7 @@ export default class Common { } sleep(sleepMilliseconds) { - var self = this; + let self = this; self.debug('... sleep(' + sleepMilliseconds + ') start'); return bluebird.resolve().delay(sleepMilliseconds) diff --git a/test/support/page_objects/console_page.js b/test/support/page_objects/console_page.js index f896eebade953..a18668b4eaac7 100644 --- a/test/support/page_objects/console_page.js +++ b/test/support/page_objects/console_page.js @@ -32,7 +32,7 @@ export default class ConsolePage { return line.getVisibleText(); } - var getEditorDataPromises = editorData.map(getEditorData); + let getEditorDataPromises = editorData.map(getEditorData); return Promise.all(getEditorDataPromises); }); } diff --git a/test/support/page_objects/dashboard_page.js b/test/support/page_objects/dashboard_page.js index 3b15bec5b955f..bac3c80d49c93 100644 --- a/test/support/page_objects/dashboard_page.js +++ b/test/support/page_objects/dashboard_page.js @@ -124,7 +124,7 @@ export default class DashboardPage { // use the search filter box to narrow the results down to a single // entry, or at least to a single page of results loadSavedDashboard(dashName) { - var self = this; + let self = this; return this.findTimeout .findByCssSelector('button.ng-scope[aria-label="Load Saved Dashboard"]') .click() @@ -160,7 +160,7 @@ export default class DashboardPage { return chart.getAttribute('title'); } - var getTitlePromises = titleObjects.map(getTitles); + let getTitlePromises = titleObjects.map(getTitles); return Promise.all(getTitlePromises); }); } @@ -172,7 +172,7 @@ export default class DashboardPage { .then(function (titleObjects) { function getTitles(chart) { - var obj = {}; + let obj = {}; return chart.getAttribute('data-col') .then(theData => { obj = {dataCol:theData}; @@ -211,7 +211,7 @@ export default class DashboardPage { }); } - var getTitlePromises = titleObjects.map(getTitles); + let getTitlePromises = titleObjects.map(getTitles); return Promise.all(getTitlePromises); }); } diff --git a/test/support/page_objects/discover_page.js b/test/support/page_objects/discover_page.js index 0ffe20ed99257..d03fd696cde03 100644 --- a/test/support/page_objects/discover_page.js +++ b/test/support/page_objects/discover_page.js @@ -88,7 +88,7 @@ export default class DiscoverPage { .getAttribute('height'); } - var getChartDataPromises = chartData.map(getChartData); + let getChartDataPromises = chartData.map(getChartData); return Promise.all(getChartDataPromises); }) .then(function (bars) { diff --git a/test/support/page_objects/header_page.js b/test/support/page_objects/header_page.js index 9312895531a62..05db918f09e2d 100644 --- a/test/support/page_objects/header_page.js +++ b/test/support/page_objects/header_page.js @@ -73,7 +73,7 @@ export default class HeaderPage { } clickGoButton() { - var self = this; + let self = this; return this.remote.setFindTimeout(defaultFindTimeout) .findByClassName('kbn-timepicker-go') .click() diff --git a/test/support/page_objects/settings_page.js b/test/support/page_objects/settings_page.js index 4209ac1cabe6e..c9982943c9be2 100644 --- a/test/support/page_objects/settings_page.js +++ b/test/support/page_objects/settings_page.js @@ -41,7 +41,7 @@ export default class SettingsPage { } setAdvancedSettings(propertyName, propertyValue) { - var self = this; + let self = this; return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' editButton') .click() @@ -69,7 +69,7 @@ export default class SettingsPage { } getAdvancedSettings(propertyName) { - var self = this; + let self = this; PageObjects.common.debug('in setAdvancedSettings'); return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' currentValue') .getVisibleText(); @@ -177,7 +177,7 @@ export default class SettingsPage { }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Bluebird.all(getChartTypesPromises); }); } @@ -192,8 +192,8 @@ export default class SettingsPage { } getFieldsTabCount() { - var self = this; - var selector = 'li.kbn-management-tab.active a small'; + let self = this; + let selector = 'li.kbn-management-tab.active a small'; return PageObjects.common.try(function () { return self.remote.setFindTimeout(defaultFindTimeout / 10) @@ -206,12 +206,12 @@ export default class SettingsPage { } getPageSize() { - var selectedItemLabel = ''; + let selectedItemLabel = ''; return this.remote.setFindTimeout(defaultFindTimeout) .findAllByCssSelector('select.ng-pristine.ng-valid.ng-untouched option') .then(function (chartTypes) { function getChartType(chart) { - var thisChart = chart; + let thisChart = chart; return chart.isSelected() .then(function (isSelected) { if (isSelected === true) { @@ -223,7 +223,7 @@ export default class SettingsPage { }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Bluebird.all(getChartTypesPromises); }) .then(() => { @@ -336,7 +336,7 @@ export default class SettingsPage { } removeIndexPattern() { - var alertText; + let alertText; return PageObjects.common.try(() => { PageObjects.common.debug('click delete index pattern button'); diff --git a/test/support/page_objects/shield_page.js b/test/support/page_objects/shield_page.js index 5840169cdba02..529ef9c59ade0 100644 --- a/test/support/page_objects/shield_page.js +++ b/test/support/page_objects/shield_page.js @@ -10,7 +10,7 @@ export default class ShieldPage { } login(user, pwd) { - var remote = this.remote; + let remote = this.remote; return remote.setFindTimeout(defaultFindTimeout) .findById('username') .type(user) diff --git a/test/support/page_objects/visualize_page.js b/test/support/page_objects/visualize_page.js index 094d7e2e010a2..092592f6910f1 100644 --- a/test/support/page_objects/visualize_page.js +++ b/test/support/page_objects/visualize_page.js @@ -75,7 +75,7 @@ export default class VisualizePage { } getChartTypes() { - var types = []; + let types = []; return this.remote .setFindTimeout(defaultFindTimeout) .findAllByCssSelector('.wizard-type-heading h4') @@ -83,7 +83,7 @@ export default class VisualizePage { function getChartType(chart) { return chart.getVisibleText(); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then(function (texts) { @@ -208,7 +208,7 @@ export default class VisualizePage { } }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }); } @@ -228,7 +228,7 @@ export default class VisualizePage { } selectField(fieldValue) { - var self = this; + let self = this; return PageObjects.common.try(function tryingForTime() { return self.remote .setFindTimeout(defaultFindTimeout) @@ -350,7 +350,7 @@ export default class VisualizePage { } clickVisualizationByLinkText(vizName) { - var self = this; + let self = this; PageObjects.common.debug('clickVisualizationByLinkText(' + vizName + ')'); return PageObjects.common.try(function tryingForTime() { @@ -364,7 +364,7 @@ export default class VisualizePage { // this starts by clicking the Load Saved Viz button, not from the // bottom half of the "Create a new visualization Step 1" page loadSavedVisualization(vizName) { - var self = this; + let self = this; return this.clickLoadSavedVisButton() .then(function filterVisualization() { return self.openSavedVisualization(vizName); @@ -374,7 +374,7 @@ export default class VisualizePage { // this is for starting on the // bottom half of the "Create a new visualization Step 1" page openSavedVisualization(vizName) { - var self = this; + let self = this; return self.filterVisByName(vizName) .then(() => { return PageObjects.common.sleep(1000); @@ -393,7 +393,7 @@ export default class VisualizePage { return chart .getVisibleText(); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then(texts => { @@ -412,7 +412,7 @@ export default class VisualizePage { return chart .getVisibleText(); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then(texts => { @@ -428,14 +428,14 @@ export default class VisualizePage { */ getAreaChartData(aggregateName) { - var self = this.remote; - var chartData = []; - var tempArray = []; - var chartSections = 0; - var chartMap = {}; - var height = 0; - var yAxisLabel = 0; - var yAxisHeight = 0; + let self = this.remote; + let chartData = []; + let tempArray = []; + let chartSections = 0; + let chartMap = {}; + let height = 0; + let yAxisLabel = 0; + let yAxisHeight = 0; // 1). get the maximim chart Y-Axis marker value return this.remote @@ -474,7 +474,7 @@ export default class VisualizePage { tempArray = data.replace('M','').split('L'); chartSections = tempArray.length / 2; PageObjects.common.debug('chartSections = ' + chartSections + ' height = ' + yAxisHeight + ' yAxisLabel = ' + yAxisLabel); - for (var i = 0; i < chartSections; i++) { + for (let i = 0; i < chartSections; i++) { chartData[i] = Math.round((yAxisHeight - tempArray[i].split(',')[1]) / yAxisHeight * yAxisLabel); PageObjects.common.debug('chartData[i] =' + chartData[i]); } @@ -485,9 +485,9 @@ export default class VisualizePage { // The current test shows dots, not a line. This function gets the dots and normalizes their height. getLineChartData(cssPart) { - var self = this.remote; - var yAxisLabel = 0; - var yAxisHeight; + let self = this.remote; + let yAxisLabel = 0; + let yAxisHeight; // 1). get the maximim chart Y-Axis marker value return this.remote @@ -535,7 +535,7 @@ export default class VisualizePage { } // 4). pass the chartTypes to the getChartType function - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }); }) @@ -548,9 +548,9 @@ export default class VisualizePage { // this is ALMOST identical to DiscoverPage.getBarChartData getBarChartData() { - var self = this.remote; - var yAxisLabel = 0; - var yAxisHeight; + let self = this.remote; + let yAxisLabel = 0; + let yAxisHeight; // 1). get the maximim chart Y-Axis marker value return this.remote @@ -601,7 +601,7 @@ export default class VisualizePage { } }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then(function (bars) { @@ -611,7 +611,7 @@ export default class VisualizePage { } getPieChartData() { - var self = this.remote; + let self = this.remote; // 1). get the maximim chart Y-Axis marker value return this.remote @@ -626,7 +626,7 @@ export default class VisualizePage { return slice; }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then(function (slices) { @@ -670,7 +670,7 @@ export default class VisualizePage { } waitForToastMessageGone() { - var self = this; + let self = this; return PageObjects.common.try(function tryingForTime() { return self.remote .setFindTimeout(100) @@ -742,8 +742,8 @@ export default class VisualizePage { .then((chartTypes) => { function getChartType(chart) { - var color; - var radius; + let color; + let radius; return chart.getAttribute('stroke') .then((stroke) => { color = stroke; @@ -760,7 +760,7 @@ export default class VisualizePage { return {color: color, radius: radius}; }); } - var getChartTypesPromises = chartTypes.map(getChartType); + let getChartTypesPromises = chartTypes.map(getChartType); return Promise.all(getChartTypesPromises); }) .then((circles) => { diff --git a/test/support/utils/elastic_dump.js b/test/support/utils/elastic_dump.js index e019a4497e717..cb1f167523547 100644 --- a/test/support/utils/elastic_dump.js +++ b/test/support/utils/elastic_dump.js @@ -4,11 +4,11 @@ import { } from './'; export default (function () { - var util = require('util'); - var path = require('path'); - var url = require('url'); - var resolve = require('path').resolve; - var Elasticdump = require('elasticdump').elasticdump; + let util = require('util'); + let path = require('path'); + let url = require('url'); + let resolve = require('path').resolve; + let Elasticdump = require('elasticdump').elasticdump; function ElasticDump() { } @@ -22,7 +22,7 @@ export default (function () { */ elasticdumpModule: function elasticdumpModule(myinput, myoutput, index, mytype) { - var options = { + let options = { limit: 100, offset: 0, debug: false, @@ -46,12 +46,12 @@ export default (function () { skip: null, toLog: null, }; - var dumper = new Elasticdump(options.input, options.output, options); + let dumper = new Elasticdump(options.input, options.output, options); dumper.on('log', function (message) { Log.debug(message); }); dumper.on('error', function (error) { Log.debug('error', 'Error Emitted => ' + (error.message || JSON.stringify(error))); }); - var promise = new Promise(function (resolve, reject) { + let promise = new Promise(function (resolve, reject) { dumper.dump(function (error, totalWrites) { if (error) { Log.debug('THERE WAS AN ERROR :-('); @@ -72,7 +72,7 @@ export default (function () { ** Fails if the files already exist, so consider appending a timestamp to filename. */ elasticDump: function elasticDump(index, file) { - var self = this; + let self = this; Log.debug('Dumping mapping from ' + url.format(config.servers.elasticsearch) + '/' + index + ' to (' + file + '.mapping.json)'); return this.elasticdumpModule(url.format(config.servers.elasticsearch), @@ -94,7 +94,7 @@ export default (function () { elasticLoad: function elasticLoad(file, index) { // TODO: should we have a flag to delete the index first? // or use scenarioManager.unload(index) ? <<- currently this - var self = this; + let self = this; Log.debug('Loading mapping (test/fixtures/dump_data/' + file + '.mapping.json) into ' + url.format(config.servers.elasticsearch) + '/' + index); return this.elasticdumpModule('test/fixtures/dump_data/' + file + '.mapping.json', diff --git a/test/support/utils/es_client.js b/test/support/utils/es_client.js index 10a85f9fcec39..1235bb3bb7247 100644 --- a/test/support/utils/es_client.js +++ b/test/support/utils/es_client.js @@ -6,8 +6,8 @@ import { export default (function () { - var elasticsearch = require('elasticsearch'); - var Promise = require('bluebird'); + let elasticsearch = require('elasticsearch'); + let Promise = require('bluebird'); function EsClient(server) { if (!server) throw new Error('No server defined'); @@ -50,7 +50,7 @@ export default (function () { ** Also used after deleting .kibana index to know Kibana has recreated it. */ getConfigId: function () { - var configId; + let configId; return this.client.search({ index: '.kibana', @@ -81,9 +81,9 @@ export default (function () { */ updateConfigDoc: function (docMap) { // first we need to get the config doc's id so we can use it in our _update call - var self = this; - var configId; - var docMapString = JSON.stringify(docMap); + let self = this; + let configId; + let docMapString = JSON.stringify(docMap); return this.getConfigId() // now that we have the id, we can update @@ -110,8 +110,8 @@ export default (function () { * @return {Promise} A promise that is resolved when elasticsearch has a response */ deleteAndUpdateConfigDoc: function (docMap) { - var self = this; - var configId; + let self = this; + let configId; return this.delete('.kibana') .then(function () { @@ -120,7 +120,7 @@ export default (function () { return self.getConfigId(); }); } else { - var docMapString = JSON.stringify(docMap); + let docMapString = JSON.stringify(docMap); return Try.try(function () { return self.updateConfigDoc(docMap); }); diff --git a/test/support/utils/try.js b/test/support/utils/try.js index 1735e3e7f82d3..58ef7a57ef5eb 100644 --- a/test/support/utils/try.js +++ b/test/support/utils/try.js @@ -10,11 +10,11 @@ import Log from './log.js'; class Try { tryForTime(timeout, block) { - var self = this; - var start = Date.now(); - var retryDelay = 502; - var lastTry = 0; - var tempMessage; + let self = this; + let start = Date.now(); + let retryDelay = 502; + let lastTry = 0; + let tempMessage; function attempt() { lastTry = Date.now(); diff --git a/test/unit/api/ingest/_data.js b/test/unit/api/ingest/_data.js index 4d2a4e5249f18..8daffc34eb2f3 100644 --- a/test/unit/api/ingest/_data.js +++ b/test/unit/api/ingest/_data.js @@ -1,9 +1,9 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); - var fakeNamesIndexTemplate = require('intern/dojo/node!../../fixtures/fake_names_index_template.json'); - var fs = require('intern/dojo/node!fs'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); + let fakeNamesIndexTemplate = require('intern/dojo/node!../../fixtures/fake_names_index_template.json'); + let fs = require('intern/dojo/node!fs'); return function (bdd, scenarioManager, request) { const es = scenarioManager.client; @@ -33,7 +33,7 @@ define(function (require) { }); bdd.it('should also accept the raw csv data in the payload body', function () { - var csvData = fs.readFileSync('test/unit/fixtures/fake_names_big.csv', {encoding: 'utf8'}); + let csvData = fs.readFileSync('test/unit/fixtures/fake_names_big.csv', {encoding: 'utf8'}); return request.post('/kibana/names/_data') .send(csvData) diff --git a/test/unit/api/ingest/_del.js b/test/unit/api/ingest/_del.js index 3d174c45feeec..b310dc0df2944 100644 --- a/test/unit/api/ingest/_del.js +++ b/test/unit/api/ingest/_del.js @@ -1,8 +1,8 @@ define(function (require) { - var Promise = require('bluebird'); - var createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); return function (bdd, scenarioManager, request) { diff --git a/test/unit/api/ingest/_post.js b/test/unit/api/ingest/_post.js index 732c9499a70fe..0b70c35ddeaea 100644 --- a/test/unit/api/ingest/_post.js +++ b/test/unit/api/ingest/_post.js @@ -1,8 +1,8 @@ define(function (require) { - var Promise = require('bluebird'); - var createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); return function (bdd, scenarioManager, request) { bdd.describe('POST ingest', function postIngest() { @@ -101,7 +101,7 @@ define(function (require) { id: 'logstash-*' }) .then(function (res) { - var fields = JSON.parse(res._source.fields); + let fields = JSON.parse(res._source.fields); // @timestamp was created with only name and type, all other fields should be set as defaults by API expect(res._source.title).to.be('logstash-*'); expect(fields[1].name).to.be('@timestamp'); @@ -142,7 +142,7 @@ define(function (require) { .then(function () { return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'}) .then(function (template) { - var mappings = template['kibana-logstash-*'].mappings._default_.properties; + let mappings = template['kibana-logstash-*'].mappings._default_.properties; expect(mappings).to.be.ok(); expect(_.isEqual(mappings.ip, {index: true, type: 'ip', doc_values: true})).to.be.ok(); expect(_.isEqual(mappings['@timestamp'], {index: true, type: 'date', doc_values: true})).to.be.ok(); @@ -220,7 +220,7 @@ define(function (require) { bdd.it('should return 409 conflict when the pattern matches existing indices', function existingIndicesConflict() { - var ingestConfig = createTestData(); + let ingestConfig = createTestData(); ingestConfig.index_pattern.id = ingestConfig.index_pattern.title = '.kib*'; return request.post('/kibana/ingest') @@ -229,7 +229,7 @@ define(function (require) { }); bdd.it('should enforce snake_case in the request body', function () { - var ingestConfig = createTestData(); + let ingestConfig = createTestData(); ingestConfig.index_pattern = _.mapKeys(ingestConfig.index_pattern, function (value, key) { return _.camelCase(key); }); diff --git a/test/unit/api/ingest/_processors.js b/test/unit/api/ingest/_processors.js index ecb0c43d7b688..3e1cb7d01e84b 100644 --- a/test/unit/api/ingest/_processors.js +++ b/test/unit/api/ingest/_processors.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); return function (bdd, scenarioManager, request) { bdd.describe('processors', () => { diff --git a/test/unit/api/ingest/_simulate.js b/test/unit/api/ingest/_simulate.js index 7b8daf3c0fe7c..61a1e0e1ef312 100644 --- a/test/unit/api/ingest/_simulate.js +++ b/test/unit/api/ingest/_simulate.js @@ -1,8 +1,8 @@ define(function (require) { - var Promise = require('bluebird'); - var createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let createTestData = require('intern/dojo/node!../../../unit/api/ingest/data'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/index.js b/test/unit/api/ingest/index.js index d83140c7dc9e6..e0a40193c94b2 100644 --- a/test/unit/api/ingest/index.js +++ b/test/unit/api/ingest/index.js @@ -1,20 +1,20 @@ define(function (require) { - var bdd = require('intern!bdd'); - var serverConfig = require('intern/dojo/node!../../../server_config'); - var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenario_manager'); - var request = require('intern/dojo/node!supertest-as-promised'); - var url = require('intern/dojo/node!url'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); - var post = require('./_post'); - var del = require('./_del'); - var data = require('./_data'); - var simulate = require('./_simulate'); - var processors = require('./_processors'); - var processorTypes = require('./processors/index'); + let bdd = require('intern!bdd'); + let serverConfig = require('intern/dojo/node!../../../server_config'); + let ScenarioManager = require('intern/dojo/node!../../../fixtures/scenario_manager'); + let request = require('intern/dojo/node!supertest-as-promised'); + let url = require('intern/dojo/node!url'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); + let post = require('./_post'); + let del = require('./_del'); + let data = require('./_data'); + let simulate = require('./_simulate'); + let processors = require('./_processors'); + let processorTypes = require('./processors/index'); bdd.describe('ingest API', function () { - var scenarioManager = new ScenarioManager(url.format(serverConfig.servers.elasticsearch)); + let scenarioManager = new ScenarioManager(url.format(serverConfig.servers.elasticsearch)); request = request(url.format(serverConfig.servers.kibana) + '/api'); bdd.before(function () { diff --git a/test/unit/api/ingest/processors/_append.js b/test/unit/api/ingest/processors/_append.js index 238cac6b9ee24..7fc214870d7a9 100644 --- a/test/unit/api/ingest/processors/_append.js +++ b/test/unit/api/ingest/processors/_append.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_convert.js b/test/unit/api/ingest/processors/_convert.js index 38a07d3507766..f96a936081f2b 100644 --- a/test/unit/api/ingest/processors/_convert.js +++ b/test/unit/api/ingest/processors/_convert.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_date.js b/test/unit/api/ingest/processors/_date.js index a3e018e4bd885..df21a8ef07383 100644 --- a/test/unit/api/ingest/processors/_date.js +++ b/test/unit/api/ingest/processors/_date.js @@ -1,8 +1,8 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); - var moment = require('intern/dojo/node!moment'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); + let moment = require('intern/dojo/node!moment'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_geoip.js b/test/unit/api/ingest/processors/_geoip.js index 452c3e5d8416c..9131a143c6d9f 100644 --- a/test/unit/api/ingest/processors/_geoip.js +++ b/test/unit/api/ingest/processors/_geoip.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_grok.js b/test/unit/api/ingest/processors/_grok.js index b1ee7d4e2de25..ffb9584e3a706 100644 --- a/test/unit/api/ingest/processors/_grok.js +++ b/test/unit/api/ingest/processors/_grok.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_gsub.js b/test/unit/api/ingest/processors/_gsub.js index 2d97067a911f1..cd9afe53b2004 100644 --- a/test/unit/api/ingest/processors/_gsub.js +++ b/test/unit/api/ingest/processors/_gsub.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_join.js b/test/unit/api/ingest/processors/_join.js index 7e98650fc47c1..18f9896b291ba 100644 --- a/test/unit/api/ingest/processors/_join.js +++ b/test/unit/api/ingest/processors/_join.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_lowercase.js b/test/unit/api/ingest/processors/_lowercase.js index 747dfb003b6c6..df5c0b206afff 100644 --- a/test/unit/api/ingest/processors/_lowercase.js +++ b/test/unit/api/ingest/processors/_lowercase.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_remove.js b/test/unit/api/ingest/processors/_remove.js index f454b79ff936b..6c08025f4457c 100644 --- a/test/unit/api/ingest/processors/_remove.js +++ b/test/unit/api/ingest/processors/_remove.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_rename.js b/test/unit/api/ingest/processors/_rename.js index 3370ba6f48b45..a11249eb74c38 100644 --- a/test/unit/api/ingest/processors/_rename.js +++ b/test/unit/api/ingest/processors/_rename.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_set.js b/test/unit/api/ingest/processors/_set.js index 395a29a80d5b2..9f247ae044fa7 100644 --- a/test/unit/api/ingest/processors/_set.js +++ b/test/unit/api/ingest/processors/_set.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_split.js b/test/unit/api/ingest/processors/_split.js index 9e6900b0f822e..df0473f016a31 100644 --- a/test/unit/api/ingest/processors/_split.js +++ b/test/unit/api/ingest/processors/_split.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_trim.js b/test/unit/api/ingest/processors/_trim.js index 1f08d5c1eb167..da33e3d3be840 100644 --- a/test/unit/api/ingest/processors/_trim.js +++ b/test/unit/api/ingest/processors/_trim.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/_uppercase.js b/test/unit/api/ingest/processors/_uppercase.js index c2cd5cf1b7256..751e695526a57 100644 --- a/test/unit/api/ingest/processors/_uppercase.js +++ b/test/unit/api/ingest/processors/_uppercase.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); const testPipeline = { processors: [{ diff --git a/test/unit/api/ingest/processors/index.js b/test/unit/api/ingest/processors/index.js index 3420996767864..b5d25061c25b8 100644 --- a/test/unit/api/ingest/processors/index.js +++ b/test/unit/api/ingest/processors/index.js @@ -1,18 +1,18 @@ define(function (require) { - var append = require('./_append'); - var convert = require('./_convert'); - var date = require('./_date'); - var geoip = require('./_geoip'); - var grok = require('./_grok'); - var gsub = require('./_gsub'); - var join = require('./_join'); - var lowercase = require('./_lowercase'); - var remove = require('./_remove'); - var rename = require('./_rename'); - var set = require('./_set'); - var split = require('./_split'); - var trim = require('./_trim'); - var uppercase = require('./_uppercase'); + let append = require('./_append'); + let convert = require('./_convert'); + let date = require('./_date'); + let geoip = require('./_geoip'); + let grok = require('./_grok'); + let gsub = require('./_gsub'); + let join = require('./_join'); + let lowercase = require('./_lowercase'); + let remove = require('./_remove'); + let rename = require('./_rename'); + let set = require('./_set'); + let split = require('./_split'); + let trim = require('./_trim'); + let uppercase = require('./_uppercase'); return function processors(bdd, scenarioManager, request) { append(bdd, scenarioManager, request); diff --git a/test/unit/api/search/_count.js b/test/unit/api/search/_count.js index 239a936cfd1ed..235f0b9002358 100644 --- a/test/unit/api/search/_count.js +++ b/test/unit/api/search/_count.js @@ -1,7 +1,7 @@ define(function (require) { - var Promise = require('bluebird'); - var _ = require('intern/dojo/node!lodash'); - var expect = require('intern/dojo/node!expect.js'); + let Promise = require('bluebird'); + let _ = require('intern/dojo/node!lodash'); + let expect = require('intern/dojo/node!expect.js'); return function (bdd, scenarioManager, request) { bdd.describe('Count API', function postIngest() { diff --git a/test/unit/api/search/index.js b/test/unit/api/search/index.js index 85fd81bc12253..111f6d837bf92 100644 --- a/test/unit/api/search/index.js +++ b/test/unit/api/search/index.js @@ -1,13 +1,13 @@ define(function (require) { - var bdd = require('intern!bdd'); - var serverConfig = require('intern/dojo/node!../../../server_config'); - var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenario_manager'); - var request = require('intern/dojo/node!supertest-as-promised'); - var url = require('intern/dojo/node!url'); - var count = require('./_count'); + let bdd = require('intern!bdd'); + let serverConfig = require('intern/dojo/node!../../../server_config'); + let ScenarioManager = require('intern/dojo/node!../../../fixtures/scenario_manager'); + let request = require('intern/dojo/node!supertest-as-promised'); + let url = require('intern/dojo/node!url'); + let count = require('./_count'); bdd.describe('search API', function () { - var scenarioManager = new ScenarioManager(url.format(serverConfig.servers.elasticsearch)); + let scenarioManager = new ScenarioManager(url.format(serverConfig.servers.elasticsearch)); request = request(url.format(serverConfig.servers.kibana) + '/api'); bdd.before(function () { diff --git a/test/utils/__tests__/get_page.js b/test/utils/__tests__/get_page.js index d46f23c77359e..ac61ad2760ff3 100644 --- a/test/utils/__tests__/get_page.js +++ b/test/utils/__tests__/get_page.js @@ -1,9 +1,9 @@ -var expect = require('expect.js'); -var getUrl = require('../get_url'); +let expect = require('expect.js'); +let getUrl = require('../get_url'); describe('getUrl', function () { it('should convert to a url', function () { - var url = getUrl({ + let url = getUrl({ protocol: 'http', hostname: 'localhost', }, { @@ -14,7 +14,7 @@ describe('getUrl', function () { }); it('should convert to a url with port', function () { - var url = getUrl({ + let url = getUrl({ protocol: 'http', hostname: 'localhost', port: 9220 diff --git a/test/utils/get_url.js b/test/utils/get_url.js index 8dd676d98b627..cff9f6c5cb6a1 100644 --- a/test/utils/get_url.js +++ b/test/utils/get_url.js @@ -1,5 +1,5 @@ -var _ = require('lodash'); -var url = require('url'); +let _ = require('lodash'); +let url = require('url'); /** * Converts a config and a pathname to a url diff --git a/test/visual_regression/home/_loading.js b/test/visual_regression/home/_loading.js index a3d77860f34f8..97aa0b81088ff 100644 --- a/test/visual_regression/home/_loading.js +++ b/test/visual_regression/home/_loading.js @@ -5,7 +5,7 @@ import { consolePage } from '../../support'; -var expect = require('expect.js'); +let expect = require('expect.js'); bdd.describe('Loading', function coverLoadingUi() { bdd.it('should show loading feebdack', async function () {