Skip to content

Commit

Permalink
[test] setup babel for the functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Apr 17, 2016
1 parent 176d271 commit 6572766
Show file tree
Hide file tree
Showing 32 changed files with 387 additions and 522 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"simple-git": "1.8.0",
"sinon": "1.17.2",
"source-map": "0.4.4",
"source-map-support": "0.4.0",
"supertest-as-promised": "2.0.2"
},
"engines": {
Expand Down
32 changes: 14 additions & 18 deletions test/functional/apps/discover/_collapse_expand.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var HeaderPage = require('../../../support/pages/header_page');
var SettingsPage = require('../../../support/pages/settings_page');
var DiscoverPage = require('../../../support/pages/discover_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
discoverPage,
headerPage,
scenarioManager,
settingsPage,
} from '../../../support';

return function (bdd, scenarioManager) {
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('discover tab', function describeIndexTests() {
var common;
var headerPage;
var settingsPage;
var discoverPage;
var baseUrl;

bdd.before(function () {
common = new Common(this.remote);
headerPage = new HeaderPage(this.remote);
settingsPage = new SettingsPage(this.remote);
discoverPage = new DiscoverPage(this.remote);

baseUrl = common.getHostPort();

var fromTime = '2015-09-19 06:31:44.000';
Expand Down Expand Up @@ -89,5 +85,5 @@ define(function (require) {
});

});
};
});
}());
}());
27 changes: 14 additions & 13 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var HeaderPage = require('../../../support/pages/header_page');
var SettingsPage = require('../../../support/pages/settings_page');
var DiscoverPage = require('../../../support/pages/discover_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
scenarioManager,
common,
discoverPage,
settingsPage,
headerPage,
} from '../../../support';

return function (bdd, scenarioManager) {
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('discover app', function describeIndexTests() {
var common;
var headerPage;
var settingsPage;
var discoverPage;

bdd.before(function () {
common = new Common(this.remote);
headerPage = new HeaderPage(this.remote);
settingsPage = new SettingsPage(this.remote);
discoverPage = new DiscoverPage(this.remote);
var fromTime = '2015-09-19 06:31:44.000';
var toTime = '2015-09-23 18:31:44.000';

Expand Down Expand Up @@ -275,5 +276,5 @@ define(function (require) {

});
});
};
});
}());
}());
32 changes: 14 additions & 18 deletions test/functional/apps/discover/_field_data.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var HeaderPage = require('../../../support/pages/header_page');
var SettingsPage = require('../../../support/pages/settings_page');
var DiscoverPage = require('../../../support/pages/discover_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
discoverPage,
headerPage,
scenarioManager,
settingsPage
} from '../../../support';

return function (bdd, scenarioManager) {
bdd.describe('discover app', function describeIndexTests() {
var common;
var headerPage;
var settingsPage;
var discoverPage;
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('discover app', function describeIndexTests() {
bdd.before(function () {
common = new Common(this.remote);
headerPage = new HeaderPage(this.remote);
settingsPage = new SettingsPage(this.remote);
discoverPage = new DiscoverPage(this.remote);
var fromTime = '2015-09-19 06:31:44.000';
var toTime = '2015-09-23 18:31:44.000';

Expand Down Expand Up @@ -263,5 +259,5 @@ define(function (require) {

});
});
};
});
}());
}());
25 changes: 7 additions & 18 deletions test/functional/apps/discover/_shared_links.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var HeaderPage = require('../../../support/pages/header_page');
var SettingsPage = require('../../../support/pages/settings_page');
var DiscoverPage = require('../../../support/pages/discover_page');
var expect = require('intern/dojo/node!expect.js');

return function (bdd, scenarioManager) {
import { bdd, common, discoverPage, headerPage, settingsPage, scenarioManager } from '../../../support';

(function () {
var expect = require('expect.js');

(function () {
bdd.describe('shared links', function describeIndexTests() {
var common;
var headerPage;
var settingsPage;
var discoverPage;
var baseUrl;
// The message changes for Firefox < 41 and Firefox >= 41
// var expectedToastMessage = 'Share search: URL selected. Press Ctrl+C to copy.';
Expand All @@ -19,11 +13,6 @@ define(function (require) {
var expectedToastMessage = /Share search: URL (selected\. Press Ctrl\+C to copy\.|copied to clipboard\.)/;

bdd.before(function () {
common = new Common(this.remote);
headerPage = new HeaderPage(this.remote);
settingsPage = new SettingsPage(this.remote);
discoverPage = new DiscoverPage(this.remote);

baseUrl = common.getHostPort();

var fromTime = '2015-09-19 06:31:44.000';
Expand Down Expand Up @@ -141,5 +130,5 @@ define(function (require) {

});
});
};
}());
});
30 changes: 8 additions & 22 deletions test/functional/apps/discover/index.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
define(function (require) {
var bdd = require('intern!bdd');
var config = require('intern').config;
var url = require('intern/dojo/node!url');
var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenario_manager');
var discoverTest = require('./_discover');
var fieldData = require('./_field_data');
var sharedLinks = require('./_shared_links');
var collapseExpand = require('./_collapse_expand');
import { bdd, remote, scenarioManager, defaultTimeout } from '../../../support';

(function () {
bdd.describe('discover app', function () {
var remote;
var scenarioManager = new ScenarioManager(url.format(config.servers.elasticsearch));
this.timeout = config.timeouts.default;
this.timeout = defaultTimeout;

bdd.before(function () {
remote = this.remote;
return remote.setWindowSize(1200,800);
});

bdd.after(function unloadMakelogs() {
return scenarioManager.unload('logstashFunctional');
});

discoverTest(bdd, scenarioManager);

fieldData(bdd, scenarioManager);

sharedLinks(bdd, scenarioManager);

collapseExpand(bdd, scenarioManager);

require('./_discover');
require('./_field_data');
require('./_shared_links');
require('./_collapse_expand');
});
});
}());
25 changes: 12 additions & 13 deletions test/functional/apps/settings/_advanced_settings.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var SettingsPage = require('../../../support/pages/settings_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
settingsPage,
scenarioManager
} from '../../../support';

return function (bdd, scenarioManager) {
bdd.describe('creating and deleting default index', function describeIndexTests() {
var common;
var settingsPage;
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('creating and deleting default index', function describeIndexTests() {
bdd.before(function () {
common = new Common(this.remote);
settingsPage = new SettingsPage(this.remote);

return scenarioManager.reload('emptyKibana')
.then(function () {
return settingsPage.navigateTo();
Expand Down Expand Up @@ -40,5 +39,5 @@ define(function (require) {

});
});
};
});
}());
}());
27 changes: 12 additions & 15 deletions test/functional/apps/settings/_creation_form_changes.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var SettingsPage = require('../../../support/pages/settings_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
settingsPage,
scenarioManager,
} from '../../../support';

return function (bdd, scenarioManager) {
bdd.describe('user input reactions', function () {
var common;
var settingsPage;

bdd.before(function () {
common = new Common(this.remote);
settingsPage = new SettingsPage(this.remote);
});
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('user input reactions', function () {
bdd.beforeEach(function () {
return scenarioManager.reload('emptyKibana')
.then(function () {
Expand Down Expand Up @@ -56,5 +53,5 @@ define(function (require) {
.catch(common.handleError(this));
});
});
};
});
}());
}());
28 changes: 13 additions & 15 deletions test/functional/apps/settings/_index_pattern_create_delete.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var SettingsPage = require('../../../support/pages/settings_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
remote,
scenarioManager,
settingsPage
} from '../../../support';

return function (bdd, scenarioManager) {
bdd.describe('creating and deleting default index', function describeIndexTests() {
var common;
var settingsPage;
var remote;
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('creating and deleting default index', function describeIndexTests() {
bdd.before(function () {
common = new Common(this.remote);
settingsPage = new SettingsPage(this.remote);
remote = this.remote;

return scenarioManager.reload('emptyKibana')
.then(function () {
return settingsPage.navigateTo();
Expand Down Expand Up @@ -101,5 +99,5 @@ define(function (require) {
});
});
});
};
});
}());
}());
27 changes: 12 additions & 15 deletions test/functional/apps/settings/_index_pattern_popularity.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
define(function (require) {
var Common = require('../../../support/pages/common');
var SettingsPage = require('../../../support/pages/settings_page');
var expect = require('intern/dojo/node!expect.js');
import {
bdd,
common,
scenarioManager,
settingsPage
} from '../../../support';

return function (bdd, scenarioManager) {
bdd.describe('index result popularity', function describeIndexTests() {
var common;
var settingsPage;
var remote;
(function () {
var expect = require('expect.js');

(function () {
bdd.describe('index result popularity', function describeIndexTests() {
bdd.before(function () {
common = new Common(this.remote);
settingsPage = new SettingsPage(this.remote);
remote = this.remote;

return scenarioManager.reload('emptyKibana')
.then(function () {
return settingsPage.navigateTo();
Expand Down Expand Up @@ -111,5 +108,5 @@ define(function (require) {
});
}); // end 'change popularity'
}); // end index result popularity
};
});
}());
}());
Loading

0 comments on commit 6572766

Please sign in to comment.