-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f68075e
commit 1a6f327
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters