Skip to content

Commit

Permalink
Add back missing function test file
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme committed Jan 7, 2020
1 parent f68075e commit 1a6f327
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
86 changes: 86 additions & 0 deletions test/functional/apps/discover/_discover_histogram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import expect from '@kbn/expect';

export default function({ getService, getPageObjects }) {
const log = getService('log');
const esArchiver = getService('esArchiver');
const browser = getService('browser');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
const defaultSettings = {
defaultIndex: 'logstash-*',
};

describe('discover histogram', function describeIndexTests() {
before(async function() {
// delete .kibana index and update configDoc
await kibanaServer.uiSettings.replace(defaultSettings);

log.debug('load kibana index with default index pattern');
await esArchiver.load('discover');
await esArchiver.load('long_window_logstash');
await esArchiver.load('visualize');
log.debug('discover');
await PageObjects.common.navigateToApp('discover');
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'Europe/Berlin' });
await browser.refresh();
await PageObjects.header.awaitKibanaChrome();
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.selectIndexPattern('long-window-logstash-*');
});
after(async () => {
await esArchiver.unload('long_window_logstash');
await esArchiver.unload('visualize');
await esArchiver.unload('discover');
});

it('should visualize monthly data with different day intervals', async () => {
//Nov 1, 2017 @ 01:00:00.000 - Mar 21, 2018 @ 02:00:00.000
const fromTime = '2017-11-01 00:00:00.000';
const toTime = '2018-03-21 00:00:00.000';
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Monthly');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
expect(chartCanvasExist).to.be(true);
});
it('should visualize weekly data with within DST changes', async () => {
//Nov 1, 2017 @ 01:00:00.000 - Mar 21, 2018 @ 02:00:00.000
const fromTime = '2018-03-01 00:00:00.000';
const toTime = '2018-05-01 00:00:00.000';
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Weekly');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
expect(chartCanvasExist).to.be(true);
});
it('should visualize monthly data with different years Scaled to 30d', async () => {
//Nov 1, 2017 @ 01:00:00.000 - Mar 21, 2018 @ 02:00:00.000
const fromTime = '2010-01-01 00:00:00.000';
const toTime = '2018-03-21 00:00:00.000';
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Daily');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
expect(chartCanvasExist).to.be(true);
});
});
}
1 change: 1 addition & 0 deletions test/functional/apps/discover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function({ getService, loadTestFile }) {

loadTestFile(require.resolve('./_saved_queries'));
loadTestFile(require.resolve('./_discover'));
loadTestFile(require.resolve('./_discover_histogram'));
loadTestFile(require.resolve('./_filter_editor'));
loadTestFile(require.resolve('./_errors'));
loadTestFile(require.resolve('./_field_data'));
Expand Down

0 comments on commit 1a6f327

Please sign in to comment.