mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
* check newest doc timestamp in diff timezones * Check that data shifts with the timezone * use retry.waitFor instead of sleep
This commit is contained in:
parent
ef2314a294
commit
9c76d08c55
1 changed files with 84 additions and 4 deletions
|
@ -26,6 +26,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
const browser = getService('browser');
|
||||
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'pointSeries', 'timePicker']);
|
||||
const pointSeriesVis = PageObjects.pointSeries;
|
||||
const inspector = getService('inspector');
|
||||
|
||||
async function initChart() {
|
||||
const fromTime = '2015-09-19 06:31:44.000';
|
||||
|
@ -182,7 +183,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
});
|
||||
|
||||
describe('x axis labels', async function () {
|
||||
describe('timezones', async function () {
|
||||
const expectedLabels = [
|
||||
'2015-09-20 00:00',
|
||||
'2015-09-21 00:00',
|
||||
|
@ -203,11 +204,90 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
const labels = await PageObjects.visualize.getXAxisLabels();
|
||||
|
||||
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'Browser' });
|
||||
await browser.refresh();
|
||||
|
||||
expect(labels).to.eql(expectedLabels);
|
||||
});
|
||||
|
||||
it('should show different labels in different timezone', async function () {
|
||||
const fromTime = '2015-09-22 09:05:47.415';
|
||||
const toTime = '2015-09-22 16:08:34.554';
|
||||
// note that we're setting the absolute time range while we're in 'America/Phoenix' tz
|
||||
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
|
||||
await PageObjects.visualize.waitForRenderingCount();
|
||||
|
||||
await retry.waitFor('wait for x-axis labels to match expected for Phoenix', async () => {
|
||||
const labels = await PageObjects.visualize.getXAxisLabels();
|
||||
log.debug(`Labels: ${labels}`);
|
||||
return labels.toString() === [ '10:00', '11:00', '12:00', '13:00', '14:00', '15:00' ].toString();
|
||||
});
|
||||
|
||||
const expectedTableData = [ [ '09:05', '13', '13,463,070,562.462' ],
|
||||
[ '09:10', '23', '11,518,321,384.727' ],
|
||||
[ '09:15', '24', '12,437,509,461.333' ],
|
||||
[ '09:20', '30', '14,439,976,253.793' ],
|
||||
[ '09:25', '23', '11,017,524,802.783' ],
|
||||
[ '09:30', '30', '10,774,443,820.138' ],
|
||||
[ '09:35', '25', '10,565,619,548.16' ],
|
||||
[ '09:40', '21', '16,412,910,738.286' ],
|
||||
[ '09:45', '21', '13,207,024,435.2' ],
|
||||
[ '09:50', '26', '12,091,266,626.783' ],
|
||||
[ '09:55', '11', '8,882,773,271.273' ],
|
||||
[ '10:00', '17', '15,367,929,856' ],
|
||||
[ '10:05', '17', '10,990,063,375.059' ],
|
||||
[ '10:10', '11', '12,884,901,888' ],
|
||||
[ '10:15', '14', '10,200,547,328' ],
|
||||
[ '10:20', '21', '12,240,656,793.6' ],
|
||||
[ '10:25', '10', '10,737,418,240' ],
|
||||
[ '10:30', '12', '10,111,068,842.667' ],
|
||||
[ '10:35', '10', '11,381,663,334.4' ],
|
||||
[ '10:40', '14', '11,657,768,374.857' ]
|
||||
];
|
||||
await inspector.open();
|
||||
await inspector.expectTableData(expectedTableData);
|
||||
await inspector.close();
|
||||
log.debug('set \'dateFormat:tz\': \'UTC\'');
|
||||
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC', 'defaultIndex': 'logstash-*' });
|
||||
// We set the tz from 'America/Phoenix' to UTC and refreshing the browser but not re-entering
|
||||
// the absolute time range so the timepicker is going to shift +7 hours.
|
||||
await browser.refresh();
|
||||
// wait some time before trying to check for rendering count
|
||||
await PageObjects.header.awaitKibanaChrome();
|
||||
await PageObjects.visualize.waitForRenderingCount();
|
||||
log.debug('getXAxisLabels');
|
||||
|
||||
await retry.waitFor('wait for x-axis labels to match expected for UTC', async () => {
|
||||
const labels2 = await PageObjects.visualize.getXAxisLabels();
|
||||
log.debug(`Labels: ${labels2}`);
|
||||
return labels2.toString() === [ '17:00', '18:00', '19:00', '20:00', '21:00', '22:00' ].toString();
|
||||
});
|
||||
|
||||
// the expected inspector data is the same but with timestamps shifted +7 hours
|
||||
const expectedTableData2 = [ [ '16:05', '13', '13,463,070,562.462' ],
|
||||
[ '16:10', '23', '11,518,321,384.727' ],
|
||||
[ '16:15', '24', '12,437,509,461.333' ],
|
||||
[ '16:20', '30', '14,439,976,253.793' ],
|
||||
[ '16:25', '23', '11,017,524,802.783' ],
|
||||
[ '16:30', '30', '10,774,443,820.138' ],
|
||||
[ '16:35', '25', '10,565,619,548.16' ],
|
||||
[ '16:40', '21', '16,412,910,738.286' ],
|
||||
[ '16:45', '21', '13,207,024,435.2' ],
|
||||
[ '16:50', '26', '12,091,266,626.783' ],
|
||||
[ '16:55', '11', '8,882,773,271.273' ],
|
||||
[ '17:00', '17', '15,367,929,856' ],
|
||||
[ '17:05', '17', '10,990,063,375.059' ],
|
||||
[ '17:10', '11', '12,884,901,888' ],
|
||||
[ '17:15', '14', '10,200,547,328' ],
|
||||
[ '17:20', '21', '12,240,656,793.6' ],
|
||||
[ '17:25', '10', '10,737,418,240' ],
|
||||
[ '17:30', '12', '10,111,068,842.667' ],
|
||||
[ '17:35', '10', '11,381,663,334.4' ],
|
||||
[ '17:40', '14', '11,657,768,374.857' ]
|
||||
];
|
||||
await inspector.open();
|
||||
await inspector.expectTableData(expectedTableData2);
|
||||
log.debug('close inspector');
|
||||
await inspector.close();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue